I'm attempting to use XML/XSLT to do some work, and as a precursor to do that I'm trying to take fairly simple XML which is more or less identical to HTML, and get the right results. Here's my XML doc:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<?xml-stylesheet type="text/xsl" href="default.xsl" ?>
<doc>
<i><b>Test</b></i>
<b><i>Test</i></b>
</doc>
The idea is that I should get correctly formatted HTML output from the XSL transform that I do. However, I can't get it to work. I'm trying something like this:
<xsl:template match="/">
<html>
<body>
<xsl:apply-templates select="*" />
</body>
</html>
</xsl:template>
<xsl:template match="b">
<b><xsl:value-of select="." /></b>
</xsl:template>
<xsl:template match="i">
<i><xsl:value-of select="." /></i>
</xsl:template>
But I just get an italic Test followed by a bold Test, not two bold-italic Tests. I can't get the inner tag to ever match properly. I think this is mainly a question of getting my apply-templates line right, but I'm not quite sure. I'd really appreciate some help.