[serialization] Limited Forward Compatibility

Hello, We use xml serialization for saving and loading several types of metadata and we have to support possibility of reading new versions of files with old versions of soft. Boost::serialization is very good at backward compatibility but does not provide anything with opposite problem. So, This patch introduces new flag boost::archive::skip_unknown_tail_tags. When this flag is set and basic_xml_iarchive is faced with unknown tags at the end of element it will skip them (include nested). E.g., the first version of some file was: <Test class_id="0" tracking_level="0" version="0"> <a>31</a> <t2 class_id="1" tracking_level="0" version="0"> <a>11</a> <b>12</b> </t2> <b>32</b> </Test> After a while, the second version could be: <Test class_id="0" tracking_level="0" version="0"> <a>31</a> <t2 class_id="1" tracking_level="0" version="1"> <a>11</a> <b>12</b> <c>13</c> <d>14</d> <t1 class_id="2" tracking_level="0" version="0"> <a>1</a> <b>2</b> </t1> </t2> <b>32</b> </Test> Therefore, if the first version software set skip_unknown_tail_tags it can read second version of file (if does not set then exception will be thrown). See patch in attachments for details. Could it be useful, and should it be merged in trunk? Thanks in advance, Dmitry

Hello, Sorry for rising thread. I don’t understand the rules for accepting patches. If anyone hasn’t answered to my previous message does it mean that the patch won't be accepted? Is there any procedure for accepting patches, which I should follow? Thanks for advice, Dmitry On Thu, 07 Feb 2013 03:27:01 +0400, Dmitry Shesterkin <dfb@yandex.ru> wrote:
Hello,
... So, This patch introduces new flag boost::archive::skip_unknown_tail_tags. When this flag is set and basic_xml_iarchive is faced with unknown tags at the end of element it will skip them (include nested). ... Therefore, if the first version software set skip_unknown_tail_tags it can read second version of file (if does not set then exception will be thrown).
See patch in attachments for details. Could it be useful, and should it be merged in trunk?
Thanks in advance, Dmitry

Dmitry Shesterkin wrote:
Hello,
Sorry for rising thread. I don't understand the rules for accepting patches. If anyone hasn't answered to my previous message does it mean that the patch won't be accepted?
Is there any procedure for accepting patches, which I should follow?
Thanks for advice, Dmitry
On Thu, 07 Feb 2013 03:27:01 +0400, Dmitry Shesterkin <dfb@yandex.ru> wrote:
Hello,
... So, This patch introduces new flag boost::archive::skip_unknown_tail_tags. When this flag is set and basic_xml_iarchive is faced with unknown tags at the end of element it will skip them (include nested). ... Therefore, if the first version software set skip_unknown_tail_tags it can read second version of file (if does not set then exception will be thrown).
See patch in attachments for details. Could it be useful, and should it be merged in trunk?
Thanks in advance, Dmitry
The basic rule is: "Only those who can be responsable for supporting the library can be authorised to add patches." I've taken a cursory look at your patch and have found it iteresting. You can open a track item with this enhancement proposal so it doesn't get lost. Robert Ramey

Thank you, Robert. I’ve created the ticket https://svn.boost.org/trac/boost/ticket/8088 Looking forward that patch will be accepted. On Sat, 16 Feb 2013 21:30:03 +0400, Robert Ramey <ramey@rrsd.com> wrote:
The basic rule is:
"Only those who can be responsable for supporting the library can be authorised to add patches."
I've taken a cursory look at your patch and have found it iteresting. You can open a track item with this enhancement proposal so it doesn't get lost.
Robert Ramey
participants (2)
-
Dmitry Shesterkin
-
Robert Ramey