0

I have a text file "document.xml" that is an XML Document. Now I need the start and end position of an XmlElement in the related XML Document file. I want the start position and the length of the XmlElement's OuterXml within the plain text of the raw document.

Background: In my program i want to show an xml configuration file within an RichTextBox. For better navigation I visualize the Document Element structure in an additional TreeView Control. If the user select a note in the TreeView I want to highlight the XmlCode (OuterXml) of the selected XmlElement in the RichTextBox.

How can I do this?

rittergig
  • 715
  • 1
  • 5
  • 16
  • see following recursive solution. Have recommended this solution a lot of times : http://stackoverflow.com/questions/28976601/recursion-parsing-xml-file-with-attributes-into-treeview-c-sharp – jdweng Aug 28 '16 at 16:29
  • @jdweng: that is not the point. I already have my treeview filled. I need the text position (index) of the XmlNode within the xml test document file. – rittergig Aug 29 '16 at 08:15

0 Answers0