[Boost-bugs] [Boost C++ Libraries] #7303: XML Serialization - Skip/Ignore unexpected data.

Subject: [Boost-bugs] [Boost C++ Libraries] #7303: XML Serialization - Skip/Ignore unexpected data.
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2012-08-30 12:40:15


#7303: XML Serialization - Skip/Ignore unexpected data.
------------------------------+---------------------------------------------
 Reporter: anonymous | Owner: ramey
     Type: Feature Requests | Status: new
Milestone: To Be Determined | Component: serialization
  Version: Boost 1.51.0 | Severity: Not Applicable
 Keywords: |
------------------------------+---------------------------------------------
 Please find attached an extension to boost::serialization. The purpose of
 this work is to add some support for forward compatibility of
 boost::serialization XML files; specifically the ability to skip/ignore
 unexpected data.

 I would describe the patch as a "first working version", the tests all
 pass (gcc 4.6) with some expected failures (see below), but further work
 is required. I guess I'm trying to gauge interest, get some feedback on
 the implementation, and get inspired enough to invest more time in it.

 == Implementation ==

 Two new archive types, `rapidxml_iarchive`, and `rapidxml_wiarchive`, have
 been created. Their implementation is based on `xml_[w]iarchive` with the
 XML parsing provided by the rapidxml parser used in boost::property_tree.

 This seemed the best approach to the problem as it avoided issues with
 `ungetc`.

 Polymorphic versions of `rapidxml_[w]iarchive` have not been implemented.

 == Test status ==

 All tests are passing with the following caveats:

 * Polymorphic rapidxml archives have not been implemented resulting in 6
 tests failing to compile
 * The following tests have had to be tweaked to accommodate
 rapidxml_[w]iarchive not ignoring element names
   * test_derived_class
   * test_recursion
   * test_nvp
   * test_non_default_ctor2
   * test_diamond
   * test_diamond_complex

 == Notes and further work ==

 The current implementation is a "first working version" and requires some
 polishing. There are a number of things that require further
 investigation, broadly speaking they can be categorized as:

 * Better reuse
   * Factor out a base class (templated on char type) for
 `rapidxml_iarchive` and `rapidxml_wiarchive`
   * Some code could be shared between `rapidxml_[w]iarchive` and
 `xml_[w]iarchive`
     * See `[rapid]xml_iarchive::load(std::wstring&)`
     * See `[rapid]xml_wiarchive::load(std::string&)`
 * Better error handling
 * Flag support
   * Currently there are no plans to support any kind of flags/alternative
 behaviour so the existing flag code may need to be removed
 * Miscellany
   * Go through comments to see what's still relevant
   * Replace history map with vector

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/7303>
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:10 UTC