[xml] How libxml2 can preserve spaces?



Wiktionary xml need space preserving, small example xml:
<mediawiki xmlns="http://www.mediawiki.org/xml/export-0.10/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.mediawiki.org/xml/export-0.10/ http://www.mediawiki.org/xml/export-0.10.xsd" version="0.10" xml:lang="iu">
  <page>
    <title>Template:All messages</title>
    <ns>10</ns>
    <id>570</id>
    <revision>
      <id>2754</id>
      <text bytes="127367" xml:space="preserve">This is a list of all messages available in the MediaWiki: namespace
&lt;table border=1 width=100%&gt;&lt;tr&gt;&lt;td&gt;
  '''Name'''
&lt;/td&gt;&lt;td&gt;
        </text>
    </revision>
  </page>
</mediawiki>

I am using libxml2 with wrapper libxml++ and use example from 
https://github.com/libxmlplusplus/libxmlplusplus/tree/libxml++-3-2/examples/sax_parser
In method MySaxParser::on_characters I give new line characters after  chars < and >




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]