Hi Marcel,
Below is the complete XSL --
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" version="1.0"
encoding="UTF-8" indent="yes"/>
<xsl:template match="/foo">
<foo>
<xsl:for-each select="bar">
<xsl:sort select="@id" data-type="number"/>
<bar id="{(_at_)id}">
<xsl:for-each select="item">
<xsl:sort select="@id" data-type="number"/>
<item id="{(_at_)id}">
<xsl:value-of select="."/>
</item>
</xsl:for-each>
</bar>
</xsl:for-each>
</foo>
</xsl:template>
</xsl:stylesheet>
Regards,
Mukul
--- marcel salathe <ms7141(_at_)gmx(_dot_)de> wrote:
Hi
I have a XSL question which might be easy to answer,
but I couldnt.
Suppose I have an XML document like this:
<foo>
<bar id="2">
<item id="6">hello</item>
<item id="4">world</item>
</bar>
<bar id="1">
<item id="7">how's</item>
<item id="3">life</item>
</bar>
</foo>
Now I want to sort the bar elements and then the
item elements according to
their Id's, and finally output
the entire document sorted, e.g.
<foo>
<bar id="1">
<item id="3">life</item>
<item id="7">how's</item>
</bar>
<bar id="2">
<item id="4">world</item>
<item id="6">hello</item>
</bar>
</foo>
I could achieve sorting or copying, but I couldnt do
both together. I guess
it must be quite a simple
XSLT.
Any help very much appreciated.
Best regards,
marcel
--
COMPUTERBILD 15/03: Premium-e-mail-Dienste im Test
--------------------------------------------------
1. GMX TopMail - Platz 1 und Testsieger!
2. GMX ProMail - Platz 2 und Preis-Qualitätssieger!
3. Arcor - 4. web.de - 5. T-Online - 6. freenet.de -
7. daybyday - 8. e-Post
XSL-List info and archive:
http://www.mulberrytech.com/xsl/xsl-list
__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list