EVEGames
10-30-2008, 05:44 PM
I know I'm in the minority here, but I'm still opting to manually update MAME.xml each time I download new themes. I have a question related to this. Is there an easy (or even difficult) way to automatically sort MAME.xml by the Description field?
I have no experience with XML whatsoever, but I have begun learning about .XSLT files. The problem is, using an xslt sort seems to result in plain unformatted text. What I want is just to sort MAME.xml by the Description field and have it come out in the same format.
For what it's worth, here's the xslt sort I've been playing with:
<?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="/">
<menu>
<xsl:for-each select="menu/game">
<xsl:sort select="description"/>
<game>
<name><xsl:value-of select="name"/></name>
<description><xsl:value-of select="description"/></description>
<crc><xsl:value-of select="crc"/></crc>
<manufacturer><xsl:value-of select="manufacturer"/></manufacturer>
<year><xsl:value-of select="year"/></year>
<genre><xsl:value-of select="genre"/></genre>
</game>
</xsl:for-each>
</menu>
</xsl:template>
</xsl:stylesheet>
...the sort seems to work perfectly, but the result is an unformatted plain text file with no XML tags around it. Are there any freeware XML sort programs out there that can sort on specific XML fields, and result in a formatted XML file? :questionmark:
Just to be clear, I do know about the themes_only option, I just don't want to use it.
I have no experience with XML whatsoever, but I have begun learning about .XSLT files. The problem is, using an xslt sort seems to result in plain unformatted text. What I want is just to sort MAME.xml by the Description field and have it come out in the same format.
For what it's worth, here's the xslt sort I've been playing with:
<?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="/">
<menu>
<xsl:for-each select="menu/game">
<xsl:sort select="description"/>
<game>
<name><xsl:value-of select="name"/></name>
<description><xsl:value-of select="description"/></description>
<crc><xsl:value-of select="crc"/></crc>
<manufacturer><xsl:value-of select="manufacturer"/></manufacturer>
<year><xsl:value-of select="year"/></year>
<genre><xsl:value-of select="genre"/></genre>
</game>
</xsl:for-each>
</menu>
</xsl:template>
</xsl:stylesheet>
...the sort seems to work perfectly, but the result is an unformatted plain text file with no XML tags around it. Are there any freeware XML sort programs out there that can sort on specific XML fields, and result in a formatted XML file? :questionmark:
Just to be clear, I do know about the themes_only option, I just don't want to use it.