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
Consider the following program
console.log( require("xmlbuilder2").convert( { example: "<p>Hello World</p>" }, { format: "xml", noDoubleEncoding: true, prettyPrint: true, wellFormed: true, } ) );
It produces the following XML:
<?xml version="1.0"?> <example><p>Hello World</p></example>
Despite having used the wellFormed option, the XML is considered invalid by https://www.xmlvalidation.com (and other validators I tried).
wellFormed
The problem is the named entity .
One recommend solution is to convert named entities into their numerical equivalents, for example,   or   instead of . Here’s a list of all named entities and their numeric equivalents, and here’s an npm package that seems to provide that list in a more friendly manner (I haven’t tested it).
 
 
I think that xmlbuilder2 should do this conversion.
Expected behavior
XML produced by xmlbuilder2 should be valid, particularly when using the wellFormed option.
Version:
The text was updated successfully, but these errors were encountered:
I found this other package that seems to be the most used for working with HTML entities: https://github.com/mathiasbynens/he
Sorry, something went wrong.
Backport noDoubleEncoding fix from xmlbuilder2.
b2b8b36
See: oozcitak/xmlbuilder2#16
Update xmlbuilder2 to fix oozcitak/xmlbuilder2#16
d688d0f
oozcitak
Successfully merging a pull request may close this issue.
Describe the bug
Consider the following program
It produces the following XML:
Despite having used the
wellFormed
option, the XML is considered invalid by https://www.xmlvalidation.com (and other validators I tried).The problem is the named entity
.One recommend solution is to convert named entities into their numerical equivalents, for example,
 
or 
instead of
. Here’s a list of all named entities and their numeric equivalents, and here’s an npm package that seems to provide that list in a more friendly manner (I haven’t tested it).I think that xmlbuilder2 should do this conversion.
Expected behavior
XML produced by xmlbuilder2 should be valid, particularly when using the
wellFormed
option.Version:
The text was updated successfully, but these errors were encountered: