Re: XML::Simple, pas la même sortie que l'entrée.

Stephane Bortzmeyer <[email protected]>
Newsgroups gmane.text.xml.french.tech
Message-ID <[email protected]>
On Thu, Mar 23, 2006 at 05:31:02PM +0100,
 Luc Desfosses <[email protected]> wrote 
 a message of 87 lines which said:

> J'ai des fichiers XML que je parse grace à Perl et au module XML::Simple.
...
> Si quelqu'un connais les si il est possible d'obtenir le même format que 
> dans l'entrée.

Je n'ai jamais essayé mais la doc indique plusieurs pistes utiles. Que
donnent-elles ?

Par exemple :

       If you wish to 'round-trip' arbitrary data structures from Perl to XML
       and back to Perl, then you should probably disable array folding (using
       the KeyAttr option) both with "XMLout()" and with "XMLin()".  If you
       still don't get the expected results, you may prefer to use XML::Dumper
       which is designed for exactly that purpose.

ou bien :

       AttrIndent => 1 # out - handy

       When you are using "XMLout()", enable this option to have attributes
       printed one-per-line with sensible indentation rather than all on one
       line.

Il y a aussi des avertissements qui me semblent pertients pour vous :

       If your needs are not so simple, this may not be the module for you.
       In that case, you might want to read "WHERE TO FROM HERE?".

ou :
  
       XML::Simple is able to present a simple API because it makes some
       assumptions on your behalf.  These include:

       ·   You don't want fine-grained control of the formatting of generated
           XML
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.