I wasn't sure where to put the cdata, so I went with what seemed to be the most faithful to the original XML structure
What if a tag has a cdata attribute? Would this overwrite that?
The null check is to concatenate all the CDATA because according to the sax docs:
Since <![CDATA[ blocks can get quite large, this event may fire multiple times for a single block, if it is broken up into multiple write()s
Although it's probably unnecessary here.
test/cdata.json#L5: the carriage returns here might cause the tests to fail on platforms other than Windows (untested)edit: well, it's tested now. See the Travis build fail below.
Not sure if it's ready for a merge yet, but it does pass the tests.
Some concerns:
lib/client.js#L312-L316
cdata
attribute? Would this overwrite that?CDATA
because according to the sax docs:Although it's probably unnecessary here.
(untested)edit: well, it's tested now. See the Travis build fail below.