Get XPath to document node

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

Guest

Hi,

Is there an easy way to get an XPath expression (in string format) to an
arbitrary node in a XmlDocument.

E.g.:

string s = node.XpathToString().

s = "myRoot/foo[@bar='altova']/myChild/text()"

Regards Jesper.
 
Jesper said:
Is there an easy way to get an XPath expression (in string format) to an
arbitrary node in a XmlDocument.

E.g.:

string s = node.XpathToString().

s = "myRoot/foo[@bar='altova']/myChild/text()"

There is no method in the .NET framework to generate an XPath expression
from a node, you would have to write your own code to do that.
 

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