Hi all,
I was quite surprised and disappointed to find out that I was unable
to convert a simple JSON file into XML, using the Boost PropertyTree.
As input I used the example JSON file from the documentation (see
example.json below).
I wrote a small program (see example.cc below) that reads in this JSON
file, writes it to disk as XML file, and finally tries to read back
this XML file. This last operation fails with an exception (see output
below); the XML file that is produced (see example.xml below) is
invalid, because it contains empty tags (<>).
Am I doing something wrong?
Best regards,
Marcel Loose.
$ cat example.json
{
"menu":
{
"foo": true,
"bar": "true",
"value": 102.3E+06,
"popup":
[
{"value": "New", "onclick": "CreateNewDoc()"},
{"value": "Open", "onclick": "OpenDoc()"}
]
}
}
$ cat example.cc
#include