Posted 12 years ago by Charles Mussely
Version: 4.0.0273
Avatar
ok I have a xmleditor and part of my xmleditor.document.text is the following:
<DataInfo>
     <Properties>
         <Frequency type="1" value="2" />
         <Frequency type="Monitoring" value="8" />
     </Properties>
     <Properties>
         <Frequency type="3" value="2" />
             <Frequency type="Monitoring" value="1" />
     </Properties>
<DataInfo>
My carret position is located inside the <Frequency type="Monitoring" value="1" /> node.

How can I retrieve the xmlnode which is equal to the node where my caret is located?
Is there a way to get the xpath or some equivalent information allowing to search my xml?

expected end result: xmlnode.outerxml=<Frequency type="Monitoring" value="1" />

Comments (1)

Posted 12 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Charles,

Sorry but XmlNode information isn't directly available. However if you look at the context.TargetElement.ElementNameOffset, you know where the name of the element starts. Then you can get a TextStream at that offset and scan forward until you reach the end of the tag. That way you know the range of the tag and can construct such a node yourself.

There isn't any integrated xpath support at this time.


Actipro Software Support

The latest build of this product (v2018.1 build 0341) was released 10 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.