Re: More XPath

Jonas Sicking <[email protected]> Thu, 21 Dec 2006 15:29:52 -0800
Newsgroups gmane.comp.mozilla.devel.xml
Message-ID <[email protected]>
Like Martin pointed out, your problem is most likely not in the XPath, 
but in your handling of markups. Don't put XML inside HTML and expect it 
to work. The HTML parser will apply all 10 years of web compatibility 
quirks handling on the DOM and so lots of things might happen to it that 
you don't expect.

Have you looked at the DOM using the DOM-Inspector? Does it look like 
what you think it does?

If you want to pass XML along with your HTML then put it inside a 
comment or inside a javascript variable and then parse it using 
DOMParser. Don't put it right inside the markup since that's both more 
wasteful processing-wise (first parsed as HTML and then serialized back 
to a string), and exposes it to all the quirks of HTML parsing.

/ Jonas