This was originally reported as part of the jsdom repo here.
I decided to try to fix it (because I had the exact same issue) and was able to track down the issue until here.
So here's the case: given the following XML DOM tree:
I don't know this library codebase well, but I investigated a bit and I have the feeling that this is caused by the fact that the selector is converted to lower case while the element localName is not.
Hence the missing match in the compiled resolver code.
What I also noticed is that if you parse the same code as HTML, with:
const dom = new window.DOMParser().parseFromString(xml, 'text/xml');
It works as expected, I guess because all the tags are automatically converted to lower case.
This was originally reported as part of the
jsdom
repo here. I decided to try to fix it (because I had the exact same issue) and was able to track down the issue until here.So here's the case: given the following XML DOM tree:
This query:
aB *
doesn't return anything while it should match the<c>
element.Here's the full reproduction code:
And here's a fiddle hosting it.
I don't know this library codebase well, but I investigated a bit and I have the feeling that this is caused by the fact that the selector is converted to lower case while the element
localName
is not.Hence the missing match in the compiled resolver code.
What I also noticed is that if you parse the same code as HTML, with:
It works as expected, I guess because all the tags are automatically converted to lower case.