Pathologically Eclectic Rubbish Lister | |
PerlMonks |
Re: XML::XPath tricks and tipsby gmpassos (Priest) |
on Sep 02, 2004 at 16:03 UTC ( [id://387959]=note: print w/replies, xml ) | Need Help?? |
If you want to just access XML values you don't need to use XPath to find this informations. You can use it, but the XPath implementation in Perl (XML::XPath), in my opinion, is not very intuitive to use.
What you can do is to use some module that loads XML into a HASH tree, and access the values directly from the tree. You can take a look at XML::Simple (more popular) and XML::Smart (well, I'm the author of it, so I shouldn't say what is better). Well, the main idea of XML::Smart is to enable the use of XML by programmers without need to really know the XML format. Here's a simple example of how to do what you want:
Graciliano M. P.
In Section
Seekers of Perl Wisdom
|
|