Click to See Complete Forum and Search --> : XML Simple - having an attribute in XML also using NoAttr


crmpicco
02-06-2009, 12:17 PM
use XML::Simple;
use Unicode::String;
$xml = new XML::Simple(NoAttr => 1, RootName => "stadiums");

$out = qq|<?xml version="1.0" encoding="utf-8"?>\n|;
$unicodestring = new Unicode::String;
$out .= $unicodestring->utf8($xml->XMLout($response));


My current structure:

<stadiums>
<request>
<time>2009-02-06 16:25:08</time>
<type>search</type>
</request>
<response>
<result>
<name>Ibrox Stadium, Glasgow</name>
<airport>GLA</airport>
......



What I would like:

<stadiums>
<request>
<time>2009-02-06 16:25:08</time>
<type>search</type>
</request>
<response>
<result fivestar="true" capacity="51000">
<name>Ibrox Stadium, Glasgow</name>
<airport>GLA</airport>
......



Is it possible to make this change to the XML I am outputting, still using NoAttr with XML::Simple as I want the XML in this format?

Thanks.