[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Problem with index-position in for-each
Hi all,
i've a strange problem. I want to select some elements by their index via predicate expression. The source looks like: <root> <tree> <statics mapTo="xyz">...</statics> <statics mapTo="xyz">...</statics> <dynamics mapTo="xyz">...</dynamics> <statics mapTo="xyz">...</statics> ... </tree> ... </root> Now, i want to iterate over all statics-child elements, depending on their position. Therefore, i have created an for-each-loop like this: <xsl:for-each select="1 to count($staticParts/tree/statics)"> and inside the loop, i want to get the value of @mapTo with <xsl:value-of select="$staticParts/tree/statics[position()]/@mapTo"/> I want to do this with the explicit position, because i generate some sql insert statements, where @mapTo defines the sql rowname and the value of the element defines the column data. But the result is really unexpected. I allways get the values of all @mapTo in this tree-element, like this: page tree location locationdescription ... I 'm wondering because when i replace the position() function with an static integer like [1] i only get the @mapTo value i want. Hope, that somebody could help me. thx mfw
|
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
|