Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: XML::Simple::XMLout() renaming tags

by Aristotle (Chancellor)
on Oct 02, 2003 at 21:46 UTC ( [id://296103]=note: print w/replies, xml ) Need Help??


in reply to XML::Simple::XMLout() renaming tags

XML::Simple doesn't store any information on the input data; whichever things don't map to a representation in the Perl data structure will not be present if you use the same structure to create XML from. Since XMLin produces an anonymous array or hash, it has no way of storing the root element's name, so the same structure fed to XMLout will be rendered with a default root element name of opt.

For the id/name confusion, check the XML::Simple docs for the KeyAttr option.

You may be interested in reading Does your XML::Simple code pass the strict test? as well.

Makeshifts last the longest.

  • Comment on Re: XML::Simple::XMLout() renaming tags

Replies are listed 'Best First'.
Re: Re: XML::Simple::XMLout() renaming tags
by dextius (Monk) on Oct 03, 2003 at 19:59 UTC
    To modify the root element name...
    XMLout($structure, rootname => 'enter_rootname_here');
    cheers, dextius

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://296103]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (2)
As of 2024-04-20 04:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found