-
-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
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
Fix decoding of entities on conversion from XML to object #15
Comments
Sorry for that. const xmlbuilder2 = require("xmlbuilder2");
const assert = require("assert");
const originalXML = `<?xml version="1.0"?><example><p>Hello</p></example>`;
const objectXML = xmlbuilder2.convert(originalXML, { format: "object", noDoubleEncoding: true });
const recreatedXML = xmlbuilder2.convert(objectXML, { format: "xml", noDoubleEncoding: true });
assert.strictEqual(recreatedXML, originalXML); |
Awesome! Thank you very much. Can we please have a release with this feature? |
Thank you one more time. I was finally able to move from xml2js to xmlbuilder2. |
This defect does not seem to be fixed. I added the To Reproduce defect 1:
Result:
The decoded XML which contains valid < and > escapes does not result in the expected output as reported by @leafac. To reproduce defect 2:
Result:
|
Describe the bug
When converting from XML to object, an entity such as
<
is decoded as&lt;
. This breaks the roundtrip XML → object → XML.To Reproduce
Expected behavior
The
objectXML
should be:Instead of:
Version:
Additional context
The text was updated successfully, but these errors were encountered: