[PropertyTree] read_json() followed by write_xml produces invalid XML
Hi all,
Last week I posted the message below to the Boost Users group. One of the posters suggested that I stumbled upon a bug in Boost.PropertyTree.
So, the question is: am I doing something wrong, or is this is a bug in Boost.PropertyTree?
Best regards,
Marcel Loose.
---- Start of message ----
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
participants (1)
-
Marcel Loose