1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-30 10:36:35 +02:00
joplin/packages/fork-sax/test/xmlns-xml-default-ns.js
2020-11-05 16:58:23 +00:00

72 lines
1.0 KiB
JavaScript

var xmlnsAttr = {
name: 'xmlns',
value: 'http://foo',
prefix: 'xmlns',
local: '',
uri: 'http://www.w3.org/2000/xmlns/'
}
var attrAttr = {
name: 'attr',
value: 'bar',
prefix: '',
local: 'attr',
uri: ''
}
require(__dirname).test({
xml: "<elm xmlns='http://foo' attr='bar'/>",
expect: [
[
'opentagstart',
{
name: 'elm',
attributes: {},
ns: {}
}
],
[
'opennamespace',
{ prefix: '', uri: 'http://foo' }
],
[
'attribute',
xmlnsAttr
],
[
'attribute',
attrAttr
],
[
'opentag',
{
name: 'elm',
prefix: '',
local: 'elm',
uri: 'http://foo',
ns: { '': 'http://foo' },
attributes: {
xmlns: xmlnsAttr,
attr: attrAttr
},
isSelfClosing: true
}
],
[
'closetag',
'elm'
],
[
'closenamespace',
{
prefix: '',
uri: 'http://foo'
}
]
],
strict: true,
opt: {
xmlns: true
}
})