Help with valid XPath?

G

Guest

Hello

I am trying to parse the following xml fragment in xml file:

<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
..
<probing privatePath="shared;deployed;v1compatibility" />
..
</assemblyBinding>
</runtime>
</configuration>

What I am interested in is <probing> element. The code I use is as follows:
Dim xml As New XML.XMLDocument
xml.Load("somefile.xml")
Dim nodes As System.Xml.XmlNodeList =
xml.SelectNodes("/configuration/runtime/assemblyBinding/probing")

The code returns 0 elements. But for path "/configuration/runtime" - it
works OK. Am I doing something wrong?
Thanks in advance.
 
G

Guest

Thanks I found the reason - had to add above given default_ns to the
namespaces manager. After that everything works ok.
 

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

Top