1

I have an XML document which I have loaded in to a WPF TreeView (thanks to http://blogs.intuidev.com/post/2009/12/28/XML_To_TreeView.aspx ) in a .Net4 windows app. what I would like to do is when a user selects a node is to display the xpath to the selection.

How would I do this?

Alternatively I have the xml also in a textbox would it be possible to show the xpath of selected text in the textbox?

Adrian
  • 1,089
  • 24
  • 51

1 Answers1

1

Given an XML element, one can build an XPath expression that selects exactly that element.

See this XSLT 1.0 solution:

Generate/get xpath from XML node java

Community
  • 1
  • 1
Dimitre Novatchev
  • 240,661
  • 26
  • 293
  • 431