The problem is to merge and sort multiple XML files with XSL and output valid HTML, viewable with Firefox >=3.5 and if possible IE >=7. The answer should be as simple as possible (performance is not important).
File a.xml
<?xml version="1.0"?>
<root>
<tag>cc</tag>
<tag>aa</tag>
</root>
File b.xml
<?xml version="1.0"?>
<root>
<tag>xx</tag>
<tag>bb</tag>
</root>
File index.xml
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="merge.xslt"?>
<list>
<entry>a.xml</entry>
<entry>b.xml</entry>
</list>
File merge.xslt
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:ph="http://ananas.org/2003/tips/photo">
<xsl:output method="html"/>
<xsl:template match="list">
<html>
<body>
<xsl:apply-templates/>
</body>
</html>
</xsl:template>
<xsl:template match="entry">
<xsl:for-each select="document(.)/root/tag">
<!-- This will only sort the values of a single file -->
<xsl:sort select="." data-type="text" order="ascending" />
- <xsl:value-of select="."/> <br/>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
Current output:
aa
cc
bb
xx
Expected output:
aa
bb
cc
xx