org.sixdml.excelon
Class xlnSixdmlUpdateService

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

public class xlnSixdmlUpdateService
extends xlnNamespaceAwareService
implements org.sixdml.update.SixdmlUpdateService, org.sixdml.SixdmlConstants

  
 xlnSixdmlUpdateService.java

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

 Created: Wed Jan 16 22:15:46 2002

 


Fields inherited from class org.sixdml.excelon.xlnServiceBase
collection, properties
 
Fields inherited from interface org.sixdml.SixdmlConstants
SIXDML_NS, SIXDML_VERSION
 
Method Summary
 void delete(java.lang.String query, org.sixdml.SixdmlCollection collection)
          Deletes all nodes that match the expression from the target document.
 void delete(java.lang.String query, org.sixdml.SixdmlResource resource)
          Deletes all nodes that match the expression from the target document.
 java.lang.String getName()
          Gets the name of the service.
 void insertAttribute(java.lang.String query, org.sixdml.SixdmlCollection collection, java.lang.String name, java.lang.String value)
          Inserts an attribute node as a child of each of the nodes returned from the XPath query.
 void insertAttribute(java.lang.String query, org.sixdml.SixdmlCollection collection, java.lang.String name, java.lang.String value, java.net.URI namespaceURI)
          Inserts an attribute node as a child of each of the nodes returned from the XPath query.
 void insertAttribute(java.lang.String query, org.sixdml.SixdmlResource resource, java.lang.String name, java.lang.String value)
          Inserts an attribute node as a child of each of the nodes returned from the XPath query.
 void insertAttribute(java.lang.String query, org.sixdml.SixdmlResource resource, java.lang.String name, java.lang.String value, java.net.URI namespaceURI)
          Inserts an attribute node as a child of each of the nodes returned from the XPath query.
 void insertChild(java.lang.String query, org.w3c.dom.NodeList nodes, org.sixdml.SixdmlCollection collection)
          Inserts a node as a child of each of the nodes returned from the XPath query.
 void insertChild(java.lang.String query, org.w3c.dom.NodeList nodes, org.sixdml.SixdmlResource resource)
          Inserts a node as a child of each of the nodes returned from the XPath query.
 void insertChild(java.lang.String query, java.lang.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(java.lang.String query, java.lang.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, org.w3c.dom.NodeList nodes, org.sixdml.SixdmlResource resource)
          Inserts a node as a child of each of the nodes returned from the XPath query.
 void insertSibling(java.lang.String query, org.w3c.dom.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(java.lang.String query, org.w3c.dom.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(java.lang.String query, java.lang.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(java.lang.String query, java.lang.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.
 void rename(java.lang.String query, java.lang.String name, java.net.URI namespaceURI, org.sixdml.SixdmlCollection collection)
          Renames one or more attribute or element nodes.
 void rename(java.lang.String query, java.lang.String name, java.net.URI namespaceURI, org.sixdml.SixdmlResource resource)
          Renames one or more attribute or element nodes.
 void replace(java.lang.String query, org.w3c.dom.NodeList nodes, org.sixdml.SixdmlCollection collection)
          Replaces one or more element, processing-instruction, comment, or text nodes with the new node.
 void replace(java.lang.String query, org.w3c.dom.NodeList nodes, org.sixdml.SixdmlResource resource)
          Replaces one or more element, processing-instruction, comment, or text nodes with the new node.
 void replace(java.lang.String query, java.lang.String fragment, org.sixdml.SixdmlCollection collection)
          Replaces one or more element, processing-instruction, comment, or text nodes with the new node.
 void replace(java.lang.String query, java.lang.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, delete, delete, getNamespaceMapping, insertAttribute, insertAttribute, insertAttribute, insertAttribute, insertChild, insertChild, insertChild, insertChild, insertSibling, insertSibling, insertSibling, insertSibling, removeNamespaceMapping, rename, rename, replace, replace, replace, replace, setNamespaceMap
 
Methods inherited from interface org.xmldb.api.base.Service
getVersion, setCollection
 
Methods inherited from interface org.xmldb.api.base.Configurable
getProperty, setProperty
 

Method Detail

getName

public java.lang.String getName()
Gets the name of the service.
Specified by:
getName in interface org.xmldb.api.base.Service
Overrides:
getName in class xlnServiceBase
Returns:
the name of the service.

insertSibling

public void insertSibling(java.lang.String query,
                          java.lang.String fragment,
                          org.sixdml.SixdmlResource resource,
                          boolean before)
                   throws org.xmldb.api.base.XMLDBException,
                          org.sixdml.exceptions.InvalidQueryException,
                          org.sixdml.exceptions.NonWellFormedXMLException,
                          org.sixdml.exceptions.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.
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:
org.xmldb.api.base.XMLDBException - if a database error occurs during the insertion.
org.sixdml.exceptions.InvalidQueryException - if the XPath query is invalid.
org.sixdml.exceptions.UpdateTypeMismatchException - if the target node is the document root and an attempt is made to insert anything besides comments or processing instructions.
org.sixdml.exceptions.NonWellFormedXMLException - if the XML fragment is not a valid XML fragment.

insertChild

public void insertChild(java.lang.String query,
                        java.lang.String fragment,
                        org.sixdml.SixdmlResource resource)
                 throws org.xmldb.api.base.XMLDBException,
                        org.sixdml.exceptions.InvalidQueryException,
                        org.sixdml.exceptions.NonWellFormedXMLException,
                        org.sixdml.exceptions.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.
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:
org.xmldb.api.base.XMLDBException - if a database error occurs during the insertion.
org.sixdml.exceptions.InvalidQueryException - if the XPath query is invalid.
org.sixdml.exceptions.UpdateTypeMismatchException - if the target node is not an element node, document node or set of element nodes.
org.sixdml.exceptions.NonWellFormedXMLException - if the XML fragment is not a valid XML fragment.

insertSibling

public void insertSibling(java.lang.String query,
                          org.w3c.dom.NodeList nodes,
                          org.sixdml.SixdmlResource resource,
                          boolean before)
                   throws org.xmldb.api.base.XMLDBException,
                          org.sixdml.exceptions.InvalidQueryException,
                          org.sixdml.exceptions.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:
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:
org.xmldb.api.base.XMLDBException - if a database error occurs during the insertion.
org.sixdml.exceptions.InvalidQueryException - if the XPath query is invalid.
org.sixdml.exceptions.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

insertChild

public void insertChild(java.lang.String query,
                        org.w3c.dom.NodeList nodes,
                        org.sixdml.SixdmlResource resource)
                 throws org.xmldb.api.base.XMLDBException,
                        org.sixdml.exceptions.InvalidQueryException,
                        org.sixdml.exceptions.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:
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:
org.xmldb.api.base.XMLDBException - if a database error occurs during the insertion.
org.sixdml.exceptions.InvalidQueryException - if the XPath query is invalid.
org.sixdml.exceptions.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,
                        org.w3c.dom.NodeList nodes,
                        org.sixdml.SixdmlResource resource)
                 throws org.xmldb.api.base.XMLDBException,
                        org.sixdml.exceptions.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:
org.xmldb.api.base.XMLDBException - if a database error occurs during the insertion.
org.sixdml.exceptions.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(java.lang.String query,
                            org.sixdml.SixdmlResource resource,
                            java.lang.String name,
                            java.lang.String value)
                     throws org.xmldb.api.base.XMLDBException,
                            org.sixdml.exceptions.InvalidQueryException,
                            org.sixdml.exceptions.UpdateTypeMismatchException
Inserts an attribute node as a child of each of the nodes returned from the XPath query.
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:
org.xmldb.api.base.XMLDBException - if a database error occurs during the insertion.
org.sixdml.exceptions.InvalidQueryException - if the XPath query is invalid.
org.sixdml.exceptions.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(java.lang.String query,
                            org.sixdml.SixdmlResource resource,
                            java.lang.String name,
                            java.lang.String value,
                            java.net.URI namespaceURI)
                     throws org.xmldb.api.base.XMLDBException,
                            org.sixdml.exceptions.InvalidQueryException,
                            org.sixdml.exceptions.UpdateTypeMismatchException
Inserts an attribute node as a child of each of the nodes returned from the XPath query.
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.
prefix - the namespace prefix for the attribute node.
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:
org.xmldb.api.base.XMLDBException - if a database error occurs during the insertion.
org.sixdml.exceptions.InvalidQueryException - if the XPath query is invalid.
org.sixdml.exceptions.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(java.lang.String query,
                   org.sixdml.SixdmlResource resource)
            throws org.xmldb.api.base.XMLDBException,
                   org.sixdml.exceptions.InvalidQueryException
Deletes all nodes that match the expression from the target document.
Parameters:
query - The query which selects the nodes to delete.
resource - the document to perform the update against
Throws:
org.xmldb.api.base.XMLDBException - if a database error occurs during the insertion.
org.sixdml.exceptions.InvalidQueryException - if the XPath query is invalid.

replace

public void replace(java.lang.String query,
                    java.lang.String fragment,
                    org.sixdml.SixdmlResource resource)
             throws org.xmldb.api.base.XMLDBException,
                    org.sixdml.exceptions.InvalidQueryException,
                    org.sixdml.exceptions.NonWellFormedXMLException,
                    org.sixdml.exceptions.UpdateTypeMismatchException
Replaces one or more element, processing-instruction, comment, or text nodes with the new node.
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:
org.xmldb.api.base.XMLDBException - if a database error occurs during the insertion.
org.sixdml.exceptions.InvalidQueryException - if the XPath query is invalid.
org.sixdml.exceptions.UpdateTypeMismatchException - if the target node is not one or more comment, text, processing-instruction, or element nodes.
org.sixdml.exceptions.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(java.lang.String query,
                    org.w3c.dom.NodeList nodes,
                    org.sixdml.SixdmlResource resource)
             throws org.xmldb.api.base.XMLDBException,
                    org.sixdml.exceptions.InvalidQueryException,
                    org.sixdml.exceptions.UpdateTypeMismatchException
Replaces one or more element, processing-instruction, comment, or text nodes with the new node.
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:
org.xmldb.api.base.XMLDBException - if a database error occurs during the insertion.
org.sixdml.exceptions.InvalidQueryException - if the XPath query is invalid.
org.sixdml.exceptions.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(java.lang.String query,
                   java.lang.String name,
                   java.net.URI namespaceURI,
                   org.sixdml.SixdmlResource resource)
            throws org.xmldb.api.base.XMLDBException,
                   org.sixdml.exceptions.InvalidQueryException,
                   org.sixdml.exceptions.UpdateTypeMismatchException
Renames one or more attribute or element nodes.
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:
org.xmldb.api.base.XMLDBException - if a database error occurs during the insertion.
org.sixdml.exceptions.InvalidQueryException - if the XPath query is invalid.
org.sixdml.exceptions.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(java.lang.String query,
                          java.lang.String fragment,
                          org.sixdml.SixdmlCollection collection,
                          boolean before)
                   throws org.xmldb.api.base.XMLDBException,
                          org.sixdml.exceptions.InvalidQueryException,
                          org.sixdml.exceptions.NonWellFormedXMLException,
                          org.sixdml.exceptions.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.
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:
org.xmldb.api.base.XMLDBException - if a database error occurs during the insertion.
org.sixdml.exceptions.InvalidQueryException - if the XPath query is invalid.
org.sixdml.exceptions.UpdateTypeMismatchException - if the target node is the document root and an attempt is made to insert anything besides comments or processing instructions.
org.sixdml.exceptions.NonWellFormedXMLException - if the XML fragment is not a valid XML fragment.

insertChild

public void insertChild(java.lang.String query,
                        java.lang.String fragment,
                        org.sixdml.SixdmlCollection collection)
                 throws org.xmldb.api.base.XMLDBException,
                        org.sixdml.exceptions.InvalidQueryException,
                        org.sixdml.exceptions.NonWellFormedXMLException,
                        org.sixdml.exceptions.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.
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:
org.xmldb.api.base.XMLDBException - if a database error occurs during the insertion.
org.sixdml.exceptions.InvalidQueryException - if the XPath query is invalid.
org.sixdml.exceptions.UpdateTypeMismatchException - if the target node is not an element node, document node or set of element nodes.
org.sixdml.exceptions.NonWellFormedXMLException - if the XML fragment is not a valid XML fragment.

insertSibling

public void insertSibling(java.lang.String query,
                          org.w3c.dom.NodeList nodes,
                          org.sixdml.SixdmlCollection collection,
                          boolean before)
                   throws org.xmldb.api.base.XMLDBException,
                          org.sixdml.exceptions.InvalidQueryException,
                          org.sixdml.exceptions.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:
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:
org.xmldb.api.base.XMLDBException - if a database error occurs during the insertion.
org.sixdml.exceptions.InvalidQueryException - if the XPath query is invalid.
org.sixdml.exceptions.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(java.lang.String query,
                        org.w3c.dom.NodeList nodes,
                        org.sixdml.SixdmlCollection collection)
                 throws org.xmldb.api.base.XMLDBException,
                        org.sixdml.exceptions.InvalidQueryException,
                        org.sixdml.exceptions.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:
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:
org.xmldb.api.base.XMLDBException - if a database error occurs during the insertion.
org.sixdml.exceptions.InvalidQueryException - if the XPath query is invalid.
org.sixdml.exceptions.UpdateTypeMismatchException - if the target node is not an element node, document node or set of element nodes.

insertAttribute

public void insertAttribute(java.lang.String query,
                            org.sixdml.SixdmlCollection collection,
                            java.lang.String name,
                            java.lang.String value)
                     throws org.xmldb.api.base.XMLDBException,
                            org.sixdml.exceptions.InvalidQueryException,
                            org.sixdml.exceptions.UpdateTypeMismatchException
Inserts an attribute node as a child of each of the nodes returned from the XPath query.
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:
org.xmldb.api.base.XMLDBException - if a database error occurs during the insertion.
org.sixdml.exceptions.InvalidQueryException - if the XPath query is invalid.
org.sixdml.exceptions.UpdateTypeMismatchException - if the target node is not an element node or set of element nodes.

insertAttribute

public void insertAttribute(java.lang.String query,
                            org.sixdml.SixdmlCollection collection,
                            java.lang.String name,
                            java.lang.String value,
                            java.net.URI namespaceURI)
                     throws org.xmldb.api.base.XMLDBException,
                            org.sixdml.exceptions.InvalidQueryException,
                            org.sixdml.exceptions.UpdateTypeMismatchException
Inserts an attribute node as a child of each of the nodes returned from the XPath query.
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.
prefix - the namespace prefix for the attribute node.
namespaceURI - the namsepace URI for the attribute node
Throws:
org.xmldb.api.base.XMLDBException - if a database error occurs during the insertion.
org.sixdml.exceptions.InvalidQueryException - if the XPath query is invalid.
org.sixdml.exceptions.UpdateTypeMismatchException - if the target node is not an element node or set of element nodes.

delete

public void delete(java.lang.String query,
                   org.sixdml.SixdmlCollection collection)
            throws org.xmldb.api.base.XMLDBException,
                   org.sixdml.exceptions.InvalidQueryException
Deletes all nodes that match the expression from the target document.
Parameters:
query - The query which selects the nodes to delete.
collection - the collection whose documents to perform the update against

replace

public void replace(java.lang.String query,
                    java.lang.String fragment,
                    org.sixdml.SixdmlCollection collection)
             throws org.xmldb.api.base.XMLDBException,
                    org.sixdml.exceptions.InvalidQueryException,
                    org.sixdml.exceptions.NonWellFormedXMLException,
                    org.sixdml.exceptions.UpdateTypeMismatchException
Replaces one or more element, processing-instruction, comment, or text nodes with the new node.
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:
org.xmldb.api.base.XMLDBException - if a database error occurs during the insertion.
org.sixdml.exceptions.InvalidQueryException - if the XPath query is invalid.
org.sixdml.exceptions.UpdateTypeMismatchException - if the target node is not one or more comment, text, processing-instruction, or element nodes.
org.sixdml.exceptions.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(java.lang.String query,
                    org.w3c.dom.NodeList nodes,
                    org.sixdml.SixdmlCollection collection)
             throws org.xmldb.api.base.XMLDBException,
                    org.sixdml.exceptions.InvalidQueryException,
                    org.sixdml.exceptions.UpdateTypeMismatchException
Replaces one or more element, processing-instruction, comment, or text nodes with the new node.
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:
org.xmldb.api.base.XMLDBException - if a database error occurs during the insertion.
org.sixdml.exceptions.InvalidQueryException - if the XPath query is invalid.
org.sixdml.exceptions.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(java.lang.String query,
                   java.lang.String name,
                   java.net.URI namespaceURI,
                   org.sixdml.SixdmlCollection collection)
            throws org.xmldb.api.base.XMLDBException,
                   org.sixdml.exceptions.InvalidQueryException,
                   org.sixdml.exceptions.UpdateTypeMismatchException
Renames one or more attribute or element nodes.
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:
org.xmldb.api.base.XMLDBException - if a database error occurs during the insertion.
org.sixdml.exceptions.InvalidQueryException - if the XPath query is invalid.
org.sixdml.exceptions.UpdateTypeMismatchException - if the target node is not one or more comment, text, processing-instruction, or element nodes.