-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
Description
Basic info:
- Node.js version: n/a (current Chrome w/browserify)
- jsdom version: 11.6.2
Minimal reproduction case
import {JSDOM} from "jsdom"
let jsdom = new JSDOM()
let parser = new jsdom.jsdom.window.DOMParser()
let string = `<?xml version="1.0"?><cp:coreProperties xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties" xmlns:dc="http://purl.org/dc/elements/1.1/"><dc:title></dc:title></cp:coreProperties>`
let dom = parser.parseFromString(string, 'text/xml')
let el = dom.querySelector('coreProperties')
console.log(el)
The console gives an output of null
, meaning it cannot find the cp:coreProperties
element
How does similar code behave in browsers?
This works fine in Chrome/Firefox:
let parser = new window.DOMParser()
let string = `<?xml version="1.0"?><cp:coreProperties xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties" xmlns:dc="http://purl.org/dc/elements/1.1/"><dc:title></dc:title></cp:coreProperties>`
let dom = parser.parseFromString(string, 'text/xml')
let el = dom.querySelector('coreProperties')
console.log(el)
The console gives an output of the cp:coreProperties
element.
xmedeko, klesun, cimak, valeriangalliat, theredpea and 2 moreMirum-7