[Boost-bugs] [Boost C++ Libraries] #6041: Exception in basic_xml_iarchive(...) when xml contains short tags

Subject: [Boost-bugs] [Boost C++ Libraries] #6041: Exception in basic_xml_iarchive(...) when xml contains short tags
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2011-10-20 10:44:54


#6041: Exception in basic_xml_iarchive(...) when xml contains short tags
-------------------------------------------------------+--------------------
 Reporter: Darren Griffin <darren.griffin@…> | Owner: ramey
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: serialization
  Version: Boost 1.38.0 | Severity: Showstopper
 Keywords: |
-------------------------------------------------------+--------------------
 Hi Guys,

 I'm getting an exception thrown when DE serializing XML which contains
 short-tags '<tag/>' where no data is present.

 If you take a look at the following StackOverflow link this will explain
 my problem.

 http://stackoverflow.com/questions/7823875/boost-serialization-exception-
 to-and-from-xml-via-sql-server-xml-datatype

 I've looked into the code in some depth now, so I’ll do my best to point
 out my findings.

 The exception happens in 'basic_xml_iarchive.ipp', line 34, the function
 called 'basic_xml_iarchive<Archive>::load_start(const char *name)'

 If the 'parse_start_tag(..)' call in this function begins to find the
 starting tag for said name, and the tag in question is a short-tag it is
 unable to find a pattern match for that tag and the exception is thrown.

 With my understanding and following the code through this function it
 takes me to where i believe the problem lies.

 If you look in 'basic_xm_grammar.ipp' at the function
 'basic_xml_grammar<CharType>::basic_xml_grammar()' which begins on line
 233, you will see what looks like 2 pattern attributes defined..

 STag (line 255)
 ETag (line 264)

 These, from what I can gather, define the pattern for what the start and
 end tags of an XML tag would look like, and i can see no patterns here
 which would be capable of capturing the short-tag, so one can only assume
 this has been overlooked, or at least that’s my view.

 I've looked at later version of boost and I can see no changes which lead
 me to believe this has been fixed.

 I'm hoping it's just me not doing something correctly, but I leave it to
 you guys to determine if it really is a bug or not.

 Great libraries though, they have made my job much more enjoyable over the
 past few years.

 Any questions feel free to contact me.

 Cheers,
 Darren

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