Subject: Re: [xsl] The output of evaluating an XSLT transform is the same regardless of the order in which output elements are evaluated. Right? From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx> Date: Mon, 12 Apr 2010 13:54:59 -0400 |
Is this statement true or false:
XSLT elements that produce output can be evaluated in any order.
Example: This XSLT produces two outputs:
<xsl:text>Hello</xsl:text> <xsl:text>World</xsl:text>
Is this statement true or false:
The output will always be "HelloWorld" regardless of which <xsl:text> element is evaluated first.
Is this explanation correct:
Explanation: the outputs produced by each XSLT element is placed in an in-memory "result tree." Their position in the result tree depends on the sequential order of the outputs in the XSLT document. Thus, this XSLT element:
<xsl:text>World</xsl:text>
occurs later in the XSLT document and so therefore it is placed later in the result tree.
<xsl:call-template name="do-hello"/> <xsl:call-template name="do-world"/> ... <xsl:template name="do-world"> <xsl:text>World</xsl:text> ... <xsl:template name="do-hello"> <xsl:text>Hello</xsl:text>
After the XSLT transform completes executing then the result tree is serialized to an output file,
in document order,
which result in "Hello" first and "World" second.
-- XSLT/XQuery training: San Carlos, California 2010-04-26/30 Principles of XSLT for XQuery Writers: San Francisco,CA 2010-05-03 XSLT/XQuery training: Ottawa, Canada 2010-05-10/14 XSLT/XQuery/UBL/Code List training: Trondheim,Norway 2010-06-02/11 Vote for your XML training: http://www.CraneSoftwrights.com/s/i/ Crane Softwrights Ltd. http://www.CraneSoftwrights.com/s/ G. Ken Holman mailto:gkholman@xxxxxxxxxxxxxxxxxxxx Male Cancer Awareness Nov'07 http://www.CraneSoftwrights.com/s/bc Legal business disclaimers: http://www.CraneSoftwrights.com/legal
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] The output of evaluating , Michael Kay | Thread | Re: [xsl] The output of evaluating , Dimitre Novatchev |
RE: [xsl] The output of evaluating , Michael Kay | Date | Re: [xsl] mixed content grouping by, Imsieke, Gerrit, le- |
Month |