[
Lists Home |
Date Index |
Thread Index
]
Hi,
I am trying to transform an XML document with an XSLT, but all that shows up
are the HTML elements, and the for-each loops don't function correctly. When
I try to open the document in Internet Explorer, all I get are a submit
button and a single checkbox. The XML document without the XSLT shows up
fine and is valid to the best of my knowledge. I've tried everything and
searched everywhere I can think of, but can't see what I'm doing wrong.
Here is the XSLT:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<xsl:apply-templates />
</xsl:template>
<xsl:template match="/main-menu">
<html>
<body>
<form name="frmMenuItm" method="POST">
<ul>
<xsl:apply-templates />
</ul>
<input type="button" value="Edit" />
</form>
</body>
</html>
</xsl:template>
<xsl:template match="main-menu/top-level">
<xsl:for-each select=".">
<li>
<input type="checkbox" value="1"><xsl:attribute
name="name"><xsl:value-of select="title" /></xsl:attribute></input>
<a href="#"><xsl:value-of select="title" /></a>
</li>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
And the XML looks something like this:
<main-menu>
<top-level>
<title>Here is a title.</title>
<other-tag>Something else.</other-tag>
</top-level>
<top-level>
<title>Another title.</title>
<other-tag>More nonsense.</other-tag>
</top-level>
</main-menu>
Can anyone help?
Thanks,
Garann Rose Means
|