Oxygen XML Editor 14.2 Author API

ro.sync.exml.workspace.api.editor.page.text.xml
Interface WSXMLTextEditorPage

All Superinterfaces:
WSEditorPage, WSTextBasedEditorPage, WSTextEditorPage

@API(type=NOT_EXTENDABLE,
     src=PUBLIC)
public interface WSXMLTextEditorPage
extends WSTextEditorPage

Contains methods specific to XML editors.

Since:
14

*********************************
EXPERIMENTAL - Subject to change
********************************

Please note that this API is not marked as final and it can change in one of the next versions of the application. If you have suggestions, comments about it, please let us know.


Method Summary
 java.lang.Object[] evaluateXPath(java.lang.String xpathExpression)
          Evaluates an XPath expression.
 WSXMLTextNodeRange[] findElementsByXPath(java.lang.String xpathExpression)
          Finds the nodes selected by the given XPath expression.
 WSTextXMLSchemaManager getXMLSchemaManager()
          Get the schema manager used to ask useful information about allowed elements and the context of the current offset.
 
Methods inherited from interface ro.sync.exml.workspace.api.editor.page.text.WSTextEditorPage
addPopUpMenuCustomizer, beginCompoundUndoableEdit, endCompoundUndoableEdit, getActionsProvider, getColumnOfOffset, getDocument, getLineOfOffset, getOffsetOfLineEnd, getOffsetOfLineStart, getTextComponent, removePopUpMenuCustomizer
 
Methods inherited from interface ro.sync.exml.workspace.api.editor.page.WSTextBasedEditorPage
deleteSelection, getCaretOffset, getLocationOnScreenAsPoint, getLocationRelativeToEditorFromScreen, getSelectedText, getSelectionEnd, getSelectionStart, getStartEndOffsets, getWordAtCaret, hasSelection, isEditable, modelToViewRectangle, select, selectWord, setCaretPosition, setEditable, viewToModelOffset
 

Method Detail

findElementsByXPath

WSXMLTextNodeRange[] findElementsByXPath(java.lang.String xpathExpression)
                                         throws XPathException
Finds the nodes selected by the given XPath expression. The result of this function is an array of WSXMLTextNodeRange selected by the given XPath expression.
For example executing the expression:
//node()
will return an array with all the node ranges in the document.
But the result of calling the function with the expression:
count(//node())
will return an empty array.

Parameters:
xpathExpression - The XPath expression. If the XPath expression is relative, it will be computed in the context of the current caret position.
Returns:
The node ranges selected by the XPath expression. It does not return a null array of nodes. If the evaluation of the XPath expression fails it will return an empty array.
Throws:
XPathException - If the XPath expression failed to be evaluated.

evaluateXPath

java.lang.Object[] evaluateXPath(java.lang.String xpathExpression)
                                 throws XPathException
Evaluates an XPath expression. This function returns the result of the given XPath expression as an array of Object.
For example, executing the expression:
//node()
will return an array with all the DOM Nodes created over the XML structure.
while evaluating the expression:
count(//node())
will return an array having a single component representing the number of nodes in the document.
Evaluating the expression:
//node(), count(//node())
will return an array containing all DOM Nodes and having as last component the total number of nodes.

Parameters:
xpathExpression - The XPath expression. If the XPath expression is relative, it will be computed in the context of the current caret position.
Returns:
An array of objects representing the XPath result. It does not return a null array. If the XPath evaluation fails it will return an empty array.
Throws:
XPathException - If the XPath expression failed to be evaluated.

getXMLSchemaManager

WSTextXMLSchemaManager getXMLSchemaManager()
Get the schema manager used to ask useful information about allowed elements and the context of the current offset.

Specified by:
getXMLSchemaManager in interface WSTextEditorPage
Returns:
the XML Schema Manager used to ask useful information about allowed elements and the context of the current offset.

Oxygen XML Editor 14.2 Author API

© Copyright SyncRO Soft SRL 2002 - 2013. All rights reserved.