This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: xsl:for-each--stuck on very basic issue
- To: <xsl-list at mulberrytech dot com>
- Subject: RE: xsl:for-each--stuck on very basic issue
- From: "Chris Bayes" <Chris at Bayes dot co dot uk>
- Date: Thu, 14 Sep 2000 17:01:33 +0100
- Reply-To: xsl-list at mulberrytech dot com
I've never seen so many suggestions for such a simple subject. So I decided
it was time to try it out with MSXML2.
eric.xml------------------------
<?xml version="1.0"?>
<pages>
<page name="aaa" location="bbb">
<index entry="ccc"/>
<index entry="ddd"/>
</page>
<page name="aaa" location="bbb">
<index entry="ccc"/>
<index entry="ddd"/>
</page>
</pages>
eric.xsl------------------------
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:template match="/">
<html>
<head></head>
<body>
<xsl:apply-templates/>
</body>
</html>
</xsl:template>
<xsl:template match="page">
<p><xsl:value-of select="@name"/></p>
<xsl:for-each select="index">
<p>THIS IS NOT SHOWING UP</p> <!--*** problem here -->
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
produces
eric.html------------------------
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-16">
</head>
<body>
<p>aaa</p>
<p>THIS IS NOT SHOWING UP</p>
<p>THIS IS NOT SHOWING UP</p>
<p>aaa</p>
<p>THIS IS NOT SHOWING UP</p>
<p>THIS IS NOT SHOWING UP</p>
</body>
</html>
Maybe that is why. It works!
Ciao Chris
p.s. Beginners rule #1 don't use xsl:for-each
XML/XSL Portal
http://www.bayes.co.uk/xml
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list