Find node where the caret is

SyntaxEditor for Windows Forms Forum

Posted 14 years ago by Miha Markic - Righthand
Avatar
Hi,

I am editing an XML document and want to find the node where caret is.
In other words I'd like to get the node <SomeNode> when the caret is inside the node name.
FindNodeRecursive(Caret.Offset) will find SomeNode only if caret is positioned after the closing bracket.

Miha Markic Righthand .net consulting and software development

Comments (2)

Posted 14 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Miha,

Have you tried using the XmlSchemaResolver.GetContext method? That may help you more and gives you more info.


Actipro Software Support

Posted 14 years ago by Miha Markic - Righthand
Avatar
Excellent, I use GetContext() to get XmlContext and than FindNodeRecursive(XmlContext.InitializationTextRange.EndOffset+1) and voila, the proper node is selected.

Miha Markic Righthand .net consulting and software development

The latest build of this product (v24.1.1) was released 28 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.