Boost C++ Libraries: Ticket #6041: Exception in basic_xml_iarchive(...) when xml contains short tags https://svn.boost.org/trac10/ticket/6041 <p> Hi Guys, </p> <p> I'm getting an exception thrown when DE serializing XML which contains short-tags '&lt;tag/&gt;' where no data is present. </p> <p> If you take a look at the following <a class="missing wiki">StackOverflow</a> link this will explain my problem. </p> <p> <a class="ext-link" href="http://stackoverflow.com/questions/7823875/boost-serialization-exception-to-and-from-xml-via-sql-server-xml-datatype"><span class="icon">​</span>http://stackoverflow.com/questions/7823875/boost-serialization-exception-to-and-from-xml-via-sql-server-xml-datatype</a> </p> <p> I've looked into the code in some depth now, so I’ll do my best to point out my findings. </p> <p> The exception happens in 'basic_xml_iarchive.ipp', line 34, the function called 'basic_xml_iarchive&lt;Archive&gt;::load_start(const char *name)' </p> <p> 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. </p> <p> With my understanding and following the code through this function it takes me to where i believe the problem lies. </p> <p> If you look in 'basic_xm_grammar.ipp' at the function 'basic_xml_grammar&lt;<a class="missing wiki">CharType</a>&gt;::basic_xml_grammar()' which begins on line 233, you will see what looks like 2 pattern attributes defined.. </p> <p> STag (line 255) ETag (line 264) </p> <p> 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. </p> <p> I've looked at later version of boost and I can see no changes which lead me to believe this has been fixed. </p> <p> 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. </p> <p> Great libraries though, they have made my job much more enjoyable over the past few years. </p> <p> Any questions feel free to contact me. </p> <p> Cheers, Darren </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/6041 Trac 1.4.3 Robert Ramey Sat, 12 Nov 2011 20:45:46 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/6041#comment:1 https://svn.boost.org/trac10/ticket/6041#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">wontfix</span> </li> </ul> <p> the xml_archive code, as does all the serialization code presumes that we load exactly what we save. Generally trying to make it more general never seemed worth the risk. If you want to create, test and submit a patch to the spirit parser which would handle the &lt;/..&gt; tags I would look at it. But lacking this, I'm not inclined to spend time on this. </p> <p> Robert Ramey </p> Ticket