Previous
Top
Next
XMLSpyDocumentEditor.CurrentSelection
See also
Declaration:
CurrentSelection
as
DocEditSelection
Description
The property provides access to the current selection in the Document Editor view.
The example code below retrieves the complete text of the current selection:
JavaScript:
// somewhere in your script:
GetSelection(objPlugIn.CurrentSelection);
// GetSelection() collects complete text selection
function
GetSelection(objSel)
{
var
strText = "";
var
objCurrent = objSel.Start;
while
(!objSel.End.IsSameNode(objCurrent))
{
objCurrent = objPlugIn.GetNextVisible(objCurrent);
strText += objCurrent.TextValue;
}
strText += objSel.End.TextValue.substring(0,objSel.EndTextPosition);
return
objSel.Start.TextValue.substr(objSel.StartTextPosition) + strText;
}
Previous
Top
Next
© 2002
Altova