Just another Perl shrine | |
PerlMonks |
Re^2: Retrieving XML From a File Based On Child Node Attributeby the_r (Initiate) |
on Feb 14, 2017 at 19:07 UTC ( [id://1181985]=note: print w/replies, xml ) | Need Help?? |
Thanks for the reply. The reason I used regular expressions was that the actual XML is contained within a log file that contains other information besides xml. Will the XML:LibXML handle any type of file or does it strictly need a xml file? I tried the following using this script and am getting a parser error Start tag expected, '<' not found. Below is the code:
The sample xml file is as follows: <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <DeliveryTimeChanged CurrentStatus="OnHold" xmlns:ns2="http://com/post/orderupdatesasync/jaxbxml"> <EventInfo EventId="666313444" CreationDatetime="2017/02/09 07:59:17 369 GMT" RequestId="321150454"> <TopicCounts TopicName="DELIVERY.TIME.CHANGED" TopicCount="1"/> </EventInfo> <DeliveryChangeOperationType OperationTypeCode="DELAY" OperationSubtypeCode="HOLD" DeliveryChangeReason="Weather" DeliveryDate="20170210"/> </DeliveryTimeChanged> <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <DeliveryRouteChanged CurrentStatus="OnHold" xmlns:ns2="http://com/post/orderupdatesasync/jaxbxml"> <EventInfo EventId="666313445" CreationDatetime="2017/02/09 07:59:23 639 GMT" RequestId="321150454"> <TopicCounts TopicName="DELIVERY.ROUTE.CHANGED" TopicCount="1"/> </EventInfo> <DeliveryRouteType OperationTypeCode="AIR" OperationSubtypeCode="HOLD" DeliveryDate="20170210"/> </DeliveryRouteChanged> <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <DeliveryCanceled CurrentStatus="Canceled" xmlns:ns2="http://com/post/orderupdatesasync/jaxbxml"> <EventInfo EventId="666313446" CreationDatetime="2017/02/09 07:59:44 963 GMT" RequestId="421150444"> <TopicCounts TopicName="DELIVERY.STATUS.CANCELED" TopicCount="1"/> </EventInfo> <DeliveryStatusType DeliveryStatusCode="CX" OperationSubtypeCode="CANCELED" DeliveryDate="20170210"/> </DeliveryCanceled>
In Section
Seekers of Perl Wisdom
|
|