Forum Discussion

fdlsmg-ladnsgamgdn1390's avatar
fdlsmg-ladnsgamgdn1390
Copper Contributor
Jun 10, 2019

XPath and name space

Hi everyone.

 

I am trying to get the <n1:Identifier> element from the XML below using xpath and xmlDoc.SelectNodes("\\Identifier") without luck. It seems that the "n1:" qualifier has to be incorporated but I cannot see how. Any suggestions?

 

Thanks

B.

 

<epcis:EPCISDocument creationDate="2019-06-10T16:23:07Z" schemaVersion="1.1" xmlns:epcis="urn:epcglobal:epcis:xsd:1" xmlns:gs1ushc="http://epcis.gs1us.org/hc/ns" xmlns:sbdh="http://www.unece.org/cefact/namespaces/StandardBusinessDocumentHeader">
<EPCISHeader>
<n1:StandardBusinessDocumentHeader xmlns:n1="http://www.unece.org/cefact/namespaces/StandardBusinessDocumentHeader">
<n1:HeaderVersion>1.0</n1:HeaderVersion>
<n1:Sender>
<n1:Identifier Authority="GLN">97823048243</n1:Identifier>
...

Resources