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
tXml fails to parse perfectly valid XML like this:
<a><link>foobar</link></a>
I get error "Error: Unexpected close tag" (for the record, fix is to give noChildNodes: [] as option for parse()).
This is kind of a documented feature as documentation describes noChildNodes as "array of nodes, that have no children and don't need to be closed. Default is working good for html." and is given as an example. However, it is surprising that parsing fails if closing tag do exist (not sure but I think link tag can be closed?). It is also surprising that XML parser, by default, fails to parse valid XML even if stated in the documentation if you read far enough especially when everything seems to work at first and then just crashed later on when link tag makes it way to XML.
So I would propose enhancement along the lines:
Make parse() accept end tags for noChildNodes as well, if this is possible
Update documentation so that it is obvious that by default parse() is designed for HTML and may fail with XML
Perhaps even separate functions with different defaults link parseHtml() and parseXml(), this would also help e.g. with Parse special entinties #44 so parseXml and parseHtml would by default decode entities and CDATA while parse() would be backwards compatible
But hey, great parser in any case, worked just fine with a product using Rhino engine blocking access to everything otherwise able to decode XML...
The text was updated successfully, but these errors were encountered:
tXml fails to parse perfectly valid XML like this:
<a><link>foobar</link></a>
I get error "Error: Unexpected close tag" (for the record, fix is to give noChildNodes: [] as option for parse()).
This is kind of a documented feature as documentation describes noChildNodes as "array of nodes, that have no children and don't need to be closed. Default is working good for html." and is given as an example. However, it is surprising that parsing fails if closing tag do exist (not sure but I think link tag can be closed?). It is also surprising that XML parser, by default, fails to parse valid XML even if stated in the documentation if you read far enough especially when everything seems to work at first and then just crashed later on when link tag makes it way to XML.
So I would propose enhancement along the lines:
But hey, great parser in any case, worked just fine with a product using Rhino engine blocking access to everything otherwise able to decode XML...
The text was updated successfully, but these errors were encountered: