We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Describe the bug xmlns attribute added to the root element is shown on its child elements. Attributes with other names are shown correctly.
xmlns
NOTE: Problem appears when attributes are added via att method: .att({ xmlns: 'http://example.com', x: 0 })
att
.att({ xmlns: 'http://example.com', x: 0 })
There is no problem when attributes are added via ele method: .ele('SomeRootTag', { xmlns: 'http://example.com', x: 0 })
ele
.ele('SomeRootTag', { xmlns: 'http://example.com', x: 0 })
To Reproduce
const builder = require('xmlbuilder2'); const xml = builder.create() .dec({ version: '1.0', encoding: 'UTF-8', }) .ele('SomeRootTag') .att({ xmlns: 'http://example.com', x: 0 }) .ele('foo') .att({ a: 'A1', x: 1 }) .ele('subFoo') .att({ a: 'A2', x: 1.1 }) .up() .up() .ele('bar') .att({ b: 'B', x: 2 }) console.log(xml.end({ prettyPrint: true }));
Actual output - xmlns attribute on second elements
<?xml version="1.0" encoding="UTF-8"?> <SomeRootTag x="0"> <foo xmlns="http://example.com" a="A1" x="1"> <subFoo a="A2" x="1.1"/> </foo> <bar xmlns="http://example.com" b="B" x="2"/> </SomeRootTag>
Expected behavior Expected output - xmlns attribute on root element
<?xml version="1.0" encoding="UTF-8"?> <SomeRootTag xmlns="http://example.com" x="0"> <foo a="A1" x="1"> <subFoo a="A2" x="1.1"/> </foo> <bar b="B" x="2"/> </SomeRootTag>
Version:
Additional context Previous version of xmlbuilder 13.0.2 works correctly - (xmlns attribute on root element)
xmlbuilder
13.0.2
The text was updated successfully, but these errors were encountered:
Thank you, I'm looking into it.
Sorry, something went wrong.
85fa3a4
oozcitak
No branches or pull requests
Describe the bug
xmlns
attribute added to the root element is shown on its child elements.Attributes with other names are shown correctly.
NOTE: Problem appears when attributes are added via
att
method:.att({ xmlns: 'http://example.com', x: 0 })
There is no problem when attributes are added via
ele
method:.ele('SomeRootTag', { xmlns: 'http://example.com', x: 0 })
To Reproduce
Actual output -
xmlns
attribute on second elementsExpected behavior
Expected output -
xmlns
attribute on root elementVersion:
Additional context
Previous version of
xmlbuilder
13.0.2
works correctly - (xmlns
attribute on root element)The text was updated successfully, but these errors were encountered: