You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Have you checked the docs for helpful APIs and examples?
Description
When parsing an XML node with an attribute that contains HTML-escaped symbols, the ampersand & symbol is parsed, but others aren't.
Input
<?xml version="1.0"?>
<node attr="some value with ampersand & and other HTML symbols like @ and =">
</node>
Code
import{XMLParser}from'fast-xml-parser';constparser=newXMLParser({ignoreAttributes: false});constraw=`<?xml version="1.0"?><node attr="some value with ampersand & and other HTML symbols like @ and ="></node>`;console.log(parser.parse(raw));
Output
The ampersand HTML entity is replaced with the actual Ampersand symbol, but other symbols such as @ and = aren't.
{
'?xml': { '@_version': '1.0' },
node: {
'@_attr': 'some value with ampersand & and other HTML symbols like @ and ='
}
}
expected data
No HTML entity should be parsed at all, and the attribute value should contain & instead of &.
{
'?xml': { '@_version': '1.0' },
node: {
'@_attr': 'some value with ampersand & and other HTML symbols like @ and ='
}
}
Would you like to work on this issue?
Yes
No
Bookmark this repository for further updates. Visit SoloThought to know about recent features.
The text was updated successfully, but these errors were encountered:
We're glad you find this project helpful. We'll try to address this issue ASAP. You can vist https://solothought.com to know recent features. Don't forget to star this repo.
Oh my bad, it seems the XML spec also specifies an & entity and this behavior would therefore be correct. Please confirm and if so, feel free to close.
4.5.1
Description
When parsing an XML node with an attribute that contains HTML-escaped symbols, the ampersand
&
symbol is parsed, but others aren't.Input
Code
Output
The ampersand HTML entity is replaced with the actual Ampersand symbol, but other symbols such as
@
and=
aren't.expected data
No HTML entity should be parsed at all, and the attribute value should contain
&
instead of&
.Would you like to work on this issue?
Bookmark this repository for further updates. Visit SoloThought to know about recent features.
The text was updated successfully, but these errors were encountered: