|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Accessing every second node, extract and sort th
Hello, > Trying to convert to a XML document into another, I'm trying to > figure out how to access every second element node from the document > root, take and sort all their elements according 2 attributes ( > GroupNumber and ElementNumber) Some stylesheet code and example select statements would have made figuring out what you want much easier, but I think you want something like: <xsl:apply-templates select="/*/*/*" > <xsl:sort select="@GroupNumber" /> <xsl:sort select="@ElementNumber" /> </xsl:apply-templates> This selects all elements on the third level, that is, all childnodes of "every second node", imho better indicated as "nodes on the third level". But what do you mean with > without copy the name of the second element name. ? Simply copying the selected nodes to the result document is done with: <xsl:template match="/*/*/*"> <xsl:copy> <xsl:copy-of select="@*" /> </xsl:copy> </xsl:template> One can achieve this with a for-each loop too, but that isn't the declarative XSLT way. Greetings Christoph If you are not the intended addressee, please inform us immediately that you have received this e-mail in error, and delete it. We thank you for your cooperation.
|
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
|






