Re: XML Declaration

Jonas Sicking <[email protected]>
Newsgroups gmane.comp.mozilla.devel.xml
Organization Another Netscape Collabra Server User
Message-ID <[email protected]>
>>> Dirty hack :
>>>     var piElem = doc.createProcessingInstruction("xml", "version='1.0'
>>> encoding='UTF8'");
>>>  - a XML Declaration is not a Processing Instruction
>>> Real dirty ...
>>
>> Yeah, it is in fact so dirty that it should not work. Could you file a 
>> bug in bugzilla about that and post the bug number here.
> 
> Where is the bug in your view, should the DOM not allow creating such a 
> processing instruction or should the serializer bark at that processing 
> instruction when serializing the document?

IMHO the bug is in that we allow such a PI to be created.


> Only <http://www.w3.org/TR/REC-xml/#sec-pi> clearly excludes e.g. "xml" 
> or "XML" as target names for processing instructions but there is 
> nothing in the DOM spec saying that createProcessingInstruction should 
> implement that rule.

I believe the intention of the DOM WG was to disallow illegal PI-names, 
both in DOM L2 and DOM L3. Even though I agree they are very unclear on 
that.

/ Sicking
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.