Hi everybody,
so, I would like to use XML files for some parts of my website. I would like
to respect W3C XHTML 1.1 recommendation.
Then, I have these two docs :
o My XML file:
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type="text/xsl" href="cdcatalog .xsl"?>
<catalog>
<cd>
<title>Empire Burlesque</title>
<artist>Bob Dylan</artist>
<country>USA</country>
<company>Columb ia</company>
<price>10.90</price>
<year>1985</year>
</cd>
[...]
<cd>
<title>Unchai n my heart</title>
<artist>Joe Cocker</artist>
<country>USA</country>
<company>EMI</company>
<price>8.20</price>
<year>1987</year>
</cd>
</catalog>
o My XSL stylesheet:
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:styleshe et version="1.0"
xmlns:xsl="http ://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml"
doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dt d"
doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" indent="yes"/>
<xsl:template match="/">
<html>
<body>
<h2>My CD Collection</h2>
<table border="1">
<tr bgcolor="#9acd3 2">
<th align="left">Ti tle</th>
<th align="left">Ar tist</th>
</tr>
<xsl:for-each select="catalog/cd">
<tr>
<td><xsl:valu e-of select="title"/></td>
<td><xsl:valu e-of select="artist"/></td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
As it's writen in W3C website
(http://www.w3.org/TR/xslt#section-XML-Output-Method):
"If the doctype-system attribute is specified, the xml output method should
output a document type declaration immediately before the first element."
But W3C validator (http://validator.w3.org/) tells me that my XML file is
not valid:
Fatal Error: No DOCTYPE specified!
My question is: What did I do or what I did not do ?
You can find those two exemple at that address:
Thanks
Greg
so, I would like to use XML files for some parts of my website. I would like
to respect W3C XHTML 1.1 recommendation.
Then, I have these two docs :
o My XML file:
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type="text/xsl" href="cdcatalog .xsl"?>
<catalog>
<cd>
<title>Empire Burlesque</title>
<artist>Bob Dylan</artist>
<country>USA</country>
<company>Columb ia</company>
<price>10.90</price>
<year>1985</year>
</cd>
[...]
<cd>
<title>Unchai n my heart</title>
<artist>Joe Cocker</artist>
<country>USA</country>
<company>EMI</company>
<price>8.20</price>
<year>1987</year>
</cd>
</catalog>
o My XSL stylesheet:
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:styleshe et version="1.0"
xmlns:xsl="http ://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml"
doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dt d"
doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" indent="yes"/>
<xsl:template match="/">
<html>
<body>
<h2>My CD Collection</h2>
<table border="1">
<tr bgcolor="#9acd3 2">
<th align="left">Ti tle</th>
<th align="left">Ar tist</th>
</tr>
<xsl:for-each select="catalog/cd">
<tr>
<td><xsl:valu e-of select="title"/></td>
<td><xsl:valu e-of select="artist"/></td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
As it's writen in W3C website
(http://www.w3.org/TR/xslt#section-XML-Output-Method):
"If the doctype-system attribute is specified, the xml output method should
output a document type declaration immediately before the first element."
But W3C validator (http://validator.w3.org/) tells me that my XML file is
not valid:
Fatal Error: No DOCTYPE specified!
My question is: What did I do or what I did not do ?
You can find those two exemple at that address:
Thanks
Greg
Comment