1

I'm using the boost lib with property tree class. The functional part works fine with reading and writing a xml file but I'm trying to improve the error output for syntax and other errors. Also an output like "error in line 13" was planed to find errors more quickly.

Now I am pretty lost with this requirement since I don't see how to find any relationship between a specific error and the real xml file. Also a detection for unknown xml objects and properties would be good to find typos.

Any ideas, samples, ... are welcome.

thx

fpdragon
  • 1,867
  • 4
  • 25
  • 36
  • You are trying to read XML that Boost.PropertyTree wrote, correct? Because Boost.PropertyTree is *not* a quick-and-dirty XML parser. – Nicol Bolas Aug 21 '12 at 11:14

1 Answers1

0

The only error handling is via the exception read_xml throws.

You may want to consider validating the document against a schema you write before passing the XML to boost::property_tree.

There is no Boost XML library currently, so you may want to look at validation using Xerces-C++ Schema Support or another equivalent library.

Silas Parker
  • 8,017
  • 1
  • 28
  • 43