Closed markcellus closed 1 year ago
It look like you have nested CDATA which is not allowed by the library.
Right, but shouldn't it just escape the nested CDATA? Or, at the very least, show an error that is more helpful?
have you checked with validator?
Ran it through the validator (output is below). I know that the package considers the XML invalid due to the nested CDATA. But what is the recommended approach of escaping the nested CDATA
? If you can let me know what that is, I'll just do that and close this issue. Thanks!
var {XMLValidator} = require("fast-xml-parser")
const result = XMLValidator.validate('<description><![CDATA[<pre><code><category><![CDATA[Architecture]]></category></code></pre><a href="https://test.com">link</a>]]></description>');
console.log(result)
Which gives me
{
err: {
code: 'InvalidTag';
msg: "Expected closing tag 'description' (opened in line 1, col 1) instead of closing tag 'category'.",
line: 1,
col: 68
};
};
currently no.
Description
Hello, thanks for building this package! I'm getting an unexpected error when attempting to parse XML with nested CDATA. ### InputCode
Output
expected data
Would you like to work on this issue?
Bookmark this repository for further updates.