Summary: | XML parsing errors reported ambiguously by DOMParser.parseFromString | ||
---|---|---|---|
Product: | WebKit | Reporter: | Jesse Costello-Good <jesse> |
Component: | DOM | Assignee: | Nobody <webkit-unassigned> |
Status: | NEW --- | ||
Severity: | Normal | CC: | ahmad.saleem792, annevk, ap, cdumez, mike, rniwa, webkit |
Priority: | P2 | ||
Version: | 523.x (Safari 3) | ||
Hardware: | Mac | ||
OS: | OS X 10.4 | ||
Bug Depends on: | |||
Bug Blocks: | 10489 |
Description
Jesse Costello-Good
2007-03-13 09:15:27 PDT
I can confirm that the DOMParser error document does not match Firefox. I doubt that changing it is appropriate for the stabilization period, though. As for the change in behavior from the previous month - it was actually a bugfix in XPath. Since our error document is an XHTML one (which is apparently different from Firefox), you need to use the XHTML namespaces in the XPath expression: function nsResolver(prefix) { if (prefix == "x") return "http://www.w3.org/1999/xhtml"; return null; } var errorNode = (new XPathEvaluator()).evaluate("//x:parsererror//x:div", doc, nsResolver).iterateNext(); Of course, the code above will cease to work when/if we fix the error document to match Firefox. Thanks for the namespace related fix. That will work for me for now. I still recommend using a namespace owned by webkit to avoid any ambiguities, however unlikely they may be. *** Bug 18210 has been marked as a duplicate of this bug. *** Mass moving XML DOM bugs to the "DOM" Component. I think for this we have WPT: https://wpt.fyi/results/domparsing/DOMParser-parseFromString-xml.html?label=master&label=experimental&aligned=&q=domparsing CCing @Anne % @Ryosuke |