Bonjour,
je cherche à parser un fichier xml en utilisant ce code
Or à l'affichage (aussi à l'enregistrement), ma baliseCode:
1
2
3
4
5
6
7
8
9
10
11 #!/usr/bin/ perl use XML::LibXML; my $file_in='./monfichier.xml'; my $file_out='./monfichierSortie.xml'; my $parser = XML::LibXML->new(); my $tree = $parser->parse_file($file_in); print $tree->toString(1);
s'est transformé en :Code:
1
2
3
4 <metadata xmlns:dc="http://monnamespace"> <meta name="cover" content="my-cover-image"/> </metadata>
J'ai essayé d'utiliser les options du parser pour qu'ils ne soient pas ajouté mais rien n'y fait ces 2 attributs sont systématiquement rajoutéCode:
1
2
3
4 <metadata xmlns:dc="http://monnamespace"> <meta xmlns="http://www.w3.org/1999/xhtml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="cover" content="my-cover-image"/> </metadata>
Qqun sait-il quelle option utiliser? ou comment proceder?
merci