[Boost-bugs] [Boost C++ Libraries] #9448: Invalid XML produced when key contains '/'

Subject: [Boost-bugs] [Boost C++ Libraries] #9448: Invalid XML produced when key contains '/'
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2013-12-01 07:37:47


#9448: Invalid XML produced when key contains '/'
------------------------------+---------------------------
 Reporter: smr@… | Owner: cornedbee
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: property_tree
  Version: Boost 1.54.0 | Severity: Problem
 Keywords: |
------------------------------+---------------------------
 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>
    ^
 }}}

 Reported as Debian bug #729579

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/9448>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:14 UTC