0

What's the best API I can use to do some simple XML read/writing? I'm using Visual Studios. Is there a standard one that I can use in the STD library? The sofwtare that I need it for maybe sold and can't be open source, so it will have to have a flexible license for commercial use.

EDIT: I am NOT using this for any SOAP, protocol or data-binding stuff, Im just using this to store information, as almost an alternative to a database (because in this instance it would be more efficient).

user965369
  • 5,413
  • 13
  • 33
  • 47
  • Duplicate Question: http://stackoverflow.com/questions/9387610/what-xml-parser-should-i-use-in-c – Foggzie Mar 30 '12 at 14:28

4 Answers4

3

I love pugixml. It's fast, light weight, incredibly easy to use and embed in projects (I've used it in several at work, it's only ~3 files), and best of all, supports XPath 1.0 (which is awesome).

Edit: No, there isn't one in the standard library.

Edit Edit: About pugixml's license: it is distributed under the MIT license, which is about as permissive as you can get.

Cornstalks
  • 37,137
  • 18
  • 79
  • 144
  • True, but pugixml is not an [XML data binding tool](http://xmldatabinding.org). I don't like low level XML coding as its easy to mess up. You may end up having to write lots more code to store/retrieve XML data and check/convert content. – Dr. Alex RE Feb 13 '16 at 05:25
  • @Alex: Sure, if you're doing lots of complicated XML parsing, then a heavier-weight parser might be better. But the OP asked for a simple XML parser for some simple serialization. In the context of this question, a large library with XML data binding is overkill (especially since I seriously doubt the OP has a WSDL/XSD to generate the data bindings). Using something like gSOAP would be overcomplicated overkill for the OP. – Cornstalks Feb 13 '16 at 16:34
2

As far as I know, there's no standard library to read XML.

I found TinyXML a handy library. There's now a TinyXML 2 which I've not used.

Skizz
  • 69,698
  • 10
  • 71
  • 108
2

I would recommand GSOAP. I know companies that use this in products they sell so licensing should not be an issue. It has features such as schema validation etc...

Jtello
  • 752
  • 1
  • 5
  • 17
1

Microsoft offers an XML library called XmlLite.

http://msdn.microsoft.com/en-us/library/windows/desktop/ms752838%28v=vs.85%29.aspx