xsltproc 无法识别 fx:function(不再)
xsltproc not recognizing fx:function (any more)
我有一个奇怪的效果。我使用 xalanj 和 xsltproc,我认为大多数脚本都适用于这两个(以前)。但是,一段时间以来,具有 {http://exslt.org/functions} 功能的 xslt 脚本在 xsltproc 中不再起作用。这是 debian 7.9.
代码片段
<xsl:transform version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:yz="http://www.hegny.de/xxyy"
xmlns:fx="http://exslt.org/functions">
...
<fx:function name="yz:format3">
<xsl:param name="x"/>
<xsl:choose>
...
将与 xalanj 一起正常工作,但 xsltproc 会报错
compilation error: file /home/hegny/prog/syno_recording/xmltv_text.xsl line 67 element param
element param only allowed within a template, variable or param
(第 67 行是 fx:function 下的参数)
另外,调用时xsltproc --dumpextensions
会显示
Registered XSLT Extensions
--------------------------
Registered Extension Functions:
...(nothing containing exslt.org/functions)...
Registered Extension Elements:
{http://exslt.org/functions}result
{http://xmlsoft.org/XSLT/}test
{http://exslt.org/common}document
Registered Extension Modules:
http://icl.com/saxon
http://xmlsoft.org/XSLT/
http://exslt.org/functions
将表明它知道 fx:result 属于 exslt 函数的东西,但不知道 fx:function - 这有什么意义?有人知道如何让 fx:function(返回?)工作吗? - 谢谢
要使用像 fx:function
这样的扩展元素,请确保您的样式表声明了扩展元素的命名空间,并在 xsl:stylesheet
上分别声明了 extension-element-prefixes="fx"
xsl:transform
根样式表的元素。
我有一个奇怪的效果。我使用 xalanj 和 xsltproc,我认为大多数脚本都适用于这两个(以前)。但是,一段时间以来,具有 {http://exslt.org/functions} 功能的 xslt 脚本在 xsltproc 中不再起作用。这是 debian 7.9.
代码片段
<xsl:transform version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:yz="http://www.hegny.de/xxyy"
xmlns:fx="http://exslt.org/functions">
...
<fx:function name="yz:format3">
<xsl:param name="x"/>
<xsl:choose>
...
将与 xalanj 一起正常工作,但 xsltproc 会报错
compilation error: file /home/hegny/prog/syno_recording/xmltv_text.xsl line 67 element param
element param only allowed within a template, variable or param
(第 67 行是 fx:function 下的参数)
另外,调用时xsltproc --dumpextensions
会显示
Registered XSLT Extensions
--------------------------
Registered Extension Functions:
...(nothing containing exslt.org/functions)...
Registered Extension Elements:
{http://exslt.org/functions}result
{http://xmlsoft.org/XSLT/}test
{http://exslt.org/common}document
Registered Extension Modules:
http://icl.com/saxon
http://xmlsoft.org/XSLT/
http://exslt.org/functions
将表明它知道 fx:result 属于 exslt 函数的东西,但不知道 fx:function - 这有什么意义?有人知道如何让 fx:function(返回?)工作吗? - 谢谢
要使用像 fx:function
这样的扩展元素,请确保您的样式表声明了扩展元素的命名空间,并在 xsl:stylesheet
上分别声明了 extension-element-prefixes="fx"
xsl:transform
根样式表的元素。