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

Luc Desfosses <[email protected]>
Newsgroups gmane.text.xml.french.tech
Message-ID <[email protected]>
Bonjour,

Voici mon petit problème:

J'ai des fichiers XML que je parse grace à Perl et au module XML::Simple.

Voici les fichiers d'entrée:

<host>
<hostnm>MonSwitch</hostnm>
        <sysloc>5em-etages</sysloc>
        <sysdsc>cisco internetwork operating system software
ios (tm) c2900xl software (c2900xl-c3h2s-m), version 12.0(5)wc8, release 
software (fc1)
copyright (c) 1986-2003 by cisco systems, inc.
compiled thu 19-jun-03 13:09 by antonino</sysdsc>
        <sysupt>165 days, 01:43:02.63</sysupt>
        <where>Serveur1</where>
        <when>thu mar 23 17:36:59 cet 2006</when>
        <int mib="1">
                <type>vl1</type>
                <descr/>
        </int>
        <int mib="2">
                <type>fa0/1</type>
                <descr>trunk 1</descr>
        </int>
        <int mib="3">
                <type>fa0/2</type>
                <descr>trunk 2</descr>
        </int>
        <int mib="4">
                <type>fa0/3</type>
                <descr> vers les autres </descr>
        </int>
        <int mib="5">
                <type>fa0/4</type>
                <descr>Well</descr>
        </int>
        <int mib="6">
                <type>fa0/5</type>
                <descr>Hell</descr>
        </int>
</host>

Et quand je le ressort à l'aide de XML::Simple XMLout(), voici ce que 
j'obtient:

Avec la commande suivante: my $xml = XMLout($fichier , OutputFile => 
"$fichname\.2.xml" , RootName => 'host');

Le fichier


<host hostnm="MonSwitch" sysdsc="cisco internetwork operating system 
software  ios (tm) c2900xl software (c2900xl-c3h2s-m), version 
12.0(5)wc8, release software (fc1) copyright (c) 1986-2003 by cisco 
systems, inc. compiled thu 19-jun-03 13:09 by antonino" 
sysloc="5em-etage" sysupt="162 days, 01:37:08.33" when="mon mar 20 
17:30:41 cet 2006" where="Serveur1">
<int mib="1" type="vl1">
<descr/>
</int>
<int descr="trunk 1" mib="2" type="fa0/1"/>
<int descr="trunk 2" mib="3" type="fa0/2"/>
<int descr=" vers les autres " mib="4" type="fa0/3"/>
<int descr="Well" mib="5" type="fa0/4"/>
<int descr="Hell" mib="6" type="fa0/5"/>
</host>

Si quelqu'un connais les si il est possible d'obtenir le même format que 
dans l'entrée.

Merci d'avance...!
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.