Meidan Alon
Meidan Alon

Reputation: 3094

namespaces and specific xpath

Can anyone tell me how can I get the xpath of the name attribute from this file:

<asmv1:assembly xmlns:asmv1="urn:schemas-microsoft-com:asm.v1">
  <assemblyIdentity name="MyName"/>
</asmv1:assembly>

I'm trying to get it for nant xmlpoke task without success.

Thanks.

Upvotes: 2

Views: 462

Answers (2)

Jeff Yates
Jeff Yates

Reputation: 62367

This should do the trick:

//asmv1:assembly/asmv1:assemblyIdentity/@name

Upvotes: 4

joegtp
joegtp

Reputation: 736

Try this XPath

/*[local-name()='assembly']/assemblyIdentity/@name

Upvotes: 1

Related Questions