XML::Simple is not a parser! XML::Simple uses XML::SAX or XML::Parser if they are installed, and in this order of preference.
Indeed. My bad.
The questions is that by default a content of a node that only have spaces is just ignored...
Using the SuppressEmpty option, you can specify how an element containing only whitespace is ignored, and not if it is ignored.
or we will always have content if the XML tree is idented.
I don't understand this part of your reply.

Referring to the question of the OP: "Is there any way to force XML::Simple to keep the spaces?". The answer is "No, there isn't". Elements consisting of only empty spaces are ignored, and the only thing you can control is whether they appear in the resulting hash as an empty string, undef, or not at all.

Arjen


In reply to Re: Re: Re: XML::Simple and <tag&gt </tag> by Aragorn
in thread XML::Simple and <tag&gt </tag> by Jenda

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.