davidsantiago/hickory — pull request #22 by olivergeorge (2014-12-23 02:36:49+00:00)
Title: XML support

I've done a little work to make hickory support basic XML parsing and rendering. I'm wondering if this is something you think could be added to the main hickory repo.

My goal was parse an XML document, make changes to it and then serialise the back to XML. Where possible I wanted the rendered XML to be as close to the original as practical to simplify debugging.

The changes needed were all quite minor really:
* Use "application/xml" when calling js/DOMParser
* Respect case of tag names
* Render with preamble
* Render a closed tag if no children are present

I cut and pasted a lot to keep things simple (for me) but I think you will have ideas on a more integrated approach.

I'm concious that this code relies on js/DOMParser which might be more restrictive than hickory is otherwise. In particular it's an IE9+ approach.