in reply to use XML::Twig to insert data in the correct order

its possible, but isnt that a job for stylesheets XSL
  • Comment on Re: use XML::Twig to insert data in the correct order

Replies are listed 'Best First'.
Re^2: use XML::Twig to insert data in the correct order
by sureerat (Acolyte) on Nov 08, 2008 at 16:13 UTC
    So it means I can add data without ordering but order the data when query, right? It's also in my plan. This is my trial to display data in order.
    <?xml version='1.0'?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl"> <xsl:template match="/"> <html> <body> <table border="2" bgcolor="white"> <tr> <th>Name</th> <th>URL</th> </tr> <xsl:for-each select="data/record" order-by="+ name"> <tr> <td><xsl:value-of select="name"/></td> <td><xsl:value-of select="url"/></td> </tr> </xsl:for-each> </table> </body> </html> </xsl:template> </xsl:stylesheet>
    But I would like to display data in "select" menu in my web form. I have no idea how to order the data with XML before create the "select" field. Please give me the clue. Thank you.