What are XSLT Result Trees

好久不见. 提交于 2019-12-25 02:44:55

问题


I am reading a book on XSLT 2.0. I am on the chapter of XSLT Result Trees. Frankly, i don't understand it a bit. What are result trees? What is it used for? Why is it important?


回答1:


From the W3C XSLT 2.0 Specification:

"[Definition: The term result tree is used to refer to any tree constructed by instructions in the stylesheet. A result tree is either a final result tree or a temporary tree.]

[Definition: A final result tree is a result tree that forms part of the final output of a transformation. Once created, the contents of a final result tree are not accessible within the stylesheet itself.] The xsl:result-document instruction always creates a final result tree, and a final result tree may also be created implicitly by the initial template."

This means that all output from the XSLT transformation is a set of result trees (this will be a single result tree if no <xsl:result-document> is used).

Also, any temporary tree like one created in the body of an <xsl:variable> (that isn't produced as a separate output, but is used internally in the course of the transformation) is a result tree.

It is important to know that any XSLT transformation operates on trees and the result of the transformation is also a set of trees.




回答2:


XML documents form trees. A result tree is simply the name for the new tree you create after running an XSL transformation on a source tree: "A transformation expressed in XSLT describes rules for transforming zero or more source trees into one or more result trees" (from W3C).



来源:https://stackoverflow.com/questions/3692436/what-are-xslt-result-trees

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