At 4:50 PM +0100 9/24/02, Jeni Tennison wrote:
That's because the name that you specify in a DOCTYPE declaration
must exactly match the (qualified) name that you use for the document
element in the XML document. In your case, you have:
<!DOCTYPE stylesheet ...>
and:
<xsl:stylesheet ...>...</xsl:stylesheet>
"stylesheet" and "xsl:stylesheet" aren't the same, so any XML parser
should object.
No, I don't think so. A *validating* parser should object but a
non-validating parser should be just fine with this. There is no good
reason an XSLT processor should be using a validating parser. There
isn't even a DTD for XSLT, and creating one would be a pointless
exercise since it would depend heavily on the output vocabulary.
That said, I've noticed that a lot of parsers can't distinguish
between validating and merely reading the external DTD subset for
purposes of entity resolution and attribute defaulting. Even more
wrongly, some parsers can't distinguish between validating and merely
reading the internal DTD subset for purposes of entity resolution and
attribute defaulting. So possibly, the parser the XSLT processor is
using is turning on validation as soon as it sees your document type
declaration. On the other hand, I don't see why it would complain
about the root element name mismatch and not complain about the
failure to declare various elements. This just really looks like a
processor bug.
The work around others have suggested (using xsl:stylesheet instead
of stylesheet) should suffice until the vendor can fix the bug.
--
+-----------------------+------------------------+-------------------+
| Elliotte Rusty Harold | elharo(_at_)metalab(_dot_)unc(_dot_)edu |
Writer/Programmer |
+-----------------------+------------------------+-------------------+
| XML in a Nutshell, 2nd Edition (O'Reilly, 2002) |
| http://www.cafeconleche.org/books/xian2/ |
| http://www.amazon.com/exec/obidos/ISBN%3D0596002920/cafeaulaitA/ |
+----------------------------------+---------------------------------+
| Read Cafe au Lait for Java News: http://www.cafeaulait.org/ |
| Read Cafe con Leche for XML News: http://www.cafeconleche.org/ |
+----------------------------------+---------------------------------+
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list