Namespaces not working in a browser
See original GitHub issueIt throws on the second select()
in a browser.
On Node.js it works.
If a:
prefixes are removed it also works in the browser.
const select = xpath.useNamespaces({
a: 'http://schemas.openxmlformats.org/spreadsheetml/2006/main'
})
const doc = new XMLDOM.DOMParser().parseFromString(xml)
values = select('//a:si', doc)
// `Error: XPath parse error`
.map(string => select('.//a:t[not(ancestor::a:rPh)]', string).map(_ => _.textContent).join(''))
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r\n<sst xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" count="4" uniqueCount="4"><si><t>One</t></si><si><t>Two</t></si><si><t>Three</t></si><si><t>Four</t></si></sst>
Issue Analytics
- State:
- Created 6 years ago
- Comments:9
Top Results From Across the Web
TS Namespaces - 'is not a function' in browser - Stack Overflow
I am learning typescript, and have tried separating my code into different files. I have a main file structured like this: // calculator.ts ......
Read more >"Could not fetch Namespaces list." error in browser back. #1863
Go to Traffic tab of some Workload. Click on any of outbound or inbound trace links. In the opened object's page go to...
Read more >Type or namespace could not be found
I have a solution containg two Visual C# Class Library (.NET Framework) projects using Visual Studio Professional 15.8.9. Project A references project B...
Read more >XML Namespaces - W3Schools
XML Namespaces provide a method to avoid element name conflicts. Name Conflicts. In XML, element names are defined by the developer. This often...
Read more >Compiler Error CS0246 | Microsoft Learn
A type or namespace that is used in the program was not found. You might have forgotten to reference (References) the assembly that...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@catamphetamine Thanks for the update. After re-reading your initial post, I realize that my guess about node name casing was almost definitely wrong because I now noticed that the error you were getting was an XPath parse error, and nothing in the DOM would have caused that kind of error. I guess this will just have to remain a mystery.
Agreed )