Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I recently reviewed a bunch of XML libraries specifically for generating XML code. </p> <p>Executive summary: I chose to go with <a href="http://code.google.com/p/ticpp/" rel="nofollow noreferrer">TinyXML++</a>. </p> <p>TinyXML++ has decent C++ syntax, is built on the mature <a href="http://www.grinninglizard.com/tinyxml/" rel="nofollow noreferrer">TinyXML</a> C libraries, is free &amp; open source (MIT license) and small. In short, it helps get the job done quickly. Here's a quick snippet:</p> <pre><code>Document doc; Node* root(doc.InsertEndChild(Element("RootNode"))); Element measurements("measurements"); Element tbr("TotalBytesReceived", 12); measurements.InsertEndChild(tbr); root-&gt;InsertEndChild(measurements); </code></pre> <p>Which produces:</p> <pre><code>&lt;RootNode&gt; &lt;measurements&gt; &lt;TotalBytesReceived&gt;12&lt;/TotalBytesReceived&gt; &lt;/measurements&gt; &lt;/RootNode&gt; </code></pre> <p>I've been quite happy with it.</p> <p>I reviewed many others; here's some of the better contenders:</p> <p><a href="http://xerces.apache.org/xerces-c/" rel="nofollow noreferrer">Xerces</a>: The king-daddy. Does <em>everything</em> (especially when combined with <a href="http://xml.apache.org/xalan-c/" rel="nofollow noreferrer">Xalan</a>) but is heavyweight and forces memory management onto the user. </p> <p><a href="http://rapidxml.sourceforge.net/" rel="nofollow noreferrer">RapidXML</a>: Great for parsing (it's an in-situ parser and is <em>fast</em>) but not good for generation since adding nodes to the DOM requires memory management.</p> <p><a href="https://svn.boost.org/svn/boost/sandbox/xml/" rel="nofollow noreferrer">Boost.XML</a> (proposal): Looks <em>great</em> - powerful, excellent C++ syntax. However it hasn't yet gone through the review process, is unsupported and the interface may well change. Almost used it anyway. Looking forward to it's acceptance into Boost.</p> <p><a href="http://xmlsoft.org/" rel="nofollow noreferrer">Libxml</a>(<a href="http://libxmlplusplus.sourceforge.net/" rel="nofollow noreferrer">++</a>): Very good; powerful, decent syntax. But it's large-ish if all you're doing is <em>generating</em> XML and is tied to the glibmm library (for ustring). If we were <em>only</em> on Linux (like yourself?) I would seriously consider.</p> <p><a href="http://ximol.sourceforge.net/" rel="nofollow noreferrer">XiMOL</a>: Unique stream-based library. This was a little too simplistic for our needs but for basic XML generation you may find it quite useful. The stream syntax is quite neat.</p> <p>Hopefully there's something in there of some use!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload