-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
getAttributeNS(xml, 'lang') returns null #1276
Comments
Can you provide a full example of jsdom code I could run by itself? |
Sure, var jsdom = require('jsdom').jsdom;
var doc = jsdom('<element xml:lang="uk"></element>', {
parsingMode: 'xml'
});
var xmlns = 'http://www.w3.org/XML/1998/namespace';
var lang = doc.documentElement.getAttributeNS(xmlns, 'lang');
console.log(lang); // null, while 'uk' for XMLDocument in a browser |
Thanks! There's a hope that this will get fixed in #1247, but I will definitely work on it afterward, in any case. It might be a while though; I am on vacation + at conferences and meetings until November 23. |
This was not fixed by #1247. Unfortunately this is an issue with our XML parser, htmlparser2 :(. It only gives its That is, it gives So to really fix this, we either need to get htmlparser2 to give more information, or we need to replace our XML parser. Hmm. /cc @fb55 @inikulin. |
This is out of scope for htmlparser2. https://github.com/isaacs/sax-js handles namespaces, perhaps that's a better alternative for XML parsing. |
This will be fixed by #1303. |
The text was updated successfully, but these errors were encountered: