← Prev in month ← Prev in thread

Which XML Processor is behaving correctly.

From
Doug Ransom <>
To
"Xml-Dev@Lists. Xml. Org (E-mail)" <>
Date
2003-01-20T22:42:36Z
ID
<>
Thread
Which XML Processor is behaving correctly.
I have one parser ("A") that loads the document inline below, and one that does not (B);

B  returns an error message "Reference to undeclared namespace prefix: 'xsl'. Error processing resource 'file:///D:/junk/foo.xml'. Line 1, Position 43 " due to the use of a namespace within an entity definition. 

<?xml version="1.0" encoding="iso-8859-1" ?>
<!DOCTYPE xsl:stylesheet
[
	<!-- Namespaces -->
	<!ENTITY  xsl "http://www.w3.org/1999/XSL/Transform">
	<!-- Match strings -->
	<!ENTITY CopyAttsAndNodes 
	"<xsl:apply-templates select='node()|@*' />">
]>
<xsl:stylesheet xmlns:xsl="&xsl;">
&CopyAttsAndNodes; 
</xsl:stylesheet>

Note the above sample is intended to be good xml, not necessarily good xslt.  I ripped it out of a working XSLT.  Note both parsers are capable of expanding internal entity references -- only when the prefix is included above does B run into problems.

I am leaning towards believing parser A behaving correctly, because the infoset is the tree created after the entity references have been expanded;  the entities in the DOCTYPE section should be namespace unaware (i.e. just text).



Doug Ransom
Interoperability Architect
Power Measurement
2195 Keating X Road
Saanichton, BC, Canada  V8M 2A5
Tel: 1-(250) 652-7100  
E-Mail: <mailto:>
Website: <http://www.pwrm.com/>

ION(r)  smart energy everywhere(tm)
← Prev in month ← Prev in thread