XML解析问题,请教大家
我想拿到<d2p1:ArrTruckNbr>粤BAR111</d2p1:ArrTruckNbr> 这个节点,但是我用dom4j的rootElement.element(“d2p1:ArrTruckNbr”)拿不到这个节点,请问怎么写。
<?xml version="1.0" encoding="utf-8"?>
<d2p1:GContainerInfo xmlns:d2p1="http://schemas.datacontract.org/2004/07/Itlead.EPort.Contract.DataContracts.IntergratedQuery">
<d2p1:Amount xmlns:i="http://www.w3.org/2001/XMLSchema-instance" i:nil="true"></d2p1:Amount>
<d2p1:ArrLocType>T</d2p1:ArrLocType>
<d2p1:ArrTruckNbr>粤BAR111</d2p1:ArrTruckNbr>
<d2p1:YardInfo xmlns:i="http://www.w3.org/2001/XMLSchema-instance" i:nil="true"></d2p1:YardInfo>
</d2p1:GContainerInfo>