Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Re: Re: XML package for parsing values in the opening tag.

by gmpassos (Priest)
on Apr 15, 2004 at 07:11 UTC ( [id://345329]=note: print w/replies, xml ) Need Help??


in reply to Re: Re: XML package for parsing values in the opening tag.
in thread XML package for parsing values in the opening tag.

This is because XML::Simple by default cut the root node, since on XML we only have one root tag. Also you typed _CITY, upercase, that is different of _City, since XML is case sensitive. So, you actually should use:
print $xml->{_City} ;

If you use XML::Smart it has an option to load a XML and parse all the nodes and attributes in upercase or lowercase:

use XML::Smart ; my $xml = XML::Smart->new(q`<USER _City="testboro"></USER>` , uperta +g=>1 , uperarg=>1); print $xml->dump_tree_ok ;
Output:
$VAR1 = { 'USER' => { '_CITY' => 'testboro' } };

Graciliano M. P.
"Creativity is the expression of the liberty".

Log In?
Username:
Password:

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

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

    No recent polls found