Re: questions on XML::Simple
- From: xhoster@xxxxxxxxx
- Date: 31 Jul 2008 16:49:46 GMT
Ben Morrow <ben@xxxxxxxxxxxx> wrote:
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.
Use ForceArray when doing XMLin. I think this would be better than
using NoAttr on XMLout. With ForceArray things that were attributes on the
way in are still attributes on the way out, while tags on the way in are
tags on the way out--rather than turning everything into tags.
Xho
--
-------------------- http://NewsReader.Com/ --------------------
The costs of publication of this article were defrayed in part by the
payment of page charges. This article must therefore be hereby marked
advertisement in accordance with 18 U.S.C. Section 1734 solely to indicate
this fact.
.
- References:
- questions on XML::Simple
- From: Jeff
- Re: questions on XML::Simple
- From: Ben Morrow
- questions on XML::Simple
- Prev by Date: Re: Extracting bits out of huge numbers
- Next by Date: Re: FAQ 4.2 Why is int() broken?
- Previous by thread: Re: questions on XML::Simple
- Next by thread: Logging with Log::StdLog from within a package
- Index(es):