[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Trying to understand root-less or document-node-le
David Carlisle wrote:
<xsl:variable name="y2"> I assume, in light of the rest you told, that consequently the same statement with xsl:sequence will yield a copy, instead of the expected reference (which would happen when you specified the as="element()*"). A reason more for being explicit about it in the code.
This is like a good textbook example. Brilliant, this single thing makes it clear how sequences and nodes interact with one another and how it can yield crazy and unexpected results to the unaware. By using <xsl:sequence> the distinction is made clearer. So, basically, from a programming standpoint, one has to ask oneself: do I want to break from my ancestors (xsl:copy) or do I want to keep the navel-string intact (xsl:sequence or select attribute). And in all cases: make explicit what you want.
Though I was aware of the fact that xsl:variable/param creates document nodes, even when you simply have <xsl:variable>text</xsl:variable> and that it is an expensive trade off, I never realized why, or the reason behind it. This clearly is a statement and/or a discussion to make it explicit with an 'as' clause, because the implicit rules are too different between functions and variables. Thanks David, for the clear rundown of the matter. Cheers, -- Abel Braaksma
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|