[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Sibling axis and as="element()"
> Is this the case? Do parentless trees lose their axes? if you aint got a parent you aint got a brother, it's just a matter of biology:-) If you use xsl:variable with content and no as attribute then (for xslt1 compatibility) an implict document node is created, and any nodes generated are made children of that document node, so as a consequence of that they become siblings of each other. If you use an as attribute then the implict document node is not generated and the result is a sequence. In your case the sequence is of newly constructed, parentless nodes so they are not siblings. In this case they have no siblings at all, but in other cases they could have siblings but not in the variable. If your input looks like <x> <a><b/></c/></a> <a><b/></c/></a> <a><b/></c/></a> </x> and your variable looks like <xsl:variable name="x" as="element()*"> <xsl:sequence select="/x/a/b"/> </xsl:variable> then the $x is the same as if you'd have gone <xsl:variable name="x" select="/x/a/b"/> and (as in 1.0) you'd have a sequence of 3 b elements, and they'd all have siblings which are c elements which are not in the sequence (aka node set) bound to the variable. David
|
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
|