OZONE Asylum
Forums
CSS - DOM - XHTML - XML - XSL - XSLT
Bug of ignoring of repeating nodes using xslt
This page's ID:
30456
Search
QuickChanges
Forums
FAQ
Archives
Register
Edit Post
Who can edit a post?
The poster and administrators may edit a post. The poster can only edit it for a short while after the initial post.
Your User Name:
Your Password:
Login Options:
Remember Me On This Computer
Your Text:
Insert Slimies »
Insert UBB Code »
Close
Last Tag
|
All Tags
UBB Help
I?ve got the problem. I have xml: [code]<root> <Info Currency="USD" Denomination="20" amount="21" /> <Info Currency="RUB" Denomination="10" amount="12" /> <Info Currency="RUB" Denomination="10" amount="22" /> <Info Currency="RUB" Denomination="100" amount="12" /> <Info Currency="RUB" Denomination="500" amount="91" /> <Info Currency="RUB" Denomination="10" amount="521" /> <Info Currency="USD" Denomination="100" amount="21" /> </root>[/code] I want to get sorted ascending list of denominations where Currency="RUB" (I mean 10 100 500). I can do it using xslt: [code]<xsl:for-each select="root/Info[(not(@Denomination=preceding-sibling::Info/@Denomination)) and @Currency='RUB']"> <xsl:sort select="@Denomination" data-type="number" order="ascending" /> <xsl:value-of select="@Denomination"/> руб.<br/> </xsl:for-each>[/code] BUT if Denomination in the first line of xml replace by 10 <Info Currency="USD" Denomination="10" amount="21" /> the condition [(not(@Denomination=preceding-sibling::Info/@Denomination)) and @Currency='RUB'] will see this line and as result the list of denominations wil be 100 500 (instead of 10 100 500). 10 is absent. Why does not it work. Where is the mistake?
Loading...
Options:
Enable Slimies
Enable Linkwords
« Backwards
—
Onwards »