[thelist] Xsl for each problems

Howard Cheng howcheng at ix.netcom.com
Wed Nov 20 14:34:01 CST 2002


First of all, your <story> template starts and ends with <html>, which
means that when you do your <xsl:apply-templates/> if you have multiple
<story> elements (as you do), you repeat the entire template, which means
you repeat your HTML document. This might be the root of your problem.

You'll probably want something more like:

<xsl:template match="/CSID">
<html>
<head></head>
<body>
<h1>CSID page</h1>

<ul>
<xsl:for-each select="story">
     <li><xsl:value-of select="title"/></li>
</xsl:for-each>
</ul>

</body>
</html>
</xsl:template>

At 07:58 PM 11/20/2002 +0000, fstorr wrote:
>I'm struggling somewhat with some XSL.  This is the first time I've
>really looked at this area and I can't seem to work out exatly what I'm
>doing wrong.  I'm trying to use an XSL for each command to create an
>unordered list from a <title> element in my XML file.  All I get is one
>lonely bullet point and nothing else!  I've used the working draft
>doctype as I need this to work in IE5.

::::::::::::::::::::::::::::::::::
Howard Cheng
http://www.howcheng.com/ <-- NEW!
howcheng at ix dot netcom dot com
AIM: bennyphoebe
ICQ: 47319315




More information about the thelist mailing list