|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--org.sixdml.excelon.xlnServiceBase
|
+--org.sixdml.excelon.xlnNamespaceAwareService
|
+--org.sixdml.excelon.xlnSixdmlUpdateService
xlnSixdmlUpdateService.java Used to update nodes in collections or documents via XPath queries. Created: Wed Jan 16 22:15:46 2002
| 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 |
private com.exln.dxe.Session session
| Constructor Detail |
xlnSixdmlUpdateService(com.exln.dxe.Session session)
session - the DXE session associated with the class.| Method Detail |
public String getName()
getName in interface ServicegetName in class xlnServiceBase
private static boolean isNodeOfType(short type,
short[] nodetypes)
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.
static NodeList loadIntoNodeList(String xmlString)
throws NonWellFormedXMLException
xmlString - the XML fragment.
NonWellFormedXMLException - if the XML fragment is not a valid XML fragment.
public void insertSibling(String query,
String fragment,
org.sixdml.SixdmlResource resource,
boolean before)
throws XMLDBException,
InvalidQueryException,
NonWellFormedXMLException,
UpdateTypeMismatchException
insertSibling in interface SixdmlUpdateServicequery - The query which selects the nodes to updatefragment - The XML fragment to insertresource - the document to perform the update againstbefore - 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.
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.
public void insertChild(String query,
String fragment,
org.sixdml.SixdmlResource resource)
throws XMLDBException,
InvalidQueryException,
NonWellFormedXMLException,
UpdateTypeMismatchException
insertChild in interface SixdmlUpdateServicequery - The query which selects the nodes to updatefragment - The XML fragment to insertresource - the document to perform the update against
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.
public void insertSibling(String query,
NodeList nodes,
org.sixdml.SixdmlResource resource,
boolean before)
throws XMLDBException,
InvalidQueryException,
UpdateTypeMismatchException
insertSibling in interface SixdmlUpdateServicequery - The query which selects the nodes to updatenodes - The DOM node(s) to insertresource - the document to perform the update againstbefore - 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.
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.ErrorMessages.NODES_NOT_RETURNED,
ErrorMessages.BAD_UPDATE_ATTEMPT
private void insertSibling(com.exln.dxe.XPath xpath,
NodeList nodes,
org.sixdml.SixdmlResource resource,
boolean before)
throws XMLDBException,
UpdateTypeMismatchException
xpath - The eXcelon DXE XPath object which contains the query which
selects the nodes to updatenodes - The DOM node(s) to insertresource - the document to perform the update againstbefore - 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.
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.ErrorMessages.NODES_NOT_RETURNED,
ErrorMessages.MULTIPLE_ROOT_ELEMENTS
public void insertChild(String query,
NodeList nodes,
org.sixdml.SixdmlResource resource)
throws XMLDBException,
InvalidQueryException,
UpdateTypeMismatchException
insertChild in interface SixdmlUpdateServicequery - The query which selects the nodes to updatenodes - The DOM node(s) to insertresource - the document to perform the update against
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.ErrorMessages.NODES_NOT_RETURNED,
ErrorMessages.BAD_UPDATE_ATTEMPT
public void insertChild(com.exln.dxe.XPath xpath,
NodeList nodes,
org.sixdml.SixdmlResource resource)
throws XMLDBException,
UpdateTypeMismatchException
xpath - The eXcelon DXE XPath object which contains the query which
selects the nodes to updatenodes - The DOM node(s) to insertresource - the document to perform the update against
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.ErrorMessages.NODES_NOT_RETURNED,
ErrorMessages.BAD_UPDATE_ATTEMPT
public void insertAttribute(String query,
org.sixdml.SixdmlResource resource,
String name,
String value)
throws XMLDBException,
InvalidQueryException,
UpdateTypeMismatchException
insertAttribute in interface SixdmlUpdateServicequery - The query which selects the nodes to updateresource - the document to perform the update againstname - The name of the attribute to insert.value - the value of the attribute to insert.
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.ErrorMessages.NODES_NOT_RETURNED,
ErrorMessages.BAD_UPDATE_ATTEMPT
public void insertAttribute(String query,
org.sixdml.SixdmlResource resource,
String name,
String value,
URI namespaceURI)
throws XMLDBException,
InvalidQueryException,
UpdateTypeMismatchException
insertAttribute in interface SixdmlUpdateServicequery - The query which selects the nodes to updateresource - the document to perform the update againstname - 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.
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.ErrorMessages.NODES_NOT_RETURNED,
ErrorMessages.BAD_UPDATE_ATTEMPT
public void delete(String query,
org.sixdml.SixdmlResource resource)
throws XMLDBException,
InvalidQueryException
delete in interface SixdmlUpdateServicequery - The query which selects the nodes to delete.resource - the document to perform the update against
XMLDBException - if a database error occurs during the insertion.
InvalidQueryException - if the XPath query is invalid.
public void replace(String query,
String fragment,
org.sixdml.SixdmlResource resource)
throws XMLDBException,
InvalidQueryException,
NonWellFormedXMLException,
UpdateTypeMismatchException
replace in interface SixdmlUpdateServicequery - The query which selects the nodes to updatefragment - the XML fragment to insert.resource - the document to perform the update against
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.ErrorMessages.NODES_NOT_RETURNED,
ErrorMessages.BAD_UPDATE_ATTEMPT,
ErrorMessages.MULTIPLE_ROOT_ELEMENTS,
ErrorMessages.CANT_REPLACE_ATTRIBUTE
public void replace(String query,
NodeList nodes,
org.sixdml.SixdmlResource resource)
throws XMLDBException,
InvalidQueryException,
UpdateTypeMismatchException
replace in interface SixdmlUpdateServicequery - The query which selects the nodes to updatenodes - The DOM node(s) to insertresource - the document to perform the update against
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.ErrorMessages.NODES_NOT_RETURNED,
ErrorMessages.BAD_UPDATE_ATTEMPT,
ErrorMessages.MULTIPLE_ROOT_ELEMENTS,
ErrorMessages.CANT_REPLACE_ATTRIBUTE
public void rename(String query,
String name,
URI namespaceURI,
org.sixdml.SixdmlResource resource)
throws XMLDBException,
InvalidQueryException,
UpdateTypeMismatchException
rename in interface SixdmlUpdateServicequery - The query which selects the nodes to updatename - 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
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.ErrorMessages.NODES_NOT_RETURNED,
ErrorMessages.RENAME_ERROR
public void insertSibling(String query,
String fragment,
org.sixdml.SixdmlCollection collection,
boolean before)
throws XMLDBException,
InvalidQueryException,
NonWellFormedXMLException,
UpdateTypeMismatchException
insertSibling in interface SixdmlUpdateServicequery - The query which selects the nodes to updatefragment - The XML fragment to insertcollection - the collection whose documents to perform the update againstbefore - 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.
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.
public void insertChild(String query,
String fragment,
org.sixdml.SixdmlCollection collection)
throws XMLDBException,
InvalidQueryException,
NonWellFormedXMLException,
UpdateTypeMismatchException
insertChild in interface SixdmlUpdateServicequery - The query which selects the nodes to updatefragment - The XML fragment to insertcollection - the collection whose documents to perform the update against
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.
public void insertSibling(String query,
NodeList nodes,
org.sixdml.SixdmlCollection collection,
boolean before)
throws XMLDBException,
InvalidQueryException,
UpdateTypeMismatchException
insertSibling in interface SixdmlUpdateServicequery - The query which selects the nodes to updatenodes - The DOM node(s) to insertcollection - the collection whose documents to perform the update againstbefore - 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.
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.
public void insertChild(String query,
NodeList nodes,
org.sixdml.SixdmlCollection collection)
throws XMLDBException,
InvalidQueryException,
UpdateTypeMismatchException
insertChild in interface SixdmlUpdateServicequery - The query which selects the nodes to updatenodes - The DOM node(s) to insertcollection - the collection whose documents to perform the update against
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.
public void insertAttribute(String query,
org.sixdml.SixdmlCollection collection,
String name,
String value)
throws XMLDBException,
InvalidQueryException,
UpdateTypeMismatchException
insertAttribute in interface SixdmlUpdateServicequery - The query which selects the nodes to updatecollection - the collection whose documents to perform the update againstname - The name of the attribute to insert.value - the value of the attribute to insert.
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.
public void insertAttribute(String query,
org.sixdml.SixdmlCollection collection,
String name,
String value,
URI namespaceURI)
throws XMLDBException,
InvalidQueryException,
UpdateTypeMismatchException
insertAttribute in interface SixdmlUpdateServicequery - The query which selects the nodes to updatecollection - the collection whose documents to perform the update againstname - 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
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.
public void delete(String query,
org.sixdml.SixdmlCollection collection)
throws XMLDBException,
InvalidQueryException
delete in interface SixdmlUpdateServicequery - The query which selects the nodes to delete.collection - the collection whose documents to perform the update against
InvalidQueryException - if the XPath query is invalid.
XMLDBException - if a database error occurs during the insertion.
public void replace(String query,
String fragment,
org.sixdml.SixdmlCollection collection)
throws XMLDBException,
InvalidQueryException,
NonWellFormedXMLException,
UpdateTypeMismatchException
replace in interface SixdmlUpdateServicequery - The query which selects the nodes to updatefragment - the XML fragment to insert.collection - the collection whose documents to perform the update against
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.ErrorMessages.NODES_NOT_RETURNED,
ErrorMessages.BAD_UPDATE_ATTEMPT,
ErrorMessages.MULTIPLE_ROOT_ELEMENTS,
ErrorMessages.CANT_REPLACE_ATTRIBUTE
public void replace(String query,
NodeList nodes,
org.sixdml.SixdmlCollection collection)
throws XMLDBException,
InvalidQueryException,
UpdateTypeMismatchException
replace in interface SixdmlUpdateServicequery - The query which selects the nodes to updatenodes - The DOM node(s) to insertcollection - the collection whose documents to perform the update against
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.ErrorMessages.NODES_NOT_RETURNED,
ErrorMessages.BAD_UPDATE_ATTEMPT,
ErrorMessages.MULTIPLE_ROOT_ELEMENTS,
ErrorMessages.CANT_REPLACE_ATTRIBUTE
public void rename(String query,
String name,
URI namespaceURI,
org.sixdml.SixdmlCollection collection)
throws XMLDBException,
InvalidQueryException,
UpdateTypeMismatchException
rename in interface SixdmlUpdateServicequery - The query which selects the nodes to updatename - The new namenamespaceURI - 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
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.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||