Merge functionality of two xsl files into a single file (continued…)

后端 未结 3 767
鱼传尺愫
鱼传尺愫 2021-01-24 11:49

This is in continuation of my question:

Merge functionality of two xsl files into a single file (not a xsl import or include issue)


I have to merge

3条回答
  •  礼貌的吻别
    2021-01-24 12:20

    Pure XSLT 1.0 does not support chaining templates (nor stylesheets as a whole). You can either solve this program outside of XSLT by calling the second xslt template and passing it the output of the first manually, or you can use the fairly pervasive extension function node-set(). MSXML, .NET, EXSL and many other implementations support such a function. The namespace prefix for node-set varies depending on XSLT implementation, but the EXSL prefix is a good bet (and .NET, though undocumented, supports this).

    To use node-set store the result of a template in an xsl:variable or xsl:param and do something like .

    Finally, you can of course rewrite your two templates to provide the functionality of both in one pass - but in general, this isn't a trivial thing to do.

提交回复
热议问题