繁体   English   中英

XSLT node-set() function 在 InDesign 中的支持

[英]XSLT node-set() function support in InDesign

I have xslt 1.0 module with ext:node-set function ( xmlns:ext="http://exslt.org/common" ) and would like to use it in InDesign's CC (2014) via Import XML... feature.

When I choose File -> Import XML..., select XML, then Apply XSLT -> Browser... and choose xslt, click OK - I get an error Function 'ext:node-set' not supported .

我尝试将命名空间替换为xmlns:xalan="http://xml.apache.org/xalan"和 function 调用xalan:nodeset - 类似错误Function 'xalan:nodeset' not supported

问题:

  1. 我可以在 InDesign 中使用节点集 function 吗?
  2. InDesign 中使用的是哪个 xslt 处理器?

Ginger Alliance 的 Sablotron 处理器正在 InDesign 中使用。 Ginger Alliance 网站可通过 Wayback Machine https://web.archive.org/web/20090430034418/http://www.gingerall.org/index.html 获得 关于https://www.xml.com/pub/a/2003/07/16/nodeset.html#tab.namespaces , Sablotron Can operate on result tree fragments directly ,即不需要使用 node-set 或 nodeset 函数。

例子:

<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>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM