org.sixdml.excelon
Class xlnSixdmlUpdateService

java.lang.Object
  |
  +--org.sixdml.excelon.xlnServiceBase
        |
        +--org.sixdml.excelon.xlnNamespaceAwareService
              |
              +--org.sixdml.excelon.xlnSixdmlUpdateService
All Implemented Interfaces:
Configurable, Service, SixdmlConstants, SixdmlUpdateService

public class xlnSixdmlUpdateService
extends xlnNamespaceAwareService
implements SixdmlUpdateService, SixdmlConstants

  
 xlnSixdmlUpdateService.java

 Used to update nodes in collections or documents via  XPath queries.

 Created: Wed Jan 16 22:15:46 2002

 

Version:
1.0
Author:
Dare Obasanjo

Field Summary
private  com.exln.dxe.Session session
          A session provides the context in which an application can access XMLStores.
 
Fields inherited from class org.sixdml.excelon.xlnNamespaceAwareService
 
Fields inherited from class org.sixdml.excelon.xlnServiceBase
collection, properties
 
Fields inherited from interface org.sixdml.SixdmlConstants
SIXDML_NS, SIXDML_VERSION
 
Constructor Summary
(package private) xlnSixdmlUpdateService(com.exln.dxe.Session session)
          Default constructor initializes service.
 
Method Summary
 void delete(String query, org.sixdml.SixdmlCollection collection)
          Deletes all nodes that match the expression from the target document.
 void delete(String query, org.sixdml.SixdmlResource resource)
          Deletes all nodes that match the expression from the target document.
 String getName()
          Gets the name of the service.
 void insertAttribute(String query, org.sixdml.SixdmlCollection collection, String name, String value)
          Inserts an attribute node as a child of each of the nodes returned from the XPath query.
 void insertAttribute(String query, org.sixdml.SixdmlCollection collection, String name, String value, URI namespaceURI)
          Inserts an attribute node as a child of each of the nodes returned from the XPath query.
 void insertAttribute(String query, org.sixdml.SixdmlResource resource, String name, String value)
          Inserts an attribute node as a child of each of the nodes returned from the XPath query.
 void insertAttribute(String query, org.sixdml.SixdmlResource resource, String name, String value, URI namespaceURI)
          Inserts an attribute node as a child of each of the nodes returned from the XPath query.
 void insertChild(String query, NodeList nodes, org.sixdml.SixdmlCollection collection)
          Inserts a node as a child of each of the nodes returned from the XPath query.
 void insertChild(String query, NodeList nodes, org.sixdml.SixdmlResource resource)
          Inserts a node as a child of each of the nodes returned from the XPath query.
 void insertChild(String query, String fragment, org.sixdml.SixdmlCollection collection)
          Inserts an XML fragment as a child of each of the nodes returned from the XPath query.
 void insertChild(String query, String fragment, org.sixdml.SixdmlResource resource)
          Inserts an XML fragment as a child of each of the nodes returned from the XPath query.
 void insertChild(com.exln.dxe.XPath xpath, NodeList nodes, org.sixdml.SixdmlResource resource)
          Inserts a node as a child of each of the nodes returned from the XPath query.
 void insertSibling(String query, NodeList nodes, org.sixdml.SixdmlCollection collection, boolean before)
          Inserts a node as a sibling of each of the nodes returned from the XPath query.
 void insertSibling(String query, NodeList nodes, org.sixdml.SixdmlResource resource, boolean before)
          Inserts a node as a sibling of each of the nodes returned from the XPath query.
 void insertSibling(String query, String fragment, org.sixdml.SixdmlCollection collection, boolean before)
          Inserts an XML fragment as a sibling of each of the nodes returned from the XPath query.
 void insertSibling(String query, String fragment, org.sixdml.SixdmlResource resource, boolean before)
          Inserts an XML fragment as a sibling of each of the nodes returned from the XPath query.
private  void insertSibling(com.exln.dxe.XPath xpath, NodeList nodes, org.sixdml.SixdmlResource resource, boolean before)
          Inserts a node as a sibling of each of the nodes returned from the XPath query.
private static boolean isNodeOfType(short type, short[] nodetypes)
          Helper method that tests if a node is of a specific type.
(package private) static NodeList loadIntoNodeList(String xmlString)
          Creates a DOM node list from an XML fragment.
 void rename(String query, String name, URI namespaceURI, org.sixdml.SixdmlCollection collection)
          Renames one or more attribute or element nodes.
 void rename(String query, String name, URI namespaceURI, org.sixdml.SixdmlResource resource)
          Renames one or more attribute or element nodes.
 void replace(String query, NodeList nodes, org.sixdml.SixdmlCollection collection)
          Replaces one or more element, processing-instruction, comment, or text nodes with the new node.
 void replace(String query, NodeList nodes, org.sixdml.SixdmlResource resource)
          Replaces one or more element, processing-instruction, comment, or text nodes with the new node.
 void replace(String query, String fragment, org.sixdml.SixdmlCollection collection)
          Replaces one or more element, processing-instruction, comment, or text nodes with the new node.
 void replace(String query, String fragment, org.sixdml.SixdmlResource resource)
          Replaces one or more element, processing-instruction, comment, or text nodes with the new node.
 
Methods inherited from class org.sixdml.excelon.xlnNamespaceAwareService
addNamespaceMapping, clearNamespaceMappings, getNamespaceMapping, removeNamespaceMapping, setNamespaceMap
 
Methods inherited from class org.sixdml.excelon.xlnServiceBase
getProperty, getVersion, setCollection, setProperty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.sixdml.update.SixdmlUpdateService
addNamespaceMapping, clearNamespaceMappings, getNamespaceMapping, removeNamespaceMapping, setNamespaceMap
 
Methods inherited from interface org.xmldb.api.base.Service
getVersion, setCollection
 
Methods inherited from interface org.xmldb.api.base.Configurable
getProperty, setProperty
 

Field Detail

session

private com.exln.dxe.Session session
A session provides the context in which an application can access XMLStores. An application needs a session to do anything with DXE

Constructor Detail

xlnSixdmlUpdateService

xlnSixdmlUpdateService(com.exln.dxe.Session session)
Default constructor initializes service.

Parameters:
session - the DXE session associated with the class.
Method Detail

getName

public String getName()
Gets the name of the service.

Specified by:
getName in interface Service
Specified by:
getName in class xlnServiceBase
Returns:
the name of the service.

isNodeOfType

private static boolean isNodeOfType(short type,
                                    short[] nodetypes)
Helper method that tests if a node is of a specific type.

Parameters:
type - the type of the node we are testing.
nodetypes - the array of nodes types we are interested in testing if this node is a member of.
Returns:
true if the node type is in the list of approved node types.

loadIntoNodeList

static NodeList loadIntoNodeList(String xmlString)
                          throws NonWellFormedXMLException
Creates a DOM node list from an XML fragment.

Parameters:
xmlString - the XML fragment.
Returns:
the DOM nodelist.
Throws:
NonWellFormedXMLException - if the XML fragment is not a valid XML fragment.

insertSibling

public void insertSibling(String query,
                          String fragment,
                          org.sixdml.SixdmlResource resource,
                          boolean before)
                   throws XMLDBException,
                          InvalidQueryException,
                          NonWellFormedXMLException,
                          UpdateTypeMismatchException
Inserts an XML fragment as a sibling of each of the nodes returned from the XPath query. A boolean flag indicates whether the new node will be inserted before or after the selected nodes.

Specified by:
insertSibling in interface SixdmlUpdateService
Parameters:
query - The query which selects the nodes to update
fragment - The XML fragment to insert
resource - the document to perform the update against
before - if this is true then the new node wil be inserted before each of the selected node while if it is false the new node will be inserted after the selected nodes in the tree.
Throws:
XMLDBException - if a database error occurs during the insertion.
InvalidQueryException - if the XPath query is invalid.
UpdateTypeMismatchException - if the target node is the document root and an attempt is made to insert anything besides comments or processing instructions.
NonWellFormedXMLException - if the XML fragment is not a valid XML fragment.

insertChild

public void insertChild(String query,
                        String fragment,
                        org.sixdml.SixdmlResource resource)
                 throws XMLDBException,
                        InvalidQueryException,
                        NonWellFormedXMLException,
                        UpdateTypeMismatchException
Inserts an XML fragment as a child of each of the nodes returned from the XPath query. A boolean flag indicates whether the new node will be inserted before or after the selected nodes. The new node is appended to the end of the current children of the selected node.

Specified by:
insertChild in interface SixdmlUpdateService
Parameters:
query - The query which selects the nodes to update
fragment - The XML fragment to insert
resource - the document to perform the update against
Throws:
XMLDBException - if a database error occurs during the insertion.
InvalidQueryException - if the XPath query is invalid.
UpdateTypeMismatchException - if the target node is not an element node, document node or set of element nodes.
NonWellFormedXMLException - if the XML fragment is not a valid XML fragment.

insertSibling

public void insertSibling(String query,
                          NodeList nodes,
                          org.sixdml.SixdmlResource resource,
                          boolean before)
                   throws XMLDBException,
                          InvalidQueryException,
                          UpdateTypeMismatchException
Inserts a node as a sibling of each of the nodes returned from the XPath query. A boolean flag indicates whether the new node will be inserted before or after the selected nodes.

Specified by:
insertSibling in interface SixdmlUpdateService
Parameters:
query - The query which selects the nodes to update
nodes - The DOM node(s) to insert
resource - the document to perform the update against
before - if this is true then the new node wil be inserted before each of the selcted node while if it is false the new node will be inserted after the selected nodes in the tree.
Throws:
XMLDBException - if a database error occurs during the insertion.
InvalidQueryException - if the XPath query is invalid.
UpdateTypeMismatchException - if the target node is the document root and an attempt is made to insert anything besides comments or processing instructions.
See Also:
ErrorMessages.NODES_NOT_RETURNED, ErrorMessages.BAD_UPDATE_ATTEMPT

insertSibling

private void insertSibling(com.exln.dxe.XPath xpath,
                           NodeList nodes,
                           org.sixdml.SixdmlResource resource,
                           boolean before)
                    throws XMLDBException,
                           UpdateTypeMismatchException
Inserts a node as a sibling of each of the nodes returned from the XPath query. A boolean flag indicates whether the new node will be inserted before or after the selected nodes.

Parameters:
xpath - The eXcelon DXE XPath object which contains the query which selects the nodes to update
nodes - The DOM node(s) to insert
resource - the document to perform the update against
before - if this is true then the new node wil be inserted before each of the selcted node while if it is false the new node will be inserted after the selected nodes in the tree.
Throws:
XMLDBException - if a database error occurs during the insertion.
UpdateTypeMismatchException - if the target node is the document root and an attempt is made to insert anything besides comments or processing instructions.
See Also:
ErrorMessages.NODES_NOT_RETURNED, ErrorMessages.MULTIPLE_ROOT_ELEMENTS

insertChild

public void insertChild(String query,
                        NodeList nodes,
                        org.sixdml.SixdmlResource resource)
                 throws XMLDBException,
                        InvalidQueryException,
                        UpdateTypeMismatchException
Inserts a node as a child of each of the nodes returned from the XPath query. A boolean flag indicates whether the new node will be inserted before or after the selected nodes. The new node is appended to the end of the current children of the selected node.

Specified by:
insertChild in interface SixdmlUpdateService
Parameters:
query - The query which selects the nodes to update
nodes - The DOM node(s) to insert
resource - the document to perform the update against
Throws:
XMLDBException - if a database error occurs during the insertion.
InvalidQueryException - if the XPath query is invalid.
UpdateTypeMismatchException - if the target node is not an element node, document node or set of element nodes.
See Also:
ErrorMessages.NODES_NOT_RETURNED, ErrorMessages.BAD_UPDATE_ATTEMPT

insertChild

public void insertChild(com.exln.dxe.XPath xpath,
                        NodeList nodes,
                        org.sixdml.SixdmlResource resource)
                 throws XMLDBException,
                        UpdateTypeMismatchException
Inserts a node as a child of each of the nodes returned from the XPath query. A boolean flag indicates whether the new node will be inserted before or after the selected nodes. The new node is appended to the end of the current children of the selected node.

Parameters:
xpath - The eXcelon DXE XPath object which contains the query which selects the nodes to update
nodes - The DOM node(s) to insert
resource - the document to perform the update against
Throws:
XMLDBException - if a database error occurs during the insertion.
UpdateTypeMismatchException - if the target node is not an element node, document node or set of element nodes.
See Also:
ErrorMessages.NODES_NOT_RETURNED, ErrorMessages.BAD_UPDATE_ATTEMPT

insertAttribute

public void insertAttribute(String query,
                            org.sixdml.SixdmlResource resource,
                            String name,
                            String value)
                     throws XMLDBException,
                            InvalidQueryException,
                            UpdateTypeMismatchException
Inserts an attribute node as a child of each of the nodes returned from the XPath query.

Specified by:
insertAttribute in interface SixdmlUpdateService
Parameters:
query - The query which selects the nodes to update
resource - the document to perform the update against
name - The name of the attribute to insert.
value - the value of the attribute to insert.
Throws:
XMLDBException - if a database error occurs during the insertion.
InvalidQueryException - if the XPath query is invalid.
UpdateTypeMismatchException - if the target node is not an element node or set of element nodes.
See Also:
ErrorMessages.NODES_NOT_RETURNED, ErrorMessages.BAD_UPDATE_ATTEMPT

insertAttribute

public void insertAttribute(String query,
                            org.sixdml.SixdmlResource resource,
                            String name,
                            String value,
                            URI namespaceURI)
                     throws XMLDBException,
                            InvalidQueryException,
                            UpdateTypeMismatchException
Inserts an attribute node as a child of each of the nodes returned from the XPath query.

Specified by:
insertAttribute in interface SixdmlUpdateService
Parameters:
query - The query which selects the nodes to update
resource - the document to perform the update against
name - The name of the attribute to insert. It should be an XML qualified name.
value - the value of the attribute to insert.
namespaceURI - the namsepace URI for the attribute node. If this is null then this operation is the same as inserting an attribute without a namespace.
Throws:
XMLDBException - if a database error occurs during the insertion.
InvalidQueryException - if the XPath query is invalid.
UpdateTypeMismatchException - if the target node is not an element node or set of element nodes.
See Also:
ErrorMessages.NODES_NOT_RETURNED, ErrorMessages.BAD_UPDATE_ATTEMPT

delete

public void delete(String query,
                   org.sixdml.SixdmlResource resource)
            throws XMLDBException,
                   InvalidQueryException
Deletes all nodes that match the expression from the target document.

Specified by:
delete in interface SixdmlUpdateService
Parameters:
query - The query which selects the nodes to delete.
resource - the document to perform the update against
Throws:
XMLDBException - if a database error occurs during the insertion.
InvalidQueryException - if the XPath query is invalid.

replace

public void replace(String query,
                    String fragment,
                    org.sixdml.SixdmlResource resource)
             throws XMLDBException,
                    InvalidQueryException,
                    NonWellFormedXMLException,
                    UpdateTypeMismatchException
Replaces one or more element, processing-instruction, comment, or text nodes with the new node.

Specified by:
replace in interface SixdmlUpdateService
Parameters:
query - The query which selects the nodes to update
fragment - the XML fragment to insert.
resource - the document to perform the update against
Throws:
XMLDBException - if a database error occurs during the insertion.
InvalidQueryException - if the XPath query is invalid.
UpdateTypeMismatchException - if the target node is not one or more comment, text, processing-instruction, or element nodes.
NonWellFormedXMLException - if the XML fragment is not a valid XML fragment.
See Also:
ErrorMessages.NODES_NOT_RETURNED, ErrorMessages.BAD_UPDATE_ATTEMPT, ErrorMessages.MULTIPLE_ROOT_ELEMENTS, ErrorMessages.CANT_REPLACE_ATTRIBUTE

replace

public void replace(String query,
                    NodeList nodes,
                    org.sixdml.SixdmlResource resource)
             throws XMLDBException,
                    InvalidQueryException,
                    UpdateTypeMismatchException
Replaces one or more element, processing-instruction, comment, or text nodes with the new node.

Specified by:
replace in interface SixdmlUpdateService
Parameters:
query - The query which selects the nodes to update
nodes - The DOM node(s) to insert
resource - the document to perform the update against
Throws:
XMLDBException - if a database error occurs during the insertion.
InvalidQueryException - if the XPath query is invalid.
UpdateTypeMismatchException - if the target node is not one or more comment, text, processing-instruction, or element nodes.
See Also:
ErrorMessages.NODES_NOT_RETURNED, ErrorMessages.BAD_UPDATE_ATTEMPT, ErrorMessages.MULTIPLE_ROOT_ELEMENTS, ErrorMessages.CANT_REPLACE_ATTRIBUTE

rename

public void rename(String query,
                   String name,
                   URI namespaceURI,
                   org.sixdml.SixdmlResource resource)
            throws XMLDBException,
                   InvalidQueryException,
                   UpdateTypeMismatchException
Renames one or more attribute or element nodes.

Specified by:
rename in interface SixdmlUpdateService
Parameters:
query - The query which selects the nodes to update
name - The new name. It can be a qualified name.
namespaceURI - the namespace URI for the element being inserted. If it is null then it is assumed the new item has no namespace URI.
resource - the document to perform the update against
Throws:
XMLDBException - if a database error occurs during the insertion.
InvalidQueryException - if the XPath query is invalid.
UpdateTypeMismatchException - if the target node is not one or more attribute or element nodes.
See Also:
ErrorMessages.NODES_NOT_RETURNED, ErrorMessages.RENAME_ERROR

insertSibling

public void insertSibling(String query,
                          String fragment,
                          org.sixdml.SixdmlCollection collection,
                          boolean before)
                   throws XMLDBException,
                          InvalidQueryException,
                          NonWellFormedXMLException,
                          UpdateTypeMismatchException
Inserts an XML fragment as a sibling of each of the nodes returned from the XPath query. A boolean flag indicates whether the new node will be inserted before or after the selected nodes.

Specified by:
insertSibling in interface SixdmlUpdateService
Parameters:
query - The query which selects the nodes to update
fragment - The XML fragment to insert
collection - the collection whose documents to perform the update against
before - if this is true then the new node wil be inserted before each of the selected node while if it is false the new node will be inserted after the selected nodes in the tree.
Throws:
XMLDBException - if a database error occurs during the insertion.
InvalidQueryException - if the XPath query is invalid.
UpdateTypeMismatchException - if the target node is the document root and an attempt is made to insert anything besides comments or processing instructions.
NonWellFormedXMLException - if the XML fragment is not a valid XML fragment.

insertChild

public void insertChild(String query,
                        String fragment,
                        org.sixdml.SixdmlCollection collection)
                 throws XMLDBException,
                        InvalidQueryException,
                        NonWellFormedXMLException,
                        UpdateTypeMismatchException
Inserts an XML fragment as a child of each of the nodes returned from the XPath query. A boolean flag indicates whether the new node will be inserted before or after the selected nodes. The new node is appended to the end of the current children of the selected node.

Specified by:
insertChild in interface SixdmlUpdateService
Parameters:
query - The query which selects the nodes to update
fragment - The XML fragment to insert
collection - the collection whose documents to perform the update against
Throws:
XMLDBException - if a database error occurs during the insertion.
InvalidQueryException - if the XPath query is invalid.
UpdateTypeMismatchException - if the target node is not an element node, document node or set of element nodes.
NonWellFormedXMLException - if the XML fragment is not a valid XML fragment.

insertSibling

public void insertSibling(String query,
                          NodeList nodes,
                          org.sixdml.SixdmlCollection collection,
                          boolean before)
                   throws XMLDBException,
                          InvalidQueryException,
                          UpdateTypeMismatchException
Inserts a node as a sibling of each of the nodes returned from the XPath query. A boolean flag indicates whether the new node will be inserted before or after the selected nodes.

Specified by:
insertSibling in interface SixdmlUpdateService
Parameters:
query - The query which selects the nodes to update
nodes - The DOM node(s) to insert
collection - the collection whose documents to perform the update against
before - if this is true then the new node wil be inserted before each of the selcted node while if it is false the new node will be inserted after the selected nodes in the tree.
Throws:
XMLDBException - if a database error occurs during the insertion.
InvalidQueryException - if the XPath query is invalid.
UpdateTypeMismatchException - if the target node is the document root and an attempt is made to insert anything besides comments or processing instructions.

insertChild

public void insertChild(String query,
                        NodeList nodes,
                        org.sixdml.SixdmlCollection collection)
                 throws XMLDBException,
                        InvalidQueryException,
                        UpdateTypeMismatchException
Inserts a node as a child of each of the nodes returned from the XPath query. A boolean flag indicates whether the new node will be inserted before or after the selected nodes. The new node is appended to the end of the current children of the selected node.

Specified by:
insertChild in interface SixdmlUpdateService
Parameters:
query - The query which selects the nodes to update
nodes - The DOM node(s) to insert
collection - the collection whose documents to perform the update against
Throws:
XMLDBException - if a database error occurs during the insertion.
InvalidQueryException - if the XPath query is invalid.
UpdateTypeMismatchException - if the target node is not an element node, document node or set of element nodes.

insertAttribute

public void insertAttribute(String query,
                            org.sixdml.SixdmlCollection collection,
                            String name,
                            String value)
                     throws XMLDBException,
                            InvalidQueryException,
                            UpdateTypeMismatchException
Inserts an attribute node as a child of each of the nodes returned from the XPath query.

Specified by:
insertAttribute in interface SixdmlUpdateService
Parameters:
query - The query which selects the nodes to update
collection - the collection whose documents to perform the update against
name - The name of the attribute to insert.
value - the value of the attribute to insert.
Throws:
XMLDBException - if a database error occurs during the insertion.
InvalidQueryException - if the XPath query is invalid.
UpdateTypeMismatchException - if the target node is not an element node or set of element nodes.

insertAttribute

public void insertAttribute(String query,
                            org.sixdml.SixdmlCollection collection,
                            String name,
                            String value,
                            URI namespaceURI)
                     throws XMLDBException,
                            InvalidQueryException,
                            UpdateTypeMismatchException
Inserts an attribute node as a child of each of the nodes returned from the XPath query.

Specified by:
insertAttribute in interface SixdmlUpdateService
Parameters:
query - The query which selects the nodes to update
collection - the collection whose documents to perform the update against
name - The name of the attribute to insert. It should be an XML qualified name.
value - the value of the attribute to insert.
namespaceURI - the namsepace URI for the attribute node
Throws:
XMLDBException - if a database error occurs during the insertion.
InvalidQueryException - if the XPath query is invalid.
UpdateTypeMismatchException - if the target node is not an element node or set of element nodes.

delete

public void delete(String query,
                   org.sixdml.SixdmlCollection collection)
            throws XMLDBException,
                   InvalidQueryException
Deletes all nodes that match the expression from the target document.

Specified by:
delete in interface SixdmlUpdateService
Parameters:
query - The query which selects the nodes to delete.
collection - the collection whose documents to perform the update against
Throws:
InvalidQueryException - if the XPath query is invalid.
XMLDBException - if a database error occurs during the insertion.

replace

public void replace(String query,
                    String fragment,
                    org.sixdml.SixdmlCollection collection)
             throws XMLDBException,
                    InvalidQueryException,
                    NonWellFormedXMLException,
                    UpdateTypeMismatchException
Replaces one or more element, processing-instruction, comment, or text nodes with the new node.

Specified by:
replace in interface SixdmlUpdateService
Parameters:
query - The query which selects the nodes to update
fragment - the XML fragment to insert.
collection - the collection whose documents to perform the update against
Throws:
XMLDBException - if a database error occurs during the insertion.
InvalidQueryException - if the XPath query is invalid.
UpdateTypeMismatchException - if the target node is not one or more comment, text, processing-instruction, or element nodes.
NonWellFormedXMLException - if the XML fragment is not a valid XML fragment.
See Also:
ErrorMessages.NODES_NOT_RETURNED, ErrorMessages.BAD_UPDATE_ATTEMPT, ErrorMessages.MULTIPLE_ROOT_ELEMENTS, ErrorMessages.CANT_REPLACE_ATTRIBUTE

replace

public void replace(String query,
                    NodeList nodes,
                    org.sixdml.SixdmlCollection collection)
             throws XMLDBException,
                    InvalidQueryException,
                    UpdateTypeMismatchException
Replaces one or more element, processing-instruction, comment, or text nodes with the new node.

Specified by:
replace in interface SixdmlUpdateService
Parameters:
query - The query which selects the nodes to update
nodes - The DOM node(s) to insert
collection - the collection whose documents to perform the update against
Throws:
XMLDBException - if a database error occurs during the insertion.
InvalidQueryException - if the XPath query is invalid.
UpdateTypeMismatchException - if the target node is not one or more comment, text, processing-instruction, or element nodes.
See Also:
ErrorMessages.NODES_NOT_RETURNED, ErrorMessages.BAD_UPDATE_ATTEMPT, ErrorMessages.MULTIPLE_ROOT_ELEMENTS, ErrorMessages.CANT_REPLACE_ATTRIBUTE

rename

public void rename(String query,
                   String name,
                   URI namespaceURI,
                   org.sixdml.SixdmlCollection collection)
            throws XMLDBException,
                   InvalidQueryException,
                   UpdateTypeMismatchException
Renames one or more attribute or element nodes.

Specified by:
rename in interface SixdmlUpdateService
Parameters:
query - The query which selects the nodes to update
name - The new name
namespaceURI - the namespace URI for the element being inserted. If it is null then it is assumed the new item has no namespace URI.
collection - the collection whose documents to perform the update against
Throws:
XMLDBException - if a database error occurs during the insertion.
InvalidQueryException - if the XPath query is invalid.
UpdateTypeMismatchException - if the target node is not one or more comment, text, processing-instruction, or element nodes.