xmlContextChange event

This event fires when the cursor is moved to a different node.

var highlightNode;

Editor.addEventListener("xmlContextChange", function(evt)
{  
  if (highlightNode)
    highlightNode.unhighlight();

  highlightNode = evt.newNode;
  if (!highlightNode)
    return;

  if (highlightNode.getNodeType() == 2)
    highlightNode = highlightNode.getOwnerElement();
  else if (highlightNode.getNodeType() != 1)
    highlightNode = highlightNode.getParentNode();

  highlightNode.highlight();
});

xmlContextChange event

Properties

newNode
The node that was the result of a split node, or the node that received focus
oldNode
The node from which the cursor came.