jindw / xmldom

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

Document#lookupNamespaceURI / Document#lookupPrefix are not implemented according to spec #213

Open DrRataplan opened 7 years ago

DrRataplan commented 7 years ago

The specs (https://www.w3.org/TR/DOM-Level-3-Core/namespaces-algorithms.html#lookupNamespaceURIAlgo) defined Document#lookupNamespaceURI to use the documentElement for the actual lookup.

The way this method is implemented in the xmldom implementation uses the _nsMap of a document, which is undefined.

The same with attribute nodes, they should look up using the ownerElement, not ownerDocument.