<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.2.2" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
	<title>Comments on: libstudxml &#8211; modern XML API for C++</title>
	<link>https://codesynthesis.com/~boris/blog//2014/05/20/libstudxml-modern-xml-api-cxx/</link>
	<description>Boris Kolpackov's blog about software</description>
	<pubDate>Sun, 05 Apr 2026 15:31:51 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.2.2</generator>

	<item>
		<title>By: Boris Kolpackov</title>
		<link>https://codesynthesis.com/~boris/blog//2014/05/20/libstudxml-modern-xml-api-cxx/#comment-2437</link>
		<author>Boris Kolpackov</author>
		<pubDate>Wed, 21 May 2014 20:16:04 +0000</pubDate>
		<guid>https://codesynthesis.com/~boris/blog//2014/05/20/libstudxml-modern-xml-api-cxx/#comment-2437</guid>
		<description>The parser needs the document name for diagnostics (error messages will look like "input.xml:12:23 ...").

As for conversion of "male" to gender, that's a good question that is answered in the documentation.</description>
		<content:encoded><![CDATA[<p>The parser needs the document name for diagnostics (error messages will look like &#8220;input.xml:12:23 &#8230;&#8221;).</p>
<p>As for conversion of &#8220;male&#8221; to gender, that&#8217;s a good question that is answered in the documentation.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: DeadMG</title>
		<link>https://codesynthesis.com/~boris/blog//2014/05/20/libstudxml-modern-xml-api-cxx/#comment-2436</link>
		<author>DeadMG</author>
		<pubDate>Wed, 21 May 2014 20:09:55 +0000</pubDate>
		<guid>https://codesynthesis.com/~boris/blog//2014/05/20/libstudxml-modern-xml-api-cxx/#comment-2436</guid>
		<description>Why on earth does the parser need both the filename and the stream? Shouldn't it only need the stream?

And how do you convert from "male" to gender::male? C++ does not support reflection.</description>
		<content:encoded><![CDATA[<p>Why on earth does the parser need both the filename and the stream? Shouldn&#8217;t it only need the stream?</p>
<p>And how do you convert from &#8220;male&#8221; to gender::male? C++ does not support reflection.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Boris Kolpackov</title>
		<link>https://codesynthesis.com/~boris/blog//2014/05/20/libstudxml-modern-xml-api-cxx/#comment-2435</link>
		<author>Boris Kolpackov</author>
		<pubDate>Wed, 21 May 2014 15:30:43 +0000</pubDate>
		<guid>https://codesynthesis.com/~boris/blog//2014/05/20/libstudxml-modern-xml-api-cxx/#comment-2435</guid>
		<description>Arseny, as I mentioned in my post, I discuss the issue of real XML parsers in my talk in much more detail, so I suggest that you check it out when the video is available. In a nutshell, the argument boils down to this: The intended use of XML is as a data interchange format, not just a data storage format. If your application is the sole producer and consumer of the data, then you might as well choose a more natural and efficient format than XML. So assuming we use XML for data interchange, while your code may not use any of the CDATA's or DTD's, it is only a matter of time before someone sends you a perfectly valid XML that your application won't be able to parse. In fact, most of the "subset" parsers, including pugixml, don't even document what happens when valid but unsupported XML constructs are encountered. Are they ignored? Is there an error? Crash? Nobody knows. In fact, you don't even document that your XML parser only supports a subset of XML, which is what I find misleading.

So in my talk I suggested that people don't corner themselves and instead stick to real XML parsers. There are plenty of conforming and fast implementations out there. And not a single person in the audience raised your "but it works in 99% of use cases" objection.

Regarding the in-memory vs streaming API argument (which is also covered in the talk extensively), most people think they need DOM but I think this is just because of the really bad streaming APIs that were available up to this point. So I tried to convince the audience that streaming is actually sufficient for the majority of cases. Plus, it is easy to go from streaming to in-memory but not the other way around. In fact, libstudxml has the 'hybrid' example which shows how to do hybrid, partially streaming/partially in-memory parsing and serialization.</description>
		<content:encoded><![CDATA[<p>Arseny, as I mentioned in my post, I discuss the issue of real XML parsers in my talk in much more detail, so I suggest that you check it out when the video is available. In a nutshell, the argument boils down to this: The intended use of XML is as a data interchange format, not just a data storage format. If your application is the sole producer and consumer of the data, then you might as well choose a more natural and efficient format than XML. So assuming we use XML for data interchange, while your code may not use any of the CDATA&#8217;s or DTD&#8217;s, it is only a matter of time before someone sends you a perfectly valid XML that your application won&#8217;t be able to parse. In fact, most of the &#8220;subset&#8221; parsers, including pugixml, don&#8217;t even document what happens when valid but unsupported XML constructs are encountered. Are they ignored? Is there an error? Crash? Nobody knows. In fact, you don&#8217;t even document that your XML parser only supports a subset of XML, which is what I find misleading.</p>
<p>So in my talk I suggested that people don&#8217;t corner themselves and instead stick to real XML parsers. There are plenty of conforming and fast implementations out there. And not a single person in the audience raised your &#8220;but it works in 99% of use cases&#8221; objection.</p>
<p>Regarding the in-memory vs streaming API argument (which is also covered in the talk extensively), most people think they need DOM but I think this is just because of the really bad streaming APIs that were available up to this point. So I tried to convince the audience that streaming is actually sufficient for the majority of cases. Plus, it is easy to go from streaming to in-memory but not the other way around. In fact, libstudxml has the &#8216;hybrid&#8217; example which shows how to do hybrid, partially streaming/partially in-memory parsing and serialization.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Arseny Kapoulkine</title>
		<link>https://codesynthesis.com/~boris/blog//2014/05/20/libstudxml-modern-xml-api-cxx/#comment-2434</link>
		<author>Arseny Kapoulkine</author>
		<pubDate>Wed, 21 May 2014 15:02:21 +0000</pubDate>
		<guid>https://codesynthesis.com/~boris/blog//2014/05/20/libstudxml-modern-xml-api-cxx/#comment-2434</guid>
		<description>As an author of pugixml, I can't help but comment on the "real XML parser" thing... Your link is very misleading - you stumbled upon a parser that can't read content from valid XML at all, CDATA of all things. Great.

Fast/compact XML libraries solve real problems. As long as a parser can read a valid XML disregarding DTD entities, it's applicable to 99% real-world problems.

If I were to consider libstudxml vs pugixml in a project, I would *not* use this as a disctinction point. A much more important thing is that all three parsers that you specified are DOM, and this parser is pull-based - so depending on the task at hand one is more applicable.</description>
		<content:encoded><![CDATA[<p>As an author of pugixml, I can&#8217;t help but comment on the &#8220;real XML parser&#8221; thing&#8230; Your link is very misleading - you stumbled upon a parser that can&#8217;t read content from valid XML at all, CDATA of all things. Great.</p>
<p>Fast/compact XML libraries solve real problems. As long as a parser can read a valid XML disregarding DTD entities, it&#8217;s applicable to 99% real-world problems.</p>
<p>If I were to consider libstudxml vs pugixml in a project, I would *not* use this as a disctinction point. A much more important thing is that all three parsers that you specified are DOM, and this parser is pull-based - so depending on the task at hand one is more applicable.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
