Hi there! First, thank you for the effort on maintaining this library. Using xml.Decoder alone would be at least terrible.
Since I'm using it, this is a small contribution to give back to the community.
This implements a new cachedReader that will maintain the last 4096 bytes between StartCaching and StopCaching calls. Leveraging the call sequence of xml.Decoder.Token(), we can realiably detect CDATA tags, and act accordingly. This should also work well with streams, again, given how xml.Decoder.Token() returns data.
I also edited a test to ensure we maintain compatibility.
Coverage increased (+0.3%) to 92.079% when pulling ec55aa7cb1b118b513f1d8669e0532392e6c13b3 on heyvito:fix/cdata into def09eac03da9816386c93c73ccaf6d257138835 on antchfx:master.
Hi there! First, thank you for the effort on maintaining this library. Using
xml.Decoder
alone would be at least terrible. Since I'm using it, this is a small contribution to give back to the community.This implements a new
cachedReader
that will maintain the last 4096 bytes betweenStartCaching
andStopCaching
calls. Leveraging the call sequence ofxml.Decoder.Token()
, we can realiably detect CDATA tags, and act accordingly. This should also work well with streams, again, given howxml.Decoder.Token()
returns data. I also edited a test to ensure we maintain compatibility.Thank you!