Re: questions on XML::Simple
- From: Ben Morrow <ben@xxxxxxxxxxxx>
- Date: Thu, 31 Jul 2008 04:48:42 +0100
Quoth Jeff <dreamgear@xxxxxxxxx>:
I used the XML::Simple module to read some xml, which works great.
But when I write it back out with XMLout.. it's changed.
For example the input that looks like this:
<Summary>
<TotalOrders>1</TotalOrders>
<TotalLineItems>4</TotalLineItems>
<TotalQuantity>158</TotalQuantity>
</Summary>
ends up looking like this:
<Summary TotalLineItems="4" TotalOrders="1" TotalQuantity="158" />
Is it possible to have it written out in the same format it was read
from?
See the NoAttr option.
Is there another module that would do this?
There are lots of other XML modules (XML::Parser, XML::LibXML, the
XML::SAX modules, XML::DOM, ...) but if XML::Simple does what you need
it's probably better to stick with what you have. If your XML really is
always going to be as simple as you say you could try XML::Tiny, but
make sure you carefully read the list of what it does and doesn't
support.
Ben
--
Outside of a dog, a book is a man's best friend.
Inside of a dog, it's too dark to read.
ben@xxxxxxxxxxxx Groucho Marx
.
- Follow-Ups:
- Re: questions on XML::Simple
- From: xhoster
- Re: questions on XML::Simple
- References:
- questions on XML::Simple
- From: Jeff
- questions on XML::Simple
- Prev by Date: Re: what is the expression mean?
- Next by Date: Logging with Log::StdLog from within a package
- Previous by thread: questions on XML::Simple
- Next by thread: Re: questions on XML::Simple
- Index(es):