Leonidas-from-XIV / node-xml2js

XML to JavaScript object converter.
MIT License
4.88k stars 602 forks source link

Parse failed when attribute string with & #509

Closed zhangjiangshan closed 5 years ago

zhangjiangshan commented 5 years ago

Example: <view attr="a&b"/>

version: 0.4.19 node_version: v10.13.0

console error : Error: Invalid character in entity name Line: 7 Column: 36 Char: &

Leonidas-from-XIV commented 5 years ago

It is not well-formed XML so the failure makes sense. You need to use &amp;.