Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/295.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 如何使用XSLTProcessor中的嵌入式EXSLT?_Php_Xslt_Exslt - Fatal编程技术网

Php 如何使用XSLTProcessor中的嵌入式EXSLT?

Php 如何使用XSLTProcessor中的嵌入式EXSLT?,php,xslt,exslt,Php,Xslt,Exslt,XSLTProcessor::hasExsltSupport()返回true。现在我需要修改什么才能使用它 我有 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:date="http://exslt.org/dates-and-times" extension-elemen

XSLTProcessor::hasExsltSupport()返回true。现在我需要修改什么才能使用它

我有

<xsl:stylesheet version="1.0" 
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:date="http://exslt.org/dates-and-times"
                extension-element-prefixes="date">

转变我正在尝试做的事情:

 <td>
   <xsl:value-of select="date:format-date(translate(property[@name='changedate']/value, ' ', 'T'), 'd.m.y h:i')" />
 </td>

  • 属性[@name='changedate']/值是来自SQL DB的戳记(yyyy-mm-dd hh:mm:ss)
  • 首先将该空间替换为T,以便
  • 更改*yyyy-mm-dd***T***hh:mm:ss*->dd.mm.yyyy-hh:mm
错误:

警告:XSLTProcessor::transformToXml()[XSLTProcessor.transformToXml]:xmlXPathCompOpEval:函数日期绑定到未定义的前缀格式

PHP版本5.2.9

  • 启用XSL
  • libxslt版本1.1.24
  • 根据libxml版本2.6.32编译的libxslt
  • 已启用EXSLT
  • libexslt版本1.1.24

    • “以下扩展函数被认为不稳定,不属于EXSLT-日期和时间的核心。声称支持EXSLT-日期和时间的处理器可能不支持这些函数。”-这也适用于
      格式日期

      “以下扩展功能不稳定,不属于EXSLT的核心部分-日期和时间。声称支持EXSLT的处理器-日期和时间可能不支持这些功能。”-这也适用于
      格式化日期

      我用它修复了它。它将日期信息移动到正确的位置

      <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
        <xsl:template name="FormatDate">
          <xsl:param name="DateTime" />
      
          <xsl:variable name="mo">
            <xsl:value-of select="substring($DateTime, 6, 2)" />
          </xsl:variable>
      
          <xsl:variable name="day">
            <xsl:value-of select="substring($DateTime, 9, 2)" />
          </xsl:variable>
      
          <xsl:variable name="year">
            <xsl:value-of select="substring($DateTime, 1, 4)" />
          </xsl:variable>
      
          <xsl:variable name="time">
            <xsl:value-of select="substring($DateTime, 12, 8)" />
          </xsl:variable>
      
          <xsl:variable name="hh">
            <xsl:value-of select="substring($time, 1, 2)" />
          </xsl:variable>
      
          <xsl:variable name="mm">
            <xsl:value-of select="substring($time, 4, 2)" />
          </xsl:variable>
      
          <xsl:value-of select="$day" />
          <xsl:value-of select="'.'" />
          <xsl:value-of select="$mo" />
          <xsl:value-of select="'.'" />
          <xsl:value-of select="$year" />
      
          <xsl:value-of select="' '" />
      
          <xsl:value-of select="$hh" />
          <xsl:value-of select="':'" />
          <xsl:value-of select="$mm" />
      
        </xsl:template>
      </xsl:stylesheet>
      

      我用这个修复了它。它将日期信息移动到正确的位置

      <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
        <xsl:template name="FormatDate">
          <xsl:param name="DateTime" />
      
          <xsl:variable name="mo">
            <xsl:value-of select="substring($DateTime, 6, 2)" />
          </xsl:variable>
      
          <xsl:variable name="day">
            <xsl:value-of select="substring($DateTime, 9, 2)" />
          </xsl:variable>
      
          <xsl:variable name="year">
            <xsl:value-of select="substring($DateTime, 1, 4)" />
          </xsl:variable>
      
          <xsl:variable name="time">
            <xsl:value-of select="substring($DateTime, 12, 8)" />
          </xsl:variable>
      
          <xsl:variable name="hh">
            <xsl:value-of select="substring($time, 1, 2)" />
          </xsl:variable>
      
          <xsl:variable name="mm">
            <xsl:value-of select="substring($time, 4, 2)" />
          </xsl:variable>
      
          <xsl:value-of select="$day" />
          <xsl:value-of select="'.'" />
          <xsl:value-of select="$mo" />
          <xsl:value-of select="'.'" />
          <xsl:value-of select="$year" />
      
          <xsl:value-of select="' '" />
      
          <xsl:value-of select="$hh" />
          <xsl:value-of select="':'" />
          <xsl:value-of select="$mm" />
      
        </xsl:template>
      </xsl:stylesheet>
      
      
      
      您当前的输出/结果/错误是?而您当前的输出/结果/错误是?