[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

[xsl] [XSLT Streaming] My code visits descendant nodes twice ... why don't I get an error?


Subject: [xsl] [XSLT Streaming] My code visits descendant nodes twice ... why don't I get an error?
From: "Costello, Roger L." <costello@xxxxxxxxx>
Date: Thu, 29 Aug 2013 18:05:35 +0000

Hi Folks,

According to the XSLT specification, when using streaming the XSLT code can
only visit descendant nodes once. In the below code I copy all the child Book
elements (visit #1) and then I count the number of child Book elements (visit
#2). The code works without any errors. Why? It seems like I should have
gotten an error since I visited the child Book elements more than once.

    <xsl:template match="BookCatalogue" mode="streaming">
        <BookStore>
            <xsl:copy-of select="Book"/>
            <NumberOfBooks><xsl:value-of
select="count(Book)"/></NumberOfBooks>
        </BookStore>
    </xsl:template>

/Roger


Current Thread
Keywords