<?xml version="1.0" encoding="UTF-8"?> <req:TrackingResponse xmlns:req="http://someurl" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://someurl TrackingResponse.xsd">
<AWBInfo> <AWBNumber>1234567895</AWBNumber> <Status> <ActionStatus>success</ActionStatus> </Status> <ShipmentInfo> <OriginServiceArea/> <DestinationServiceArea/> <ShipperName/> <ConsigneeName/> <ShipmentDate/> <DlvyNotificationFlag>N</DlvyNotificationFlag> <ShipmentEvent> <Date>2015-02-19</Date> <Time>15:21:00</Time> <ServiceEvent> <EventCode>CC</EventCode> <Description>Awaiting collection by recipient as requested</Description> </ServiceEvent> <Signatory/> <ServiceArea> <ServiceAreaCode>MAD</ServiceAreaCode> <Description>MADRID - SPAIN</Description> </ServiceArea> </ShipmentEvent> <ShipmentEvent> <Date>2015-02-19</Date> <Time>15:26:00</Time> <ServiceEvent> <EventCode>OK</EventCode> <Description>Delivered - Signed for by</Description> </ServiceEvent> <Signatory>MANUEL</Signatory> <ServiceArea> <ServiceAreaCode>MAD</ServiceAreaCode> <Description>MADRID - SPAIN</Description> </ServiceArea> </ShipmentEvent> </ShipmentInfo> </AWBInfo>
SelectNodes
XmlNodeList nodes = xmlDoc.SelectNodes("req:TrackingResponse/AWBInfo/ShipmentInfo/ShipmentEvent/Date", namespaceManager); XmlNode shipmenteventdate = nodes.Item(nodes.Count - 1);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)