views:

21

answers:

1

I'm looking to replace MSXML with a library that will allow us to use DOM processing but using our own allocation, so we can assure it is mapped directly onto a memory-mapped file. This avoids having to synch the DOM back to the file. Can anyone please suggest which of the various libraries out there is most likely to be easily customised in this manner.

We are using simple XPaths as well as hierarchical DOM navigation. As an secondary preference we would like it to have an API close to the .Net DOM classes, to keep application code similar.

I am quite capable of customising or wrapping libraries if necessary, having written expatpp the OO wrapper for expat. In benchmarks, it seems RapidXML and LibXML2 are ahead of expat in performance and include DOM code which I'd otherwise have to write. Another contender is pugixml.

It sounds like RapidXML is close to what I need already, from this comment (in the manual) nodes and attributes do not own the text of their names and values. This is because normally they only store pointers to the source text.

A: 

Have a look also at pugixml's manual, especially at Custom memory allocation/deallocation functions

Pugixml has XPath support and is actively maintained.

Cristian Adam
Thanks for the direct reference. It has helped me clarify my thinking a bit more because what I need is basically for the DOM to point directly to the serialised XML document (a fragment in a larger memory-mapped file) and obviously that complicates updates - they will have to do linear insertions in order to maintain the original XML. I'm not sure that just being able to replace the allocator will work because I won't know where it is in context. I realise I may well be asking too much of **any** library!
Andy Dent