jindw / xmldom

A PURE JS W3C Standard based(XML DOM Level2 CORE) DOMParser and XMLSerializer.
Other
819 stars 265 forks source link

XML Declaration is not a Processing Instruction #174

Open davemevans opened 8 years ago

davemevans commented 8 years ago

xmldom appears to interpret the XML Declaration (<?xml ?>) as a Processing Instruction and inserts a Node into the DOM with nodeType 7.

This is incorrect and there should be no reference to the XML declaration in the DOM - the XML Declaration is not a Processing Instruction.

Chrome and Firefox, for example, correctly returns the DOM without any reference to the XML Declaration.

Holzhaus commented 7 years ago

I can reproduce this. I'll see if I can come up with a patch.