org.sixdml.update
Interface SixdmlUpdateService

All Superinterfaces:
Configurable, Service
All Known Implementing Classes:
xiSixdmlUpdateService

public interface SixdmlUpdateService
extends Service

 SixdmlUpdateService.java

 This is a Service that enables the execution of updates within the context of a 
 Collection or against the documents stored in the Collection.

 Created: Fri Jan 11 11:55:20 2002
 

Version:
1.0
Author:
Dare Obasanjo

Method Summary
 void addNamespaceMapping(String prefix, String namespaceURI)
          Add a mapping between a given prefix and a namespace to the service's internal namespace map.
 void clearNamespaceMappings()
          Clear all namespace mappings in the service's internal namespace map.
 int delete(String query, SixdmlCollection collection)
          Deletes all nodes that match the expression from the target document.
 int delete(String query, SixdmlResource resource)
          Deletes all nodes that match the expression from the target document.
 int delete(String query, String predicate, SixdmlCollection collection)
          Deletes all nodes that match the expression from the target document.
 String getNamespaceMapping(String prefix)
          Obtain the namespace URI mapped to a particular prefix.
 int insertAttribute(String query, SixdmlCollection collection, String name, String value)
          Inserts an attribute node as a child of each of the nodes returned from the XPath query.
 int insertAttribute(String query, SixdmlCollection collection, String name, String value, String namespaceURI)
          Inserts an attribute node as a child of each of the nodes returned from the XPath query.
 int insertAttribute(String query, SixdmlResource resource, String name, String value)
          Inserts an attribute node as a child of each of the nodes returned from the XPath query.
 int insertAttribute(String query, SixdmlResource resource, String name, String value, String namespaceURI)
          Inserts an attribute node as a child of each of the nodes returned from the XPath query.
 int insertAttribute(String query, String predicate, SixdmlCollection collection, String name, String value)
          Inserts an attribute node as a child of each of the nodes returned from the XPath query.
 int insertAttribute(String query, String predicate, SixdmlCollection collection, String name, String value, String namespaceURI)
          Inserts an attribute node as a child of each of the nodes returned from the XPath query.
 int insertChild(String query, NodeList nodes, SixdmlCollection collection)
          Inserts a node as a child of each of the nodes returned from the XPath query.
 int insertChild(String query, NodeList nodes, SixdmlResource resource)
          Inserts a node as a child of each of the nodes returned from the XPath query.
 int insertChild(String query, String predicate, NodeList nodes, SixdmlCollection collection)
          Inserts a node as a child of each of the nodes returned from the XPath query.
 int insertChild(String query, String fragment, SixdmlCollection collection)
          Inserts an XML fragment as a child of each of the nodes returned from the XPath query.
 int insertChild(String query, String fragment, SixdmlResource resource)
          Inserts an XML fragment as a child of each of the nodes returned from the XPath query.
 int insertChild(String query, String predicate, String fragment, SixdmlCollection collection)
          Inserts an XML fragment as a child of each of the nodes returned from the XPath query.
 int insertSibling(String query, NodeList nodes, SixdmlCollection collection, boolean before)
          Inserts a node as a sibling of each of the nodes returned from the XPath query.
 int insertSibling(String query, NodeList nodes, SixdmlResource resource, boolean before)
          Inserts a node as a sibling of each of the nodes returned from the XPath query.
 int insertSibling(String query, String predicate, NodeList nodes, SixdmlCollection collection, boolean before)
          Inserts a node as a sibling of each of the nodes returned from the XPath query.
 int insertSibling(String query, String fragment, SixdmlCollection collection, boolean before)
          Inserts an XML fragment as a sibling of each of the nodes returned from the XPath query.
 int insertSibling(String query, String fragment, SixdmlResource resource, boolean before)
          Inserts an XML fragment as a sibling of each of the nodes returned from the XPath query.
 int insertSibling(String query, String predicate, String fragment, SixdmlCollection collection, boolean before)
          Inserts an XML fragment as a sibling of each of the nodes returned from the XPath query.
 void removeNamespaceMapping(String prefix)
          Remove a mapping between a given prefix and a namespace to the service's internal namespace map.
 int rename(String query, String name, String namespaceURI, SixdmlCollection collection)
          Renames one or more attribute or element nodes.
 int rename(String query, String name, String namespaceURI, SixdmlResource resource)
          Renames one or more attribute or element nodes.
 int rename(String query, String predicate, String name, String namespaceURI, SixdmlCollection collection)
          Renames one or more attribute or element nodes.
 int replace(String query, NodeList nodes, SixdmlCollection collection)
          Replaces one or more element, processing-instruction, comment, or text nodes with the new node.
 int replace(String query, NodeList nodes, SixdmlResource resource)
          Replaces one or more element, processing-instruction, comment, or text nodes with the new node.
 int replace(String query, String fragment, SixdmlCollection collection)
          Replaces one or more element, processing-instruction, comment, or text nodes with the new node.
 int replace(String query, String fragment, SixdmlResource resource)
          Replaces one or more element, processing-instruction, comment, or text nodes with the new node.
 int replace(String query, String predicate, String fragment, SixdmlCollection collection)
          Replaces one or more element, processing-instruction, comment, or text nodes with the new node.
 void setNamespaceMap(SixdmlNamespaceMap nsMap)
          Set the SixdmlNamespaceMap used by this class to map prefixes to namespace URIs used in XPath queries.
 
Methods inherited from interface org.xmldb.api.base.Service
getName, getVersion, setCollection
 
Methods inherited from interface org.xmldb.api.base.Configurable
getProperty, setProperty
 

Method Detail

setNamespaceMap

public void setNamespaceMap(SixdmlNamespaceMap nsMap)
                     throws XMLDBException
Set the SixdmlNamespaceMap used by this class to map prefixes to namespace URIs used in XPath queries.
Parameters:
nsMap - the new namespace map to use.
Throws:
XMLDBException - if anything goes wrong.

addNamespaceMapping

public void addNamespaceMapping(String prefix,
                                String namespaceURI)
                         throws XMLDBException
Add a mapping between a given prefix and a namespace to the service's internal namespace map.
Parameters:
prefix - key with which the specified namespace URI is associated.
namespaceURI - value to be associated with the specified prefix.
Throws:
XMLDBException - if anything goes wrong.

removeNamespaceMapping

public void removeNamespaceMapping(String prefix)
                            throws XMLDBException
Remove a mapping between a given prefix and a namespace to the service's internal namespace map.
Parameters:
prefix - key with which the specified namespace URI is associated.
Throws:
XMLDBException - if anything goes wrong.

clearNamespaceMappings

public void clearNamespaceMappings()
                            throws XMLDBException
Clear all namespace mappings in the service's internal namespace map.
Throws:
XMLDBException - if anything goes wrong.

getNamespaceMapping

public String getNamespaceMapping(String prefix)
                           throws XMLDBException
Obtain the namespace URI mapped to a particular prefix.
Parameters:
prefix - the prefix whose namespace is being sought.
Returns:
the namespace URI mapped to the prefix or null if the map contains no mapping for this prefix.

insertSibling

public int insertSibling(String query,
                         String fragment,
                         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.
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.
Returns:
the number of nodes affected by the update.
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 int insertChild(String query,
                       String fragment,
                       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.
Parameters:
query - The query which selects the nodes to update
fragment - The XML fragment to insert
resource - the document to perform the update against
Returns:
the number of nodes affected by the update.
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 int insertSibling(String query,
                         NodeList nodes,
                         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.
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.
Returns:
the number of nodes affected by the update.
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 int insertChild(String query,
                       NodeList nodes,
                       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.
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
Returns:
the number of nodes affected by the update.
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 int insertAttribute(String query,
                           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.
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.
Returns:
the number of nodes affected by the update.
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 int insertAttribute(String query,
                           SixdmlResource resource,
                           String name,
                           String value,
                           String namespaceURI)
                    throws XMLDBException,
                           InvalidQueryException,
                           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.
namespaceURI - the namsepace URI for the attribute node
Returns:
the number of nodes affected by the update.
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 int delete(String query,
                  SixdmlResource resource)
           throws XMLDBException,
                  InvalidQueryException,
                  UpdateTypeMismatchException
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
Returns:
the number of nodes affected by the update.
Throws:
XMLDBException - if a database error occurs during the insertion.
InvalidQueryException - if the XPath query is invalid.
UpdateTypeMismatchException - if no nodes matching the query are found.

replace

public int replace(String query,
                   NodeList nodes,
                   SixdmlResource resource)
            throws XMLDBException,
                   InvalidQueryException,
                   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
Returns:
the number of nodes affected by the update.
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.

replace

public int replace(String query,
                   String fragment,
                   SixdmlResource resource)
            throws XMLDBException,
                   InvalidQueryException,
                   NonWellFormedXMLException,
                   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
Returns:
the number of nodes affected by the update.
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.

rename

public int rename(String query,
                  String name,
                  String namespaceURI,
                  SixdmlResource resource)
           throws XMLDBException,
                  InvalidQueryException,
                  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.
resource - the document to perform the update against
Returns:
the number of nodes affected by the update.
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.

insertSibling

public int insertSibling(String query,
                         String fragment,
                         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.
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.
Returns:
the number of nodes affected by the update.
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 int insertChild(String query,
                       String fragment,
                       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.
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
Returns:
the number of nodes affected by the update.
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 int insertSibling(String query,
                         NodeList nodes,
                         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.
Parameters:
query - The query which selects the nodes to update
node - 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.
Returns:
the number of nodes affected by the update.
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 int insertChild(String query,
                       NodeList nodes,
                       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.
Parameters:
query - The query which selects the nodes to update
node - The DOM node(s) to insert
collection - the collection whose documents to perform the update against
Returns:
the number of nodes affected by the update.
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 int insertAttribute(String query,
                           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.
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.
Returns:
the number of nodes affected by the update.
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 int insertAttribute(String query,
                           SixdmlCollection collection,
                           String name,
                           String value,
                           String namespaceURI)
                    throws XMLDBException,
                           InvalidQueryException,
                           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.
namespaceURI - the namsepace URI for the attribute node
Returns:
the number of nodes affected by the update.
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 int delete(String query,
                  SixdmlCollection collection)
           throws XMLDBException,
                  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
Throws:
XMLDBException - if a database error occurs during the insertion.
InvalidQueryException - if the XPath query is invalid.

replace

public int replace(String query,
                   NodeList nodes,
                   SixdmlCollection collection)
            throws XMLDBException,
                   InvalidQueryException,
                   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
Returns:
the number of nodes affected by the update.
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.

replace

public int replace(String query,
                   String fragment,
                   SixdmlCollection collection)
            throws XMLDBException,
                   InvalidQueryException,
                   NonWellFormedXMLException,
                   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
Returns:
the number of nodes affected by the update.
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.

rename

public int rename(String query,
                  String name,
                  String namespaceURI,
                  SixdmlCollection collection)
           throws XMLDBException,
                  InvalidQueryException,
                  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
Returns:
the number of nodes affected by the update.
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.

insertChild

public int insertChild(String query,
                       String predicate,
                       String fragment,
                       SixdmlCollection collection)
                throws XMLDBException,
                       InvalidQueryException,
                       NonWellFormedXMLException,
                       UpdateTypeMismatchException
Inserts an XML fragment as a child of each of the nodes returned from the XPath query. 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
predicate - a filter expression used to determine which documents to update within the collection.
Returns:
the number of nodes affected by the update.
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.

insertChild

public int insertChild(String query,
                       String predicate,
                       NodeList nodes,
                       SixdmlCollection collection)
                throws XMLDBException,
                       InvalidQueryException,
                       UpdateTypeMismatchException
Inserts a node as a child of each of the nodes returned from the XPath query. 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
predicate - a filter expression used to determine which documents to update within the collection.
Returns:
the number of nodes affected by the update.
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.

insertSibling

public int insertSibling(String query,
                         String predicate,
                         NodeList nodes,
                         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.
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.
predicate - a filter expression used to determine which documents to update within the collection.
Returns:
the number of nodes affected by the update.
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.

insertSibling

public int insertSibling(String query,
                         String predicate,
                         String fragment,
                         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.
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.
predicate - a filter expression used to determine which documents to update within the collection.
Returns:
the number of nodes affected by the update.
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.

insertAttribute

public int insertAttribute(String query,
                           String predicate,
                           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.
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.
predicate - a filter expression used to determine which documents to update within the collection.
Returns:
the number of nodes affected by the update.
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 int insertAttribute(String query,
                           String predicate,
                           SixdmlCollection collection,
                           String name,
                           String value,
                           String namespaceURI)
                    throws XMLDBException,
                           InvalidQueryException,
                           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.
namespaceURI - the namsepace URI for the attribute node
predicate - a filter expression used to determine which documents to update within the collection.
Returns:
the number of nodes affected by the update.
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 int delete(String query,
                  String predicate,
                  SixdmlCollection collection)
           throws XMLDBException,
                  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
predicate - a filter expression used to determine which documents to update within the collection.
Returns:
the number of nodes affected by the update.

replace

public int replace(String query,
                   String predicate,
                   String fragment,
                   SixdmlCollection collection)
            throws XMLDBException,
                   InvalidQueryException,
                   NonWellFormedXMLException,
                   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
predicate - a filter expression used to determine which documents to update within the collection.
Returns:
the number of nodes affected by the update.
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.

rename

public int rename(String query,
                  String predicate,
                  String name,
                  String namespaceURI,
                  SixdmlCollection collection)
           throws XMLDBException,
                  InvalidQueryException,
                  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
predicate - a filter expression used to determine which documents to update within the collection.
Returns:
the number of nodes affected by the update.
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.