[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] A riddle...
Hello all, i don't see the solution, although there must be one. I'm transforming XML to HTML. This is an example XML: <root> <tree> <leaf idUeber="102149" /> <node idUeber="102150"> <leaf idUeber="102160" /> <leaf idUeber="102165" /> <leaf idUeber="102166" /> <leaf idUeber="102173" /> <leaf idUeber="102174" /> <leaf idUeber="102175" /> </node> <leaf idUeber="102151" /> . . . etc... . </tree> <objects> <Menuestruktur webID="102149"> <moreinfo> </Menuestruktur> <Menuestruktur webID="102150"> <moreinfo> </Menuestruktur> <Menuestruktur webID="102151"> <moreinfo> </Menuestruktur> <Menuestruktur webID="102152"> <moreinfo> </Menuestruktur> . . . etc... . </objects> </root> This is what I want to do: I want to select every Menuestruktur-Element with a webID that is found in the tree-part of the structure as child of a 'node'-Element with a given idUeber-Attribute stored in a variable $wid. With <xsl:apply-templates select="/root/objects/Menuestruktur [@webID=/root/tree/*[@idUeber=$wid]/*/@idUeber]"/> I manage to do that. Now comes the catch: I just want every SECOND Menuestruktur-Element that is a leaf in the tree-part of the XML. That is, the result should be <Menuestruktur webID="102160"/> <Menuestruktur webID="102166"/> <Menuestruktur webID="102174"/> This has something to do with position() mod 2 = 1, but I don't get it right. Can anyone help me? Is there an alternative way? Thanks in advance, Christian XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
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
|