[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Sorting XML data by <entry ID="">
My dictionary data has the below basic format (simplified here):
<entry ID="c8fc4"> <pron> <sense> <refs> </entry> <entry ID="c8f00"> <pron> <sense> <refs> </entry> <entry ID="c8f25"> <pron> <sense> <refs> </entry> ...which I want to sort by @ID. The below XSLT seems to work, but despite the xsl:output method="xml" declaration, the files come out as .html (even though the contents are fine). What am I missing? <?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" omit-xml-declaration="yes" indent="no"/> <xsl:template match="dealt"> <xsl:copy> <xsl:apply-templates select="@*"/> <xsl:apply-templates select="entry"> <xsl:sort select="@ID" order="ascending"/> </xsl:apply-templates> </xsl:copy> </xsl:template> <xsl:template match="@* | node()"> <xsl:copy> <xsl:apply-templates select="@* | node()"/> </xsl:copy> </xsl:template> Regards, Chuck --------------------------- A. Charles Muller, Professor Buddhist Culture Research Center Musashino University 1-1-20 Shinmachi, Nishitokyo-shi Tokyo 202-8585, Japan Office Phone: 042-468-3145 (University of Tokyo, Professor Emeritus) Web Site: Resources for East Asian Language and Thought http://www.acmuller.net Twitter: @ACharlesMuller
|
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
|