G
Greg
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>Columbia</company>
<price>10.90</price>
<year>1985</year>
</cd>
[...]
<cd>
<title>Unchain 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:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl
utput method="xml"
doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
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="#9acd32">
<th align="left">Title</th>
<th align="left">Artist</th>
</tr>
<xsl:for-each select="catalog/cd">
<tr>
<td><xsl:value-of select="title"/></td>
<td><xsl:value-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:
http://bimyou.free.fr/xmltest/cdcatalog.xml
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>Columbia</company>
<price>10.90</price>
<year>1985</year>
</cd>
[...]
<cd>
<title>Unchain 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:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl
doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
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="#9acd32">
<th align="left">Title</th>
<th align="left">Artist</th>
</tr>
<xsl:for-each select="catalog/cd">
<tr>
<td><xsl:value-of select="title"/></td>
<td><xsl:value-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:
http://bimyou.free.fr/xmltest/cdcatalog.xml
Thanks
Greg