Subject: [Boost-bugs] [Boost C++ Libraries] #5413: (read_xml + write_xml) do not restitute escape sequences in tag's attribute stri
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2011-04-03 18:00:32
#5413: (read_xml + write_xml) do not restitute escape sequences in tag's attribute
stri
-----------------------------------+----------------------------------------
Reporter: misterwallas@⦠| Owner:
Type: Bugs | Status: new
Milestone: To Be Determined | Component: None
Version: Boost 1.47.0 | Severity: Problem
Keywords: |
-----------------------------------+----------------------------------------
'''Description'''
Use the following program to read/write to/from a ptree an XML file
containing XML escape sequences in tag's attribute string.
{{{
#include <boost/property_tree/ptree.hpp>
#include <boost/property_tree/xml_parser.hpp>
using boost::property_tree::ptree;
int main()
{
ptree pt;
read_xml("xml-esc-in.xml", pt);
write_xml("xml-esc-out.xml", pt);
return 0;
}
}}}
* With the following XML input file
'''xml-esc-in.xml'''
{{{
<?xml version="1.0" encoding="UTF-8"?>
<html>
<head>
<title>Title</title>
<link title="<>"'&" href="" />
</head>
<body>
<p>
<>"'&
</p>
</body>
</html>
}}}
* It will give you the following XML output file
'''xml-esc-out.xml'''
{{{
<?xml version="1.0" encoding="utf-8"?>
<html>
<head>
<title>Title</title>
<link title="<>"'&" href=""/>
</head>
<body>
<p>
<>"'&
</p>
</body>
</html>
}}}
* Escape sequences in the [title] attribute of the <link> tag have been
translated into their ascii equivalent resulting in an invalid XML.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/5413> 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:06 UTC