xpath Expression - Select SiingleNode

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello Guys:

I am having a little difficulty picking up how to perform an XPATH to get a
single value for an XML file.

<ICSMXML xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Header>
<MsgDelivery>
<To>
<Credential>
<Domain>ICSMID</Domain>
<Identity>105</Identity>
</Credential>
</To>

What I want is the value of Identity from the above XML. For some reason:
I just can’t seem to get it. Would anyone be able to help?
 
Andy said:
Hello Guys:

I am having a little difficulty picking up how to perform an XPATH to get a
single value for an XML file.

<ICSMXML xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Header>
<MsgDelivery>
<To>
<Credential>
<Domain>ICSMID</Domain>
<Identity>105</Identity>
</Credential>
</To>

What I want is the value of Identity from the above XML. For some reason:
I just can’t seem to get it. Would anyone be able to help?

I think that should do it:

/ICSMXML/Header/MsgDelivery/To/Credential/Identity/text()

It should give you an XmlText node with a value of 105.

Also your xml file doesn't look complete. You are missing the
</MsgDelivery></Header></ICSMXML> tags at the end. I'm not sure if that
could cause problems though.

hth,
Max
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top