by guenter » 28 Jul 2009, 09:58
It should not be too hard to implement an alternative, fully interface compatible XML library based on libxml2. I don't want to generally replace expat with libxml2 though, as expat is fine for (I guess) 90 % of all cases and the overhead of libxml2 over expat is not worth it (given that POCO is often used for embedded stuff where low overhead and low footprint matters a lot).
We have done similar things with other libraries (e.g. NetSSL implemented based on SChannel and MatrixSSL) where we have implemented interface compatible libs on top of alternative backends, and this approach generally works quite well. In the case of XML, I guess about 90 % of the existing XML code can be reused. There's basically just one class that needs to be rewritten for libxml2 - ParserEngine. A few other extensions might be necessary to support the necessary SAX properties and features for validation (and other things libxml2 supports).