[Canberra-pm] Parsing an XML document using XML::Twig and using it on an Template [SEC=UNCLASSIFIED]

John.Hockaday at ga.gov.au John.Hockaday at ga.gov.au
Mon Mar 22 20:14:02 PDT 2010


Hi List,

I'm still caught.

For three days I have been trying to get the content of an XML element into a variable using XML::Twig. All the tutorials and examples don't show how to do this.  All I want to do is:

 my ($uuid);
 my ($input) = 'bob.xml';
 my ($t) = new XML::Twig(twig_roots => {'gmd:fileIdentifier/gco:CharacterString' => '1'},);


 $uuid = $t->parsefile($input);

 print "uuid = ", $uuid, "\n";


All this gives me is:

 print out to STD of the content that I want and
 "uuid = XML::Twig=HASH(0x67d2e8)"


Can anyone please tell me the simple way to get the content of an XML element into a variable?

Thanks.


John


More information about the Canberra-pm mailing list