|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: xsl:for-each--stuck on very basic issue
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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








