Oracle9i XML API Reference - XDK and Oracle XML DB Release 2 (9.2) Part Number A96616-01 |
|
The Extensible Markup Language (XML) Parser for PL/SQL, found in the DBMS_XMLDOM Package, is used to access XMLType
objects and both schema-based and nonschema-based documents.
This chapter details the following:
The Document Object Model (DOM) is an application programming interface (API) for HTML and XML documents. It defines the logical structure of documents and the way a document is accessed and manipulated. In the DOM specification, the term "document" is used in the broad sense. XML is increasingly being used as a way of representing many different kinds of information that may be stored in diverse systems, and much of this would traditionally be seen as data rather than as documents. Nevertheless, XML presents this data as documents, and the DOM may be used to manage this data.
With the Document Object Model, programmers can build documents, navigate their structure, and add, modify, or delete elements and content. Anything found in an HTML or XML document can be accessed, changed, deleted, or added using the Document Object Model, with a few exceptions. In particular, the DOM interfaces for the XML internal and external subsets have not yet been specified.
One important objective of the W3C specification for the Document Object Model is to provide a standard programming interface that can be used in a wide variety of environments and applications. The DOM is designed to be used with any programming language. Since the DOM standard is object-oriented, for this PL/SQL adaptation, some changes had to be made:
appendChild()
PL/SQL function is provided,
FUNCTION appendChild( n DOMNode, newChild IN DOMNode) RETURN DOMNode;
and to perform setAttribute on a DOM Element elem, the setAttribute()
PL/SQL procedure is provided:
PROCEDURE setAttribute( elem DOMElement, name IN VARCHAR2, value IN VARCHAR2);
DOM defines an inheritance hierarchy. For example, Document, Element, and Attr are defined to be subtypes of Node. Thus, a method defined in the Node interface should be available in these as well. Since, such inheritance is not directly possible in PL/SQL, the makeNode functions need to be invoked on different DOM types to convert these into a DOMNode. The appropriate functions or procedures that accept DOMNodes can then be called to operate on these types. If, subsequently, type specific functionality is desired, the DOMNode can be converted back into the type by using the make*()
functions, where DOM* is the desired DOM type.
The implementation of this PL/SQL DOM interface followed the DOM standard of revision REC-DOM-Level-1-19981001. The types and methods described in this document are made available by the PL/SQL package DBMS_XMLDOM.
initialization.ORA
file must be specified; for example:
UTL_FILE_DIR=/mypath/insidemypath
The following types are defined for DBMS_XMLDOM.DOMTYPE:
The constants listed in Table 25-2 are defined for DBMS_XMLDOM
. For example, when a request such as getNodeType(myNode)
is made, the returned type will be one of the following constants.
The exceptions listed in Table 25-3 are defined for DBMS_XMLDOM
:
DBMS_XMLDOM
subprograms are divided into groups according to w3c Interfaces.
Checks if the given DOMNode is NULL
. Returns TRUE
if it is NULL
, FALSE
otherwise.
FUNCTION isNull( n DOMNode) RETURN BOOLEAN;
Parameter | IN / OUT | Description |
---|---|---|
n |
(IN) |
DOMNode to check. |
Casts a given DOMNode to a DOMAttr, and returns the DOMAttr.
FUNCTION makeAttr( n DOMNode) RETURN DOMAttr;
Parameter | IN / OUT | Description |
---|---|---|
n |
(IN) |
DOMNode to cast |
Casts a given DOMNode to a DOMCDataSection, and returns the DOMCDataSection.
FUNCTION makeCDataSection( n DOMNode) RETURN DOMCDataSection;
Parameter | IN / OUT | Description |
---|---|---|
n |
(IN) |
DOMNode to cast |
Casts a given DOMNode to a DOMCharacterData, and returns the DOMCharacterData.
FUNCTION makeCharacterData( n DOMNode) RETURN DOMCharacterData;
Parameter | IN / OUT | Description |
---|---|---|
n |
(IN) |
DOMNode to cast |
Casts a given DOMNode to a DOMComment, and returns the DOMComment.
FUNCTION makeComment(n DOMNode) RETURN DOMComment;
Parameter | IN / OUT | Description |
---|---|---|
n |
(IN) |
DOMNode to cast |
Casts a given DOMNode to a DOMDocumentFragment, and returns the DOMDocumentFragment.
FUNCTION makeDocumentFragment( n DOMNode) RETURN DOMDocumentFragment;
Parameter | IN / OUT | Description |
---|---|---|
n |
(IN) |
DOMNode to cast |
Casts a given DOMNode to a DOMDocumentType and returns the DOMDocumentType.
FUNCTION makeDocumentType(n DOMNode) RETURN DOMDocumentType;
Parameter | IN / OUT | Description |
---|---|---|
n |
(IN) |
DOMNode to cast |
Casts a given DOMNode to a DOMElement, and returns the DOMElement.
FUNCTION makeElement(n DOMNode) RETURN DOMElement;
Parameter | IN / OUT | Description |
---|---|---|
n |
(IN) |
DOMNode to cast |
Casts a given DOMNode to a DOMEntity, and returns the DOMEntity.
FUNCTION makeEntity(n DOMNode) RETURN DOMEntity;
Parameter | IN / OUT | Description |
---|---|---|
n |
(IN) |
DOMNode to cast |
Casts a given DOMNode to a DOMEntityReference, and returns the DOMEntityReference.
FUNCTION makeEntityReference(n DOMNode) RETURN DOMEntityReference;
Parameter | IN / OUT | Description |
---|---|---|
n |
(IN) |
DOMNode to cast |
Casts a given DOMNode to a DOMNotation, and returns the DOMNotation.
FUNCTION makeNotation(n DOMNode) RETURN DOMNotation;
Parameter | IN / OUT | Description |
---|---|---|
n |
(IN) |
DOMNode to cast |
Casts a given DOMNode to a DOMProcessingInstruction, and returns the DOMProcessingInstruction.
FUNCTION makeProcessingInstruction( n DOMNode) RETURN DOMProcessingInstruction;
Parameter | IN / OUT | Description |
---|---|---|
n |
(IN) |
DOMNode to cast |
Casts a given DOMNode to a DOMText, and returns the DOMText.
FUNCTION makeText(n DOMNode) RETURN DOMText;
Parameter | IN / OUT | Description |
---|---|---|
n |
(IN) |
DOMNode to cast |
Casts a given DOMNode to a DOMDocument, and returns the DOMDocument.
FUNCTION makeDocument(n DOMNode) RETURN DOMDocument;
Parameter | IN / OUT | Description |
---|---|---|
n |
(IN) |
DOMNode to cast |
Writes XML node to specified file. The options are given in the following table.
Parameter | IN / OUT | Description |
---|---|---|
n |
(IN) |
DOMNode. |
fileName |
(IN) |
File to write to. |
charset |
(IN) |
Given character set. |
Writes XML node to specified buffer. The options are given in the following table.
Parameter | IN / OUT | Description |
---|---|---|
n |
(IN) |
DOMNode. |
buffer |
(IN/OUT) |
Buffer to write to. |
charset |
(IN) |
Given character set. |
Writes XML node to specified clob. The options are given in the following table.
Parameter | IN / OUT | Description |
---|---|---|
n |
(IN) |
DOMNode. |
cl |
(IN/OUT) |
CLOB to write to. |
charset |
(IN) |
Given character set. |
Get the name of the node depending on its type
FUNCTION getNodeName(n DOMNode) RETURN VARCHAR2;
Parameter | IN / OUT | Description |
---|---|---|
n |
IN |
DOMNode |
Get the value of this node, depending on its type.
FUNCTION getNodeValue(n DOMNode) RETURN VARCHAR2;
Parameter | IN / OUT | Description |
---|---|---|
n |
IN |
DOMNode. |
Sets the value of this node, depending on its type. When it is defined to be null, setting it has no effect.
PROCEDURE setNodeValue( n DOMNode, nodeValue IN VARCHAR2);
Parameter | IN / OUT | Description |
---|---|---|
n |
IN |
DOMNode. |
nodeValue |
IN |
The value to which node is set. |
Retrieves a code representing the type of the underlying object.
FUNCTION getNodeType(n DOMNode) RETURN NUMBER;
Parameter | IN / OUT | Description |
---|---|---|
n |
IN |
DOMNode |
Retrieves the parent of this node. All nodes, except Attr, Document, DocumentFragment, Entity, and Notation may have a parent. However, if a node has just been created and not yet added to the tree, or if it has been removed from the tree, this is null.
FUNCTION getParentNode(n DOMNode) RETURN DOMNode;
Parameter | IN / OUT | Description |
---|---|---|
n |
IN |
DOMNode |
Retrieves a NodeList that contains all children of this node. If there are no children, this is a NodeList containing no nodes.
FUNCTION getChildNodes(n DOMNode) RETURN DOMNodeList;
Parameter | IN / OUT | Description |
---|---|---|
n |
IN |
DOMNode |
Retrieves the first child of this node. If there is no such node, this returns null.
FUNCTION getFirstChild( n DOMNode) RETURN DOMNode;
Parameter | IN / OUT | Description |
---|---|---|
n |
IN |
DOMNode |
Retrieves the last child of this node. If there is no such node, this returns NULL
.
FUNCTION getLastChild( n DOMNode) RETURN DOMNode;
Parameter | IN / OUT | Description |
---|---|---|
n |
IN |
DOMNode |
Retrieves the node immediately preceding this node. If there is no such node, this returns NULL
.
FUNCTION getPreviousSibling( n DOMNode) RETURN DOMNode;
Parameter | IN / OUT | Description |
---|---|---|
n |
IN |
DOMNode |
Retrieves the node immediately following this node. If there is no such node, this returns NULL
.
FUNCTION getNextSibling( n DOMNode) RETURN DOMNode;
Parameter | IN / OUT | Description |
---|---|---|
n |
IN |
DOMNode |
Retrieves a NamedNodeMap containing the attributes of this node (if it is an Element) or null otherwise.
FUNCTION getAttributes( n DOMNode) RETURN DOMNamedNodeMap;
Parameter | IN / OUT | Description |
---|---|---|
n |
IN |
DOMNode |
Retrieves the Document object associated with this node. This is also the Document object used to create new nodes. When this node is a Document or a DocumentType which is not used with any Document yet, this is null.
FUNCTION getOwnerDocument( n DOMNode) RETURN DOMDocument;
Parameter | IN / OUT | Description |
---|---|---|
n |
IN |
DOMNode |
Inserts the node newChild
before the existing child node refChild
. If refChild
is NULL
, insert newChild
at the end of the list of children.
If newChild is a DocumentFragment object, all of its children are inserted, in the same order, before refChild. If the newChild is already in the tree, it is first removed.
FUNCTION insertBefore( n DOMNode, newChild IN DOMNode, refChild IN DOMNode) RETURN DOMNode;
Parameter | IN / OUT | Description |
---|---|---|
n |
IN |
DOMNode |
newChild |
IN |
The child to be inserted in the DOMNode |
refChild |
IN |
The reference node before which the newChild is to be inserted |
Replaces the child node oldChild
with newChild
in the list of children, and returns the oldChild node.
If newChild
is a DocumentFragment object, oldChild
is replaced by all of the DocumentFragment children, which are inserted in the same order. If the newChild is already in the tree, it is first removed.
FUNCTION replaceChild( n DOMNode, newChild IN DOMNode, oldChild IN DOMNode) RETURN DOMNode;
Parameter | IN / OUT | Description |
---|---|---|
n |
IN |
DOMNode |
newChild |
IN |
The new Child which is to replace the oldChild |
oldChild |
IN |
The child of the Node n which is to be replaced |
Removes the child node indicated by oldChild from the list of children, and returns it.
FUNCTION removeChild( n DOMNode, oldChild IN DOMNode) RETURN DOMNode;
Parameter | IN / OUT | Description |
---|---|---|
n |
IN |
DOMNode |
oldCHild |
IN |
The child of the node n to be removed |
Adds the node newChild to the end of the list of children of this node. If the newChild is already in the tree, it is first removed.
FUNCTION appendChild( n DOMNode, newChild IN DOMNode) RETURN DOMNode;
Parameter | IN / OUT | Description |
---|---|---|
n |
IN |
DOMNode |
newChild |
IN |
The child to be appended to the list of children of Node n |
Returns whether this node has any children.
FUNCTION hasChildNodes( n DOMNode) RETURN BOOLEAN;
Parameter | IN / OUT | Description |
---|---|---|
n |
IN |
DOMNode |
Returns a duplicate of this node; serves as a generic copy constructor for nodes. The duplicate node has no parent; its parentNode
is NULL
.
Cloning an Element copies all attributes and their values, including those generated by the XML processor to represent defaulted attributes, but this method does not copy any text it contains unless it is a deep clone, since the text is contained in a child Text node. Cloning an Attribute directly, as opposed to be cloned as part of an Element cloning operation, returns a specified attribute (specified is true). Cloning any other type of node simply returns a copy of this node.
Note that cloning an immutable subtree results in a mutable copy, but the children of an EntityReference clone are read-only. In addition, clones of unspecified Attr nodes are specified. And, cloning Document, DocumentType, Entity, and Notation nodes is implementation dependent.
FUNCTION cloneNode( n DOMNode, deep boolean) RETURN DOMNode;
Parameter | IN / OUT | Description |
---|---|---|
n |
IN |
DOMNode |
deep |
IN |
boolean to determine if children are to be cloned or not |
Checks that the given DOMNamedNodeMap is NULL
; returns TRUE
if it is NULL
, FALSE
otherwise.
FUNCTION isNull( nnm DOMNamedNodeMap) RETURN BOOLEAN;
Parameter | IN / OUT | Description |
---|---|---|
nnm |
(IN) |
DOMNameNodeMap to check. |
Retrieves a node specified by name.
FUNCTION getNamedItem( nnm DOMNamedNodeMap, name IN VARCHAR2) RETURN DOMNode;
Parameter | IN / OUT | Description |
---|---|---|
nnm |
IN |
DOMNamedNodeMap |
name |
IN |
Name of the item to be retrieved |
Adds a node using its nodeName attribute. If a node with that name is already present in this map, it is replaced by the new one.
As the nodeName attribute is used to derive the name under which the node must be stored, multiple nodes of certain types, those that have a "special" string value, cannot be stored because the names would clash. This is seen as preferable to allowing nodes to be aliased.
FUNCTION setNamedItem( nnm DOMNamedNodeMap, arg IN DOMNode) RETURN DOMNode;
Parameter | IN / OUT | Description |
---|---|---|
nnm |
IN |
DOMNamedNodeMap |
arg |
IN |
The Node to be added using its NodeName attribute. |
Removes a node specified by name. When this map contains the attributes attached to an element, if the removed attribute is known to have a default value, an attribute immediately appears containing the default value as well as the corresponding namespace URI, local name, and prefix when applicable.
FUNCTION removeNamedItem( nnm DOMNamedNodeMap, name IN VARCHAR2) RETURN DOMNode;
Parameter | IN / OUT | Description |
---|---|---|
nnm |
IN |
DOMNamedNodeMap |
name |
IN |
The name of the item to be removed from the map |
Returns the item in the map which corresponds to the index
parameter. If index is greater than or equal to the number of nodes in this map, this returns NULL
.
FUNCTION item( nnm DOMNamedNodeMap, index IN NUMBER) RETURN DOMNode;
Parameter | IN / OUT | Description |
---|---|---|
nnm |
IN |
DOMNamedNodeMap |
index |
IN |
The index in the node map at which the item is to be retrieved |
The number of nodes in this map. The range of valid child node index is 0 to length-1 inclusive.
FUNCTION getLength( nnm DOMNamedNodeMap) RETURN NUMBER;
Parameter | IN / OUT | Description |
---|---|---|
nnm |
IN |
DOMNamedNodeMap |
Checks that the given DOMNodeList is NULL
; returns TRUE
if it is NULL
, FALSE
otherwise.
FUNCTION isNull( nl DOMNodeList) RETURN BOOLEAN;
Parameter | IN / OUT | Description |
---|---|---|
nl |
(IN) |
DOMNodeList to check. |
Returns the item in the collection which corresponds to the index
parameter. If index is greater than or equal to the number of nodes in the list, this returns null.
FUNCTION item( nl DOMNodeList, index IN NUMBER) RETURN DOMNode;
Parameter | IN / OUT | Description |
---|---|---|
nl |
IN |
DOMNodeList |
index |
IN |
The index in the nodelist at which to retrieve the item from |
The number of nodes in the list. The range of valid child node index is 0 to length-1 inclusive.
FUNCTION getLength( nl DOMNodeList) RETURN NUMBER;
Parameter | IN / OUT | Description |
---|---|---|
nl |
IN |
DOMNodeList |
Checks that the given DOMAttr is NULL
; returns TRUE
if it is NULL
, FALSE
otherwise.
FUNCTION isNull( a DOMAttr) RETURN BOOLEAN;
Parameter | IN / OUT | Description |
---|---|---|
a |
(IN) |
DOMAttr to check. |
Casts given DOMAttr to a DOMNode, and returns the DOMNode.
FUNCTION makeNode( a DOMAttr) RETURN DOMNode;
Parameter | IN / OUT | Description |
---|---|---|
a |
(IN) |
DOMAttr to cast. |
Returns the qualified name of the DOMAttr.
FUNCTION getQualifiedName( a DOMAttr) RETURN VARCHAR2;
Parameter | IN / OUT | Description |
---|---|---|
a |
(IN) |
DOMAttr. |
Returns the namespace of the DOMAttr.
FUNCTION getNamespace( a DOMAttr) RETURN VARCHAR2;
Parameter | IN / OUT | Description |
---|---|---|
a |
(IN) |
DOMAttr. |
Returns the local name of the DOMAttr.
FUNCTION getLocalName( a DOMAttr) RETURN VARCHAR2;
Parameter | IN / OUT | Description |
---|---|---|
a |
(IN) |
DOMAttr. |
Returns the expanded name of the DOMAttr.
FUNCTION getExpandedName( a DOMAttr) RETURN VARCHAR2;
Parameter | IN / OUT | Description |
---|---|---|
a |
(IN) |
DOMAttr. |
Returns the name of this attribute.
FUNCTION getName( a DOMAttr) RETURN VARCHAR2;
Parameter | IN / OUT | Description |
---|---|---|
a |
IN |
DOMAttr |
If this attribute was explicitly given a value in the original document, this is true; otherwise, it is false.
FUNCTION getSpecified( a DOMAttr) RETURN BOOLEAN;
Parameter | IN / OUT | Description |
---|---|---|
a |
IN |
DOMAttr |
Retrieves the value of the attribute.
FUNCTION getValue( a DOMAttr) RETURN VARCHAR2;
Parameter | IN / OUT | Description |
---|---|---|
a |
IN |
DOMAttr |
Sets the value of the attribute.
PROCEDURE setValue( a DOMAttr, value IN VARCHAR2);
Parameter | IN / OUT | Description |
---|---|---|
a |
IN |
DOMAttr |
value |
IN |
The value to set the attribute to |
Checks that the given DOMCDataSection is NULL
; returns TRUE
if it is NULL
, FALSE
otherwise.
FUNCTION isNull( cds DOMCDataSection) RETURN BOOLEAN;
Parameter | IN / OUT | Description |
---|---|---|
cds |
(IN) |
DOMCDataSection to check. |
Casts the DOMCDataSection to a DOMNode, and returns that DOMNode.
FUNCTION makeNode( cds DOMCDataSection) RETURN DOMNode;
Parameter | IN / OUT | Description |
---|---|---|
cds |
(IN) |
DOMCDataSection to cast. |
Checks that the given DOMCharacterData is NULL
; returns TRUE
if it is NULL
, FALSE
otherwise.
FUNCTION isNull( cd DOMCharacterData) RETURN BOOLEAN;
Parameter | IN / OUT | Description |
---|---|---|
cd |
(IN) |
DOMCharacterData to check. |
Casts the given DOMCharacterData as a DOMNode, and returns that DOMNode.
FUNCTION makeNode( cd DOMCharacterData) RETURN DOMNode;
Parameter | IN / OUT | Description |
---|---|---|
cd |
(IN) |
DOMCharacterData to cast |
Gets the character data of the node that implements this interface.
FUNCTION getData( cd DOMCharacterData) RETURN VARCHAR2;
Parameter | IN / OUT | Description |
---|---|---|
cd |
IN |
DOMCharacterData |
Sets the character data of the node that implements this interface.
PROCEDURE setData( cd DOMCharacterData, data IN VARCHAR2);
Parameter | IN / OUT | Description |
---|---|---|
cd |
IN |
DOMCharacterData |
data |
IN |
The data to set the node to |
The number of 16-bit units that are available through data and the substringData()
method. This may have the value zero; CharacterData nodes may be empty.
FUNCTION getLength( cd DOMCharacterData) RETURN NUMBER;
Parameter | IN / OUT | Description |
---|---|---|
cd |
IN |
DOMCharacterData |
Extracts a range of data from the node.
FUNCTION substringData( cd DOMCharacterData, offset IN NUMBER, cnt IN NUMBER) RETURN VARCHAR2;
Parameter | IN / OUT | Description |
---|---|---|
cd |
IN |
DOMCharacterData. |
offset |
IN |
The starting offset of the data from which to get the data. |
cnt |
IN |
The number of characters (from the offset) of the data to get. |
Appends the string to the end of the character data of the node. Upon success, data provides access to the concatenation of data and the specified string argument.
PROCEDURE appendData( cd DOMCharacterData, arg IN VARCHAR2);
Parameter | IN / OUT | Description |
---|---|---|
cd |
IN |
DOMCharacterData. |
arg |
IN |
The data to append to the existing data. |
Inserts a string at the specified 16-bit unit offset.
PROCEDURE insertData( cd DOMCharacterData, offset IN NUMBER, arg IN VARCHAR2);
Parameter | IN / OUT | Description |
---|---|---|
cd |
IN |
DOMCharacterData. |
offset |
IN |
The offset at which to insert the data. |
arg |
IN |
The value to be inserted. |
Removes a range of 16-bit units from the node. Upon success, data and length reflect the change.
PROCEDURE deleteData( cd DOMCharacterData, offset IN NUMBER, cnt IN NUMBER);
Parameter | IN / OUT | Description |
---|---|---|
cd |
IN |
DOMCharacterData |
offset |
IN |
The offset from which to delete the data |
cnt |
IN |
The number of characters (starting from offset) to delete. |
Remove a range of 16-bit units from the node. Upon success, data and length reflect the change.
PROCEDURE replaceData( cd DOMCharacterData, offset IN NUMBER, cnt IN NUMBER, arg IN VARCHAR2);
Parameter | IN / OUT | Description |
---|---|---|
cd |
IN |
DOMCharacterData. |
offset |
IN |
The offset at which to replace. |
cnt |
IN |
The no. of characters to replace. |
arg |
IN |
The value to replace with. |
Checks that the given DOMComment is NULL
; returns TRUE
if it is NULL
, FALSE
otherwise.
FUNCTION isNull( com DOMComment) RETURN BOOLEAN;
Parameter | IN / OUT | Description |
---|---|---|
com |
(IN) |
DOMComment to check. |
Casts the given DOMComment to a DOMNode, and returns that DOMNode.
FUNCTION makeNode( com DOMComment) RETURN DOMNode;
Parameter | IN / OUT | Description |
---|---|---|
com |
(IN) |
DOMComment to cast. |
Checks that the given DOMImplementation is NULL
; returns TRUE
if it is NULL
, FALSE
otherwise.
FUNCTION isNull( di DOMImplementation) RETURN BOOLEAN;
Parameter | IN / OUT | Description |
---|---|---|
di |
(IN) |
DOMImplementation to check. |
Test if the DOM implementation implements a specific feature.
FUNCTION hasFeature( di DOMImplementation, feature IN VARCHAR2, version IN VARCHAR2) RETURN BOOLEAN;
Parameter | IN / OUT | Description |
---|---|---|
di |
IN |
DOMImplementation |
feature |
IN |
The feature to check for |
version |
IN |
The version of the DOM to check in |
Checks that the given DOMDocumentFragment is NULL
; returns TRUE
if it is NULL
, FALSE
otherwise.
FUNCTION isNull( df DOMDocumentFragment) RETURN BOOLEAN;
Parameter | IN / OUT | Description |
---|---|---|
df |
(IN) |
DOMDocumentFragment to check. |
Casts the given DOMDocumentFragment to a DOMNode, and returns that DOMNode.
FUNCTION makeNode( df DOMDocumentFragment) RETURN DOMNode;
Parameter | IN / OUT | Description |
---|---|---|
df |
(IN) |
DOMDocumentFragment to cast. |
Checks that the given DOMDocumentType is NULL
; returns TRUE
if it is NULL
, FALSE
otherwise.
FUNCTION isNull( dt DOMDocumentType) RETURN BOOLEAN;
Parameter | IN / OUT | Description |
---|---|---|
dt |
(IN) |
DOMDocumentType to check. |
Casts the given DOMDocumentType to a DOMNode, and returns that DOMNode.
FUNCTION makeNode( dt DOMDocumentType) RETURN DOMNode;
Parameter | IN / OUT | Description |
---|---|---|
dt |
(IN) |
DOMDocumentType to cast. |
Finds an entity in the given DTD; returns that entity if found.
FUNCTION findEntity( dt DOMDocumentType, name VARCHAR2, par BOOLEAN) RETURN DOMEntity;
Parameter | IN / OUT | Description |
---|---|---|
dt |
(IN) |
The DTD. |
name |
(IN) |
Entity to find. |
par |
(IN) |
Flag to indicate type of entity; |
Finds the notation in the given DTD; returns it, if found.
FUNCTION findNotation( dt DOMDocumentType, name VARCHAR2) RETURN DOMNotation;
Parameter | IN / OUT | Description |
---|---|---|
dt |
(IN) |
The DTD. |
name |
(IN) |
The notation to find. |
Returns the public id of the given DTD.
FUNCTION getPublicId( dt DOMDocumentType) RETURN VARCHAR2;
Parameter | IN / OUT | Description |
---|---|---|
dt |
(IN) |
The DTD. |
Returns the system id of the given DTD.
FUNCTION getSystemId( dt DOMDocumentType) RETURN VARCHAR2;
Parameter | IN / OUT | Description |
---|---|---|
dt |
(IN) |
The DTD. |
Writes DTD to a specified file. The options are given in the following table.
Parameter | IN / OUT | Description |
---|---|---|
dt |
(IN) |
The DTD. |
fileName |
(IN) |
The file to write to. |
charset |
(IN) |
Character set. |
Writes DTD to a specified buffer. The options are given in the following table.
Parameter | IN / OUT | Description |
---|---|---|
dt |
(IN) |
The DTD. |
buffer |
(IN/OUT) |
The buffer to write to. |
charset |
(IN) |
Character set. |
Writes DTD to a specified clob. The options are given in the following table.
Parameter | IN / OUT | Description |
---|---|---|
dt |
(IN) |
The DTD. |
cl |
(IN/OUT) |
The clob to write to. |
charset |
(IN) |
Character set. |
Retrieves the name of DTD, or the name immediately following the DOCTYPE keyword.
FUNCTION getName( dt DOMDocumentType) RETURN VARCHAR2;
Parameter | IN / OUT | Description |
---|---|---|
dt |
IN |
DOMDocumentType |
Retrieves a NamedNodeMap containing the general entities, both external and internal, declared in the DTD.
FUNCTION getEntities( dt DOMDocumentType) RETURN DOMNamedNodeMap;
Parameter | IN / OUT | Description |
---|---|---|
dt |
IN |
DOMDocumentType |
Retrieves a NamedNodeMap containing the notations declared in the DTD.
FUNCTION getNotations( dt DOMDocumentType) RETURN DOMNamedNodeMap;
Parameter | IN / OUT | Description |
---|---|---|
dt |
IN |
DOMDocumentType |
Checks that the given DOMElement is NULL
; returns TRUE
if it is NULL
, FALSE
otherwise.
FUNCTION isNull( elem DOMElement) RETURN BOOLEAN;
Parameter | IN / OUT | Description |
---|---|---|
elem |
(IN) |
DOMElement to check. |
Casts the given DOMElement to a DOMNode, and returns that DOMNode.
FUNCTION makeNode( elem DOMElement) RETURN DOMNode;
Parameter | IN / OUT | Description |
---|---|---|
elem |
(IN) |
DOMElement to cast. |
Returns the qualified name of the DOMElement.
FUNCTION getQualifiedName( elem DOMElement) RETURN VARCHAR2;
Parameter | IN / OUT | Description |
---|---|---|
elem |
(IN) |
DOMElement. |
Returns the namespace of the DOMElement.
FUNCTION getNamespace( elem DOMElement) RETURN VARCHAR2;
Parameter | IN / OUT | Description |
---|---|---|
elem |
(IN) |
DOMElement. |
Returns the local name of the DOMElement.
FUNCTION getLocalName( elem DOMElement) RETURN VARCHAR2;
Parameter | IN / OUT | Description |
---|---|---|
elem |
(IN) |
DOMElement. |
Returns the expanded name of the DOMElement.
FUNCTION getExpandedName( elem DOMElement) RETURN VARCHAR2;
Parameter | IN / OUT | Description |
---|---|---|
elem |
(IN) |
DOMElement. |
Returns the children of the DOMElement. The options are given in the following table.
Parameter | IN / OUT | Description |
---|---|---|
elem |
(IN) |
The DOMElement. |
name |
(IN) |
Tag name; * matches any tag. |
ns |
(IN) |
Namespace. |
Returns the element children of the DOMElement. The options are given in the following table.
elem |
(IN) |
The DOMElement. |
name |
(IN) |
Tag name; * matches any tag. |
ns |
(IN) |
Namespace. |
Resolves the given namespace prefix, and returns the resolved namespace.
FUNCTION resolveNamespacePrefix( elem DOMElement, prefix VARCHAR2) RETURN VARCHAR2;
Parameter | IN / OUT | Description |
---|---|---|
elem |
(IN) |
The DOMElement. |
prefix |
(IN) |
Namespace prefix. |
Returns the name of the DOMElement.
FUNCTION getTagName(elem DOMElement) RETURN VARCHAR2;
Parameter | IN / OUT | Description |
---|---|---|
elem |
(IN) |
The DOMElement. |
Returns the value of a DOMElement's attribute by name.
FUNCTION getAttribute( elem DOMElement, name IN VARCHAR2) RETURN VARCHAR2;
Parameter | IN / OUT | Description |
---|---|---|
elem |
(IN) |
The DOMElement. |
name |
(IN) |
Attribute name; * matches any attribute. |
Sets the value of a DOMElement's attribute by name.
PROCEDURE setAttribute( elem DOMElement, name IN VARCHAR2, value IN VARCHAR2);
Parameter | IN / OUT | Description |
---|---|---|
elem |
(IN) |
The DOMElement. |
name |
(IN) |
Attribute name; * matches any attribute. |
value |
(IN) |
Attribute value |
Removes an attribute from the DOMElement by name.
PROCEDURE removeAttribute( elem DOMElement, name IN VARCHAR2);
Parameter | IN / OUT | Description |
---|---|---|
elem |
(IN) |
The DOMElement. |
name |
(IN) |
Attribute name; * matches any attribute. |
Returns an attribute node from the DOMElement by name.
FUNCTION getAttributeNode( elem DOMElement, name IN VARCHAR2) RETURN DOMAttr;
Parameter | IN / OUT | Description |
---|---|---|
elem |
(IN) |
The DOMElement. |
name |
(IN) |
Attribute name; * matches any attribute. |
Adds a new attribute node to the DOMElement.
FUNCTION setAttributeNode( elem DOMElement, newAttr IN DOMAttr) RETURN DOMAttr;
Parameter | IN / OUT | Description |
---|---|---|
elem |
(IN) |
The DOMElement. |
newAttr |
(IN) |
The new DOMAttr. |
Removes the specified attribute node from the DOMElement.
FUNCTION removeAttributeNode( elem DOMElement, oldAttr IN DOMAttr) RETURN DOMAttr;
Parameter | IN / OUT | Description |
---|---|---|
elem |
(IN) |
The DOMElement. |
oldAttr |
(IN) |
The old DOMAttr. |
Normalizes the text children of the DOMElement.
PROCEDURE normalize( elem DOMElement);
Parameter | IN / OUT | Description |
---|---|---|
elem |
(IN) |
The DOMElement. |
Checks that the given DOMEntity is NULL
; returns TRUE
if it is NULL
, FALSE
otherwise.
FUNCTION isNull( ent DOMEntity) RETURN BOOLEAN;
Parameter | IN / OUT | Description |
---|---|---|
ent |
(IN) |
DOMEntity to check. |
Casts given DOMEntity to a DOMNode, and returns that DOMNode.
FUNCTION makeNode( ent DOMEntity) RETURN DOMNode;
Parameter | IN / OUT | Description |
---|---|---|
ent |
(IN) |
DOMEntity to cast. |
Returns the public identifier of the DOMEntity.
FUNCTION getPublicId( ent DOMEntity) RETURN VARCHAR2;
Parameter | IN / OUT | Description |
---|---|---|
ent |
(IN) |
DOMEntity. |
Returns the system identifier of the DOMEntity.
FUNCTION getSystemId( ent DOMEntity) RETURN VARCHAR2;
Parameter | IN / OUT | Description |
---|---|---|
ent |
(IN) |
DOMEntity. |
Returns the notation name of the DOMEntity.
FUNCTION getNotationName( ent DOMEntity) RETURN VARCHAR2;
Parameter | IN / OUT | Description |
---|---|---|
ent |
(IN) |
DOMEntity. |
Checks that the given DOMEntityRef is NULL
; returns TRUE
if it is NULL
, FALSE
otherwise.
FUNCTION isNull( eref DOMEntityReference) RETURN BOOLEAN;
Parameter | IN / OUT | Description |
---|---|---|
eref |
(IN) |
DOMEntityReference to check. |
Casts the DOMEntityReference to a DOMNode, and returns that DOMNode.
FUNCTION makeNode( eref DOMEntityReference) RETURN DOMNode;
Parameter | IN / OUT | Description |
---|---|---|
eref |
(IN) |
DOMEntityReference to cast. |
Checks that the given DOMNotation is NULL
; returns TRUE
if it is NULL
, FALSE
otherwise.
FUNCTION isNull( n DOMNotation) RETURN BOOLEAN;
Parameter | IN / OUT | Description |
---|---|---|
n |
(IN) |
DOMNotation to check. |
Casts the DOMNotation to a DOMNode, and returns that DOMNode.
FUNCTION makeNode( n DOMNotation) RETURN DOMNode;
Parameter | IN / OUT | Description |
---|---|---|
n |
(IN) |
DOMNotation to cast. |
Returns the public identifier of the DOMNotation.
FUNCTION getPublicId( n DOMNotation) RETURN VARCHAR2;
Parameter | IN / OUT | Description |
---|---|---|
n |
(IN) |
DOMNotation. |
Returns the system identifier of the DOMNotation.
FUNCTION getSystemId( n DOMNotation) RETURN VARCHAR2;
Parameter | IN / OUT | Description |
---|---|---|
n |
(IN) |
DOMNotation. |
Checks that the given DOMProcessingInstruction is NULL
; returns TRUE
if it is NULL
, FALSE
otherwise.
FUNCTION isNull( pi DOMProcessingInstruction) RETURN BOOLEAN;
Parameter | IN / OUT | Description |
---|---|---|
pi |
(IN) |
DOMProcessingInstruction to check. |
Casts the DOMProcessingInstruction to a DOMNode, and returns that DOMNode.
FUNCTION makeNode( pi DOMProcessingInstruction) RETURN DOMNode;
Parameter | IN / OUT | Description |
---|---|---|
pi |
(IN) |
DOMProcessingInstruction to cast. |
Returns the content data of the DOMProcessingInstruction.
FUNCTION getData( pi DOMProcessingInstruction) RETURN VARCHAR2;
Parameter | IN / OUT | Description |
---|---|---|
pi |
(IN) |
DOMProcessingInstruction. |
Returns the target of the DOMProcessingInstruction.
FUNCTION getTarget( pi DOMProcessingInstruction) RETURN VARCHAR2;
Parameter | IN / OUT | Description |
---|---|---|
pi |
(IN) |
DOMProcessingInstruction. |
Sets the content data of the DOMProcessingInstruction.
PROCEDURE setData( pi DOMProcessingInstruction, data IN VARCHAR2);
Parameter | IN / OUT | Description |
---|---|---|
pi |
(IN) |
DOMProcessingInstruction. |
data |
(IN) |
New processing instruction content data. |
Checks that the given DOMText is NULL
; returns TRUE
if it is NULL
, FALSE
otherwise.
FUNCTION isNull( t DOMText) RETURN BOOLEAN;
Parameter | IN / OUT | Description |
---|---|---|
t |
(IN) |
DOMText to check. |
Casts the DOMText to a DOMNode, and returns that DOMNode.
FUNCTION makeNode( t DOMText) RETURN DOMNode;
Parameter | IN / OUT | Description |
---|---|---|
t |
(IN) |
DOMText to cast. |
Breaks this DOMText node into two DOMText nodes at the specified offset.
FUNCTION splitText( t DOMText, offset IN NUMBER) RETURN DOMText;
Parameter | IN / OUT | Description |
---|---|---|
t |
(IN) |
DOMText |
offset |
(IN) |
Offset at which to split. |
Checks that the given DOMDocument is NULL
; returns TRUE
if it is NULL
, FALSE
otherwise.
FUNCTION isNull( doc DOMDocument) RETURN BOOLEAN;
Parameter | IN / OUT | Description |
---|---|---|
doc |
(IN) |
DOMDocument to check. |
Casts the DOMDocument to a DOMNode, and returns that DOMNode.
FUNCTION makeNode( doc DOMDocument) RETURN DOMNode;
Parameter | IN / OUT | Description |
---|---|---|
doc |
(IN) |
DOMDocument to cast. |
Returns a new DOMDocument instance.
FUNCTION newDOMDocument RETURN DOMDocument;
Frees DOMDocument object.
PROCEDURE freeDocument( doc DOMDocument);
Parameter | IN / OUT | Description |
---|---|---|
doc |
(IN) |
DOMDocument. |
Returns the version information for the XML document.
FUNCTION getVersion( doc DOMDocument) RETURN VARCHAR2;
Parameter | IN / OUT | Description |
---|---|---|
doc |
(IN) |
DOMDocument. |
Sets version information for the XML document.
PROCEDURE setVersion( doc DOMDocument, version VARCHAR2);
Parameter | IN / OUT | Description |
---|---|---|
doc |
(IN) |
DOMDocument. |
version |
((N) |
Version information. |
Retrieves the character set of the XML document.
FUNCTION getCharset( doc DOMDocument) RETURN VARCHAR2;
Parameter | IN / OUT | Description |
---|---|---|
doc |
(IN) |
DOMDocument. |
Sets character set of the XML document.
PROCEDURE setCharset( doc DOMDocument, charset VARCHAR2);
Parameter | IN / OUT | Description |
---|---|---|
doc |
(IN) |
DOMDocument. |
charset |
((N) |
Character set. |
Retrieves standalone information for the XML document.
FUNCTION getStandalone( doc DOMDocument) RETURN VARCHAR2;
Parameter | IN / OUT | Description |
---|---|---|
doc |
(IN) |
DOMDocument. |
Sets standalone information for the XML document.
PROCEDURE setStandalone( doc DOMDocument, value VARCHAR2);
Parameter | IN / OUT | Description |
---|---|---|
doc |
(IN) |
DOMDocument. |
value |
((N) |
Standalone information |
Writes XML document to a specified file. The options are given in the following table.
Syntax | Description |
---|---|
fileName VARCHAR2); |
Writes XML document to a specified file using database character set. |
charset VARCHAR2); |
Writes XML document to a specified file using given character set. |
Parameter | IN / OUT | Description |
---|---|---|
doc |
(IN) |
DOMDocument. |
filename |
(N) |
File to write to. |
charset |
(IN) |
Character set. |
Writes XML document to a specified buffer. The options are given in the following table.
Parameter | IN / OUT | Description |
---|---|---|
doc |
(IN) |
DOMDocument. |
buffer |
(N/OUT) |
Buffer to write to. |
charset |
(IN) |
Character set. |
Writes XML document to a specified clob. The options are given in the following table.
Syntax | Description |
---|---|
cl IN OUT CLOB); |
Writes XML document to a specified clob using database character set. |
charset VARCHAR2); |
Writes XML document to a specified clob using given character set. |
Parameter | IN / OUT | Description |
---|---|---|
doc |
(IN) |
DOMDocument. |
cl |
(N/OUT) |
Buffer to write to. |
charset |
(IN) |
Character set. |
Writes an external DTD to specified file. The options are given in the following table.
Parameter | IN / OUT | Description |
---|---|---|
doc |
(IN) |
DOMDocument. |
fileName |
(N) |
File to write to. |
charset |
(IN) |
Character set. |
Writes an external DTD to specified buffer. The options are given in the following table.
Parameter | IN / OUT | Description |
---|---|---|
doc |
(IN) |
DOMDocument. |
buffer |
(N/OUT) |
Buffer to write to. |
charset |
(IN) |
Character set. |
Writes an external DTD to specified clob. The options are given in the following table.
Parameter | IN / OUT | Description |
---|---|---|
doc |
(IN) |
DOMDocument. |
cl |
(N) |
Clob to write to. |
charset |
(IN) |
Character set. |
Returns the DTD associated to the DOMDocument.
FUNCTION getDoctype( doc DOMDocument) RETURN DOMDocumentType;
Parameter | IN / OUT | Description |
---|---|---|
doc |
(IN) |
DOMDocument. |
Returns the DOMImplementation object that handles this DOMDocument.
FUNCTION getImplementation( doc DOMDocument) RETURN DOMImplementation;
Parameter | IN / OUT | Description |
---|---|---|
doc |
(IN) |
DOMDocument. |
Returns the child node, or the document element of the DOMDocument.
FUNCTION getDocumentElement( doc DOMDocument) RETURN DOMElement;
Parameter | IN / OUT | Description |
---|---|---|
doc |
(IN) |
DOMDocument. |
Creates a DOMElement.
FUNCTION createElement( doc DOMDocument, tagName IN VARCHAR2) RETURN DOMElement;
Parameter | IN / OUT | Description |
---|---|---|
doc |
(IN) |
DOMDocument. |
tagName |
(IN) |
Tagname for new DOMElement. |
Creates a DOMDocumentFragment.
FUNCTION createDocumentFragment( doc DOMDocument) RETURN DOMDocumentFragment;
Parameter | IN / OUT | Description |
---|---|---|
doc |
(IN) |
DOMDocument. |
Creates a DOMText node.
FUNCTION createTextNode( doc DOMDocument, data IN VARCHAR2) RETURN DOMText;
Parameter | IN / OUT | Description |
---|---|---|
doc |
(IN) |
DOMDocument. |
data |
(IN) |
Content of the DOMText node. |
Creates a DOMComment node.
FUNCTION createComment( doc DOMDocument, data IN VARCHAR2) RETURN DOMComment;
Parameter | IN / OUT | Description |
---|---|---|
doc |
(IN) |
DOMDocument. |
data |
(IN) |
Content of the DOMComment node. |
Creates a DOMCDATASection node.
FUNCTION createCDATASection( doc DOMDocument, data IN VARCHAR2) RETURN DOMCDATASection;
Parameter | IN / OUT | Description |
---|---|---|
doc |
(IN) |
DOMDocument. |
data |
(IN) |
Content of the DOMCDATASection node. |
Creates a DOMProcessingInstruction node.
FUNCTION createProcessingInstruction( doc DOMDocument, target IN VARCHAR2, data IN VARCHAR2) RETURN DOMProcessingInstruction;
Parameter | IN / OUT | Description |
---|---|---|
doc |
(IN) |
DOMDocument. |
target |
(IN) |
Target of the new processing instruction. |
data |
(IN) |
Content data of the new processing instruction. |
Creates a DOMAttr node.
FUNCTION createAttribute( doc DOMDocument, name IN VARCHAR2) RETURN DOMAttr;
Parameter | IN / OUT | Description |
---|---|---|
doc |
(IN) |
DOMDocument. |
name |
(IN) |
New attribute name. |
Creates a DOMEntityReference node.
FUNCTION createEntityReference( doc DOMDocument, name IN VARCHAR2) RETURN DOMEntityReference;
Parameter | IN / OUT | Description |
---|---|---|
doc |
(IN) |
DOMDocument. |
name |
(IN) |
New entity reference name. |
Returns a DOMNodeList of all the elements with a given tagname.
FUNCTION getElementsByTagName( doc DOMDocument, tagname IN VARCHAR2) RETURN DOMNodeList;
Parameter | IN / OUT | Description |
---|---|---|
doc |
(IN) |
DOMDocument. |
tagname |
(IN) |
Name of the tag to match on. |
|
Copyright © 2001, 2002 Oracle Corporation. All Rights Reserved. |
|