I'm looking for some 3rd party library to work with XML files. The requirements for the library are:

It should be free for commercial use.

It should be opensource and written on C++03.

It should compile on different compilers (cl, gcc, forte).

It should allow parsing XML files. Files can contain some variables (say ${PATH}), the parser should take values of the variables from environment or from some .ini file and replace variables with their value.

It should allow validating XML files (describe some rules to which the XML file should meet).

I've took a look to Xerces, Pugixml, Tinyxml. But seems no one of them meets to all 5 requirements (in fact maybe they meet I haven't investigated them deeply).

Please suggest me a new library. Or tell to which of mentioned ones should I pay attention.

Number four is going to be a tricky one. You'll probably have to write the functionality for that yourself.
–
slugonamissionNov 14 '11 at 9:02

1

There's such thing as a 1st party XML library?
–
PubbyNov 14 '11 at 9:02

1

@Pubby If I write the library myself it will be "1st party" :)
–
Mihran HovsepyanNov 14 '11 at 9:05

1

Well, IMO, TinyXML is the easiest one to hack and modify to meet your requirements, but AFAIK it is a non-validating parser. Xerces/Expat or libxml are more fully fledged, but won't have 4. Like slugonamission says, you will have to implement this yourself as may be a pre-parsing step...
–
NimNov 14 '11 at 9:13

3. Not sure about cl, forte; I have successfully compiled it under gcc and visual studio 8-9-10. 4. as slugonamission said, you'll probably have to code that yourself. 5. Provides validation using at least DTD and XSD
–
Antonio PérezNov 14 '11 at 9:49