Skip Menu |

This queue is for tickets about the XML-Simple CPAN distribution.

Report information
The Basics
Id: 34447
Status: rejected
Priority: 0/
Queue: XML-Simple

People
Owner: Nobody in particular
Requestors: am.courrier [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: XMLout change XML structure
Date: Wed, 26 Mar 2008 17:17:36 +0100
To: bug-XML-Simple [...] rt.cpan.org
From: AM Courrier <am.courrier [...] gmail.com>
Hi, I'm working on a sort of proxy for an XML protocol. I discovered XML::Simple which do a good job for that with XMLin and XMLout... but I have a problem in some cases. Here is my code sample : " $xml = <<EOF; <message><option><value>my_value</value></option></message> EOF print "---------- BEFORE XMLin \n".$xml."\n"; $ref = XMLin($xml, ForceContent => 1, KeepRoot => 1, KeyAttr => undef); print Dumper($ref); $xml2 = XMLout($ref, NoEscape => 0, NoIndent => 1, NoSort => 1, RootName => undef); print "---------- AFTER XMLout \n".$xml2."\n"; " Here is the STDOUT : " ---------- BEFORE XMLin <message><option><value>my_value</value></option></message> $VAR1 = { 'message' => { 'option' => { 'value' => { 'content' => 'my_value' } } } }; ---------- AFTER XMLout <message name="option"><value>my_value</value></message> " The resulting structure is different from the initial's one. I read and read anew docs and FAQ, played with options like (VarAttr, ValueAttr, ...) but I didn't find the solution. Could you help me (by telling me how to do to make this working) ? Regards Alain
Subject: [rt.cpan.org #34447]
Date: Wed, 26 Mar 2008 17:23:09 +0100
To: bug-XML-Simple [...] rt.cpan.org
From: AM Courrier <am.courrier [...] gmail.com>
I forgot to add that I'm using : - Ubuntu 7.10 - perl 5.8.8 - XML::Simple version 2.18 Alain
The CPAN Request Tracker is for reporting bugs and is not a suitable place for asking questions such as this. A more appropriate site would be http://www.perlmonks.org/. The ForceArray option is probably closest to what you need but XML::Simple is primarily for reading XML and is not a good choice for round-tripping (reading-altering-writing) XML.
Subject: Re: [rt.cpan.org #34447] XMLout change XML structure
Date: Thu, 27 Mar 2008 09:02:16 +0100
To: bug-XML-Simple [...] rt.cpan.org
From: AM Courrier <am.courrier [...] gmail.com>
Thank you for you reply. You say XML::Simple is not a good choice for my needs, is it for performance reasons ? What would you recommand ? A SAX parser like yours ? or what else ? In a way, I looking for a smart and small (or not too large) package with not too much dependencies. Regards Alain Grant McLean via RT a écrit : Show quoted text
> <URL: http://rt.cpan.org/Ticket/Display.html?id=34447 > > > The CPAN Request Tracker is for reporting bugs and is not a suitable > place for asking questions such as this. A more appropriate site would > be http://www.perlmonks.org/. > > The ForceArray option is probably closest to what you need but > XML::Simple is primarily for reading XML and is not a good choice for > round-tripping (reading-altering-writing) XML. > >
Actual reply is in a separate email - please do not reply to this message