@API(type=INTERNAL, src=PUBLIC) public class XQueryUpdateOperation extends java.lang.Object implements AuthorOperation
declare namespace oxyxq = "http://www.oxygenxml.com/ns/xqu"; (: This variable will be linked to the selected nodes assuming that there are actually fully selected nodes. For example this selection will return null:{SEL_START}text{SEL_END} in para
but this will give two "p" elements: {SEL_END}text
text2
{SEL_END} If a multiple selection exists it will also be processed and forwarded. Again, only fully selected nodes will be passed. :) declare variable $oxyxq:selection external; (: We will process either the selection or the context node :) let $toProcess := if (empty($oxyxq:selection)) then (.) else ($oxyxq:selection) return if (not(empty($toProcess))) then ( (: Create the list :) let $ul := <ul> { for $sel in $toProcess return <li>{$sel}</li> } </ul> return ( (: Delete the processed nodes :) for $sel in $toProcess return delete node $sel, (: Inserts the constructed list :) insert node $ul before $toProcess[1] ) ) else ()
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ARGUMENT_SCRIPT
The script argument.
|
NAMESPACE_ARGUMENT, NAMESPACE_ARGUMENT_DESCRIPTOR, SCHEMA_AWARE_ARGUMENT, SCHEMA_AWARE_ARGUMENT_DESCRIPTOR
Constructor and Description |
---|
XQueryUpdateOperation()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
doOperation(AuthorAccess authorAccess,
ArgumentsMap args)
Perform the actual operation.
|
ArgumentDescriptor[] |
getArguments() |
java.lang.String |
getDescription() |
public static final java.lang.String ARGUMENT_SCRIPT
script
.public void doOperation(AuthorAccess authorAccess, ArgumentsMap args) throws AuthorOperationException
AuthorOperation
Workspace.getPlatform()
.
To get to the Workspace
you may use: AuthorAccess.getWorkspaceAccess()
.doOperation
in interface AuthorOperation
authorAccess
- The author access.
Provides access to specific informations and actions for
editor, document, workspace, tables, change tracking, utility a.s.o.args
- The map of arguments. All the arguments defined by method
AuthorOperation.getArguments()
must be present in the map of arguments.AuthorOperationException
- Thrown when the operation fails.AuthorOperation.doOperation(AuthorAccess, ArgumentsMap)
public ArgumentDescriptor[] getArguments()
getArguments
in interface AuthorOperation
ArgumentDescriptor
representing
the arguments this operation uses.AuthorOperation.getArguments()
public java.lang.String getDescription()
getDescription
in interface Extension
Extension.getDescription()
© Copyright SyncRO Soft SRL 2002 - 2016. All rights reserved.