Karjala,
----- Original Message ----- From: "Karjala" <[EMAIL PROTECTED]>
To: <beginners@perl.org>
Cc: "Mike Blezien" <[EMAIL PROTECTED]>
Sent: Tuesday, June 26, 2007 9:56 AM
Subject: Re: XML Parsing


You could use XML::MyXML for this job (works well), if you know the exact position in the XML tree where <message> is located.

Say $xml holds your XML.

Then:

   use XML::MyXML qw(:all);

   $obj = &xml_to_object($xml)
$msg_obj = $obj->path('response/idalertresponse/candidateresults/candidateactivity/messaging/raiserisklevel/message');
   $message = $msg_obj->value();

   print $message;

can this handle multiple elements with the same name? IE. the path used above may have more then one <message></message> element within the <raiserisklevel><message> ... </message><message> ... </message> </raiserisklevel>

Mike
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to