InDesign 中的 XSLT node-set() 函数支持
XSLT node-set() function support in InDesign
我有带 ext:node-set
功能的 xslt 1.0 模块 (xmlns:ext="http://exslt.org/common"
),想通过 Import XML...
功能在 InDesign 的 CC (2014) 中使用它。
当我选择文件 -> 导入 XML...,select XML,然后应用 XSLT -> 浏览器... 并选择 xslt,单击确定 - 我得到错误 Function 'ext:node-set' not supported
.
我尝试将命名空间替换为 xmlns:xalan="http://xml.apache.org/xalan"
和函数调用 xalan:nodeset
- 类似的错误 Function 'xalan:nodeset' not supported
.
问题:
- 我可以在 InDesign 中使用节点集功能吗?
- InDesign 中使用的是哪个 xslt 处理器?
InDesign 中使用了 Ginger Alliance 的 Sablotron 处理器。 Ginger Alliance 站点可通过 Wayback Machine https://web.archive.org/web/20090430034418/http://www.gingerall.org/index.html. Regarding https://www.xml.com/pub/a/2003/07/16/nodeset.html#tab.namespaces、Sablotron Can operate on result tree fragments directly
获得,即无需使用节点集或节点集功能。
示例:
<xsl:variable name="items">
<item>1</item>
<item>2</item>
<item>3</item>
</xsl:variable>
<xsl:choose>
<xsl:when test="function-available('ext:node-set')"> <!-- for EXSLT compatible processor -->
<xsl:for-each select="ext:node-set($items)//item">
<xsl:value-of select="."/>
</xsl:for-each>
</xsl:when>
<xsl:otherwise> <!-- for InDesign -->
<xsl:for-each select="$items//item">
<xsl:value-of select="."/>
</xsl:for-each>
</xsl:otherwise>
</xsl:choose>
我有带 ext:node-set
功能的 xslt 1.0 模块 (xmlns:ext="http://exslt.org/common"
),想通过 Import XML...
功能在 InDesign 的 CC (2014) 中使用它。
当我选择文件 -> 导入 XML...,select XML,然后应用 XSLT -> 浏览器... 并选择 xslt,单击确定 - 我得到错误 Function 'ext:node-set' not supported
.
我尝试将命名空间替换为 xmlns:xalan="http://xml.apache.org/xalan"
和函数调用 xalan:nodeset
- 类似的错误 Function 'xalan:nodeset' not supported
.
问题:
- 我可以在 InDesign 中使用节点集功能吗?
- InDesign 中使用的是哪个 xslt 处理器?
InDesign 中使用了 Ginger Alliance 的 Sablotron 处理器。 Ginger Alliance 站点可通过 Wayback Machine https://web.archive.org/web/20090430034418/http://www.gingerall.org/index.html. Regarding https://www.xml.com/pub/a/2003/07/16/nodeset.html#tab.namespaces、Sablotron Can operate on result tree fragments directly
获得,即无需使用节点集或节点集功能。
示例:
<xsl:variable name="items">
<item>1</item>
<item>2</item>
<item>3</item>
</xsl:variable>
<xsl:choose>
<xsl:when test="function-available('ext:node-set')"> <!-- for EXSLT compatible processor -->
<xsl:for-each select="ext:node-set($items)//item">
<xsl:value-of select="."/>
</xsl:for-each>
</xsl:when>
<xsl:otherwise> <!-- for InDesign -->
<xsl:for-each select="$items//item">
<xsl:value-of select="."/>
</xsl:for-each>
</xsl:otherwise>
</xsl:choose>