List of XSLT instructions/functions that change the context node?

喜你入骨 提交于 2019-12-22 03:36:32

问题


Does anyone know of a list of XSLT instructions/functions that change the context node?

For example, instruction like for-each is one of them.


回答1:


The obvious XSLT 2.0 instructions that change the context are for-each, apply-templates, for-each-group, and analyze-string. But there's also, for example, xsl:sort and xsl:key.

In XPath, the operators / and [] change the context. There are no functions that change the context.




回答2:


There are only two things in XSLT 1.0 that change the context and neither of them are functions. These are:

<xsl:apply-templates select='some-test'/>

(which will lead to the selected nodes being processed, each one becoming the context node as it is processed)

and

<xsl:for-each select='some-test'/>

In XSLT 2.0, you also have

<xsl:for-each-group/>

(which sets the context node in slightly more complex way than xsl:apply-templates and xsl:for-each



来源:https://stackoverflow.com/questions/6953265/list-of-xslt-instructions-functions-that-change-the-context-node

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!