segmentio / xml-parser

simple non-compliant xml parser for nodejs
101 stars 36 forks source link

CDATA support #25

Open christianroy opened 7 years ago

christianroy commented 7 years ago

The parser won't work if a node content is CDATA.

I have made a simple fix and will gladly make a PR if you want: https://github.com/christianroy/xml-parser/commit/c32d26fd6e354dc18a53b648480a6da96bfa7e73

The change in function content() is not very elegant, but that was after a full day of yack shaving and I could not figure a single regexp that would work. :( Nonetheless there are tests if anyone would like to try to implement something cleaner.

laurenskling commented 5 years ago

My output is also limited to the first encounter of a CDATA value :(