XSL parse failure for cd.xsl from http://www.developerfusion.co.uk/show/3802/
Mumia Wotse <[email protected]> Thu, 11 Oct 2007 22:51:38 -0500
| Newsgroups | gmane.comp.mozilla.devel.layout.xslt |
|---|---|
| Organization | none |
| Message-ID | <[email protected]> |
Hello everyone.
I'm learning XML from the tutorial at this page:
http://www.developerfusion.co.uk/show/3802/
When I create cd.xsl, I get an error message from Firefox 2.0.0.6:
> Error: mismatched tag. Expected: </xsl:for-each>.
> Line: 23, Column: 3
> Source Code:
> </ul> <!-- <========== error here -->--^
Here is cd.xsl:
1 <?xml version="1.0" ?>
2 <xsl:stylesheet
3 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
4 version='1.0'
5 >
6 <xsl:template match="/" >
7 <html>
8 <head>
9 <title>CD Collection</title>
10 </head>
11 <body>
12 <xsl:for-each select="/collection/cd">
13 <p>
14 <b>Band:</b> <xsl:value-of select="band" />
15 <b>Title:</b> <xsl:value-of select="title" />
16 </p>
17 <ul>
18 <xsl:for-each select="tracks/track">
19 <li>
20 <xsl:value-of select="." />
21 </li>
22 <xsl:for-each>
23 </ul> <!-- <========== error here -->
24 <xsl:for-each>
25 </body>
26 </html>
27 </xsl:template>
28 </xsl:stylesheet>
Removing the comment on 23 doesn't change anything.
Can someone advise me on how to get this XSL file working?
After looking at a boring parse tree, it would be nice to get formatted
output.
Here is cd.xml:
<?xml version="1.0" ?>
<?xml-stylesheet type="text/xsl" href="cd.xsl" ?>
<!DOCTYPE collection SYSTEM "cd.dtd">
<collection>
<cd>
<title>The Hour of Bewilderbeast</title>
<band>Badly Drawn Boy</band>
<tracks>
<track>The Shining</track>
<track>Everybody's Talking</track>
<track>Bewilder</track>
<track>Fall in the River</track>
<track>Camping next to Water</track>
<track>Stone on the Water</track>
<track>Another Pearl</track>
<track>Once Around the Block</track>
<track>This Song</track>
<track>Bewilderbeast</track>
<track>Magic in the Air</track>
<track>Cause a Rockslide</track>
<track>Pissing in the Wind</track>
<track>Blistered Heart</track>
<track>Dissillusion</track>
<track>Say it</track>
<track>Epitapth</track>
</tracks>
</cd>
<cd>
<title>Gorillaz</title>
<band>Gorillaz</band>
<tracks>
<track>Re-Hash</track>
<track>Five Four</track>
<track>Tomorrow Comes Today</track>
<track>New Genious</track>
<track>Clint Eastwood</track>
<track>Man Research</track>
<track>Punk</track>
<track>Sound Check</track>
<track>Double Bass</track>
<track>Rock the House</track>
<track>19-2000</track>
<track>Latin Simone</track>
<track>Starshine</track>
<track>Slow Country</track>
<track>M1 A1</track>
</tracks>
</cd>
</collection>