instant-labs / instant-xml

11 stars 3 forks source link

Handle Cdata sections #49

Closed josht-jpg closed 9 months ago

josht-jpg commented 9 months ago

Handling Cdata sections.

Currently, if a Cdata token is encountered, we'll meet the following error: unexpected token: Cdata. This should be fixed by accounting for Cdata tokens in the implementation of Iterator for Context.

From my understanding of Cdata sections, I believe we are only concerned with the text inside any Cdata section. My knowledge of XML is very limited, so I could be wildly off with this approach.

Cheers!

djc commented 9 months ago

I've been thinking about this -- I think it needs more work because the escaping rules within a CDATA are different from outside. So we'll need to propagate the information whether text data was from CDATA or from a normal text node.

djc commented 9 months ago

Closing this in favor of #50.