Subject: Re: [Boost-bugs] [Boost C++ Libraries] #7303: XML Serialization - Skip/Ignore unexpected data.
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2012-09-11 11:40:26
#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
Resolution: | Keywords:
-------------------------------+--------------------------------------------
Comment (by anonymous):
Replying to [comment:5 ramey]:
> why have you not used the spirit parser as xml_iarchive does?
For the poor reason that I don't have any experience with spirit.
> Seems to me that all this could have been achieved in a much simpler way
with less code and less future maintenance requirement by updating the
grammar on xml_iarchive.
So would I be right in thinking that you would extend the grammar to
support element content, (either data or child elements), and extend
`basic_xml_grammar` with a new method `parse_content` In this way I
could skip to the end tag of the start tag just read if the name didn't
match.
> This would have guaranteed passing of all current tests out of the box.
A feature of `xml_iarchive` is that top level elements don't have their
name checked. If there are multiple top level elements and I wish to skip
any of them I will need to inspect their names. So changing the tests in
the way that I have seems inevitable.
> Missing:
> a) Documentation/Explanation of what new features are offered and how
they are used
> b) Tests of the new features
Indeed. I am well aware that at this time it falls short of being a
patch, which is why I didn't label it as such. I was really just after
feedback, which you have provided, and for which I am grateful.
It would be extremely useful for me to be able to skip extra data in my
applications' configuration file. It would allow some support for ver.8
applications opening ver.9 config files, though the limitations would be
many: I could only ever add extra fields, I suspect I wouldn't be able to
skip data if it was reference by other parts of the xml. But even with
these limitations it would still be a useful feature to me. And since
others have suggested it, I thought worth pursuing.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/7303#comment:6> 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