[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

Subject: RE: xsl:for-each--stuck on very basic issue
From: "Chris Bayes" <Chris@xxxxxxxxxxx>
Date: Thu, 14 Sep 2000 17:01:33 +0100
for each in xsl index
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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.