Sort xml

Can anyone provide any insight into this.?. > I realise that combining two external xml files and sorting them probably isn’t a simple task but our sum knowledge is greater than any challenge<

_with thanks

thanks… so how would I get the feed in with the XSL?.. based on that example I so far have:

<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="/">
  <html>
  <body>
    <h2>Event</h2>
    <table border="1">
      <tr bgcolor="#9acd32">
        <th>Month</th>
        <th>Back</th>
      </tr>
      <xsl:for-each select="temperature/event/subevent/selection">
      <xsl:sort select="@backp1" data-type="number"/>
      <tr>
        <td><xsl:value-of select="@month"/></td>
        <td><xsl:value-of select="@backp1"/></td>
      </tr>
      </xsl:for-each>
    </table>
  </body>
  </html>
</xsl:template>

…this works when I type the XML out into the left column of http://www.w3schools.com/xsl/tryxslt.asp?xmlfile=cdcatalog&xsltfile=tryxsl_sort

… > so how can I get it to pull in the feed rather than me type out the xml?

_thanks all

This being done here to show someone how to sort XML for pagination. Its the same concept. You apply the XSL transformation using a XSL transformation coupled with Dom Document. You still pull the feed the way your doing it but apply the transform on your own.

I have a custom example that might help.

Here is the information on sorting in XML:
http://www.w3schools.com/xsl/xsl_sort.asp

You can use XSLT to format your XML. On the page I referenced, there is an example. Click Try it yourself and then copy an paste everything starting with <?xml version=“1.0” through the last tag of </xsl:stylesheet>

This will sort the cd list by year and title. That should give you the syntax your looking for sorting and a working example of XSL applied.

<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<body>
<h2>My CD Collection</h2>
<table border="1">
<tr bgcolor="#9acd32">
<th>Year</th>
<th>Title</th>
</tr>
<xsl:for-each select="catalog/cd">
<xsl:sort select="year"/>
<xsl:sort select="title"/>
<tr>
<td><xsl:value-of select="year"/></td>
<td><xsl:value-of select="title"/></td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>

Copying and pasting the code I may have got something wrong but nothing that immediately sticks out.

I attached a zip of everything below. Just tested it out and seems to be working.