Package: libboost1.54-dev

boost ptree creates invalid XML when key contains a '/'.

Steps:

$ cat pt.cxx
#include <boost/property_tree/xml_parser.hpp>
#include <fstream>

int main()
{
  using boost::property_tree::ptree;
  ptree pt;
  pt.put("MY/KEY", 42 );

  std::ofstream os( "invalid.xml" );
  boost::property_tree::write_xml(os, pt);
  os.close();

  return 0;
}

$ g++ pt.cxx && ./a.out
$ cat invalid.xml
<?xml version="1.0" encoding="utf-8"?>
<MY/KEY>42</MY/KEY>%
$ xmllint --format invalid.xml
invalid.xml:2: parser error : error parsing attribute name
<MY/KEY>42</MY/KEY>
   ^
invalid.xml:2: parser error : attributes construct error
<MY/KEY>42</MY/KEY>
   ^
invalid.xml:2: parser error : Couldn't find end of Start Tag MY line 2
<MY/KEY>42</MY/KEY>
   ^
invalid.xml:2: parser error : Extra content at the end of the document
<MY/KEY>42</MY/KEY>
   ^


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to