Skip Headers

Oracle9i XML API Reference - XDK and Oracle XML DB
Release 2 (9.2)

Part Number A96616-01
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents
Go To Index
Index

Master Index

Feedback

Go to previous page Go to next page

25
PL/SQL DOM API for XMLType

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:


DBMS_XMLDOM Package


Description of DBMS_XMLDOM

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:

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.


Types of DBMS_XMLDOM

The following types are defined for DBMS_XMLDOM.DOMTYPE:

Table 25-1 DBMS_XMLDOM Types  
Type Description

DOMNode

Implements the DOM Node interface.

DOMNamedNodeMap

Implements the DOM NamedNodeMap interface.

DOMNodeList

Implements the DOM NodeList interface.

DOMAttr

Implements the DOM Attribute interface.

DOMCDataSection

Implements the DOM CDataSection interface.

DOMCharacterData

Implements the DOM Character Data interface.

DOMComment

Implements the DOM Comment interface.

DOMDocumentFragment

Implements the DOM DocumentFragment interface.

DOMElement

Implements the DOM Element interface.

DOMEntity

Implements the DOM Entity interface.

DOMEntityReference

Implements the DOM EntityReference interface.

DOMNotation

Implements the DOM Notation interface.

DOMProcessingInstruction

Implements the DOM Processing instruction interface.

DOMText

Implements the DOM Text interface.

DOMImplementation

Implements the DOM DOMImplementation interface.

DOMDocumentType

Implements the DOM Document Type interface.

DOMDocument

Implements the DOM Document interface.


Defined Constants of DBMS_XMLDOM

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.

Table 25-2 Defined Constants for DBMS_XMLDDOM
Constant Description

ELEMENT_NODE

The Node is an Element.

ATTRIBUTE_NODE

The Node is an Attribute.

TEXT_NODE

The Node is a Text node.

CDATA_SECTION_NODE

The Node is a CDataSection.

ENTITY_REFERENCE_NODE

The Node is an Entity Reference.

ENTITY_NODE

The Node is an Entity.

PROCESSING_INSTRUCTION_NODE

The Node is a Processing Instruction.

COMMENT_NODE

The Node is a Comment.

DOCUMENT_NODE

The Node is a Document.

DOCUMENT_TYPE_NODE

The Node is a Document Type Definition.

DOCUMENT_FRAGMENT_NODE

The Node is a Document fragment.

NOTATION_NODE

The Node is a Notation.


Exceptions of DBMS_XMLDOM

The exceptions listed in Table 25-3 are defined for DBMS_XMLDOM:

Table 25-3 Exceptions for DBMS_XMLDDOM
Exception Description

INDEX_SIZE_ERR

If index or size is negative, or greater than the allowed value.

DOMSTRING_SIZE_ERR

If the specified range of text does not fit into a DOMString.

HIERARCHY_REQUEST_ERR

If any node is inserted somewhere it doesn't belong.

WRONG_DOCUMENT_ERR

If a node is used in a different document than the one that created it (that doesn't support it).

INVALID_CHARACTER_ERR

If an invalid or illegal character is specified, such as in a name. See production 2 in the XML specification for the definition of a legal character, and production 5 for the definition of a legal name character.

NO_DATA_ALLOWED_ERROR

If data is specified for a node which does not support data.

NO_MODIFICATION_ALLOWED_ERR

If an attempt is made to modify an object where modifications are not allowed.

NO_FOUND_ERR

If an attempt is made to reference a node in a context where it does not exist.

NOT_SUPPORTED_ERR

If the implementation does not support the requested type of object or operation.

INUSE_ATTRIBUTE_ERR

If an attempt is made to add an attribute that is already in use elsewhere.


Methods of DBMS_XMLDOM

DBMS_XMLDOM subprograms are divided into groups according to w3c Interfaces.

Table 25-4 Summary of Methods of DBMS_XMLDOM  
Group/Method Description

DOM Node Methods

isNull()

Tests if the node is NULL.

makeAttr()

Casts the node to an Attribute.

makeCDataSection()

Casts the node to a CDataSection.

makeCharacterData()

Casts the node to CharacterData.

makeComment()

Casts the node to a Comment.

makeDocumentFragment()

Casts the node to a DocumentFragment.

makeDocumentType()

Casts the node to a Document Type.

makeElement()

Casts the node to an Element.

makeEntity()

Casts the node to an Entity.

makeEntityReference()

Casts the node to an EntityReference.

makeNotation()

Casts the node to a Notation.

makeProcessingInstruction()

Casts the node to a DOMProcessingInstruction.

makeText()

Casts the node to a DOMText.

makeDocument()

Casts the node to a DOMDocument.

writeToFile()

Writes the contents of the node to a file.

writeToBuffer()

Writes the contents of the node to a buffer.

writeToClob()

Writes the contents of the node to a clob.

getNodeName()

Retrieves the Name of the Node.

getNodeValue()

Retrieves the Value of the Node.

setNodeValue()

Sets the Value of the Node.

getNodeType()

Retrieves the Type of the node.

getParentNode()

Retrieves the parent of the node.

getChildNodes()

Retrieves the children of the node.

getFirstChild()

Retrieves the first child of the node.

getLastChild()

Retrieves the last child of the node.

getPreviousSibling()

Retrieves the previous sibling of the node.

getNextSibling()

Retrieves the next sibling of the node.

getAttributes()

Retrieves the attributes of the node.

getOwnerDocument()

Retrieves the owner document of the node.

insertBefore()

Inserts a child before the reference child.

replaceChild()

Replaces the old child with a new child.

removeChild()

Removes a specified child from a node.

appendChild()

Appends a new child to the node.

hasChildNodes()

Tests if the node has child nodes.

cloneNode()

Clones the node.

DOM Named Node Map methods

isNull()

Tests if the NamedNodeMap is NULL.

getNamedItem()

Retrieves the item specified by the name.

setNamedItem()

Sets the item in the map specified by the name.

removeNamedItem()

Removes the item specified by name.

item()

Retrieves the item given the index in the map.

getLength()

Retrieves the number of items in the map.

DOM Node List Methods

isNull()

Tests if the Nodelist is NULL.

item()

Retrieves the item given the index in the nodelist.

getLength()

Retrieves the number of items in the list.

DOM Attr Methods

isNull()

Tests if the Attribute Node is NULL.

makeNode()

Casts the Attribute to a node.

getQualifiedName()

Retrieves the Qualified Name of the attribute.

getNamespace()

Retrieves the NS URI of the attribute.

getLocalName()

Retrieves the local name of the attribute.

getExpandedName()

Retrieves the expanded name of the attribute.

getName()

Retrieves the name of the attribute.

getSpecified()

Tests if attribute was specified in the owning element.

getValue()

Retrieves the value of the attribute.

setValue()

Sets the value of the attribute.

DOM C Data Section Methods

isNull()

Tests if the CDataSection is NULL.

makeNode()

Casts the CDatasection to a node.

DOM Character Data Methods

isNull()

Tests if the CharacterData is NULL.

makeNode()

Casts the CharacterData to a node.

getData()

Retrieves the data of the node.

setData()

Sets the data to the node.

getLength()

Retrieves the length of the data.

substringData()

Retrieves the substring of the data.

appendData()

Appends the given data to the node data.

insertData()

Inserts the data in the node at the given offSets.

deleteData()

Deletes the data from the given offSets.

replaceData()

Replaces the data from the given offSets.

DOM Comment Methods

isNull()

Tests if the comment is NULL.

makeNode()

Casts the Comment to a node.

DOM Implementation Methods

isNull()

Tests if the DOMImplementation node is NULL.

hasFeature()

Tests if the DOMImplementation implements a given feature.

DOM Document Fragment Methods

isNull()

Tests if the DocumentFragment is NULL.

makeNode()

Casts the Document Fragment to a node.

DOM Document Type Methods

isNull()

Tests if the Document Type is NULL.

makeNode()

Casts the document type to a node.

findEntity()

Finds the specified entity in the document type.

findNotation()

Finds the specified notation in the document type.

getPublicId()

Retrieves the public ID of the document type.

getSystemId()

Retrieves the system ID of the document type.

writeExternalDTDToFile()

Writes the document type definition to a file.

writeExternalDTDToBuffer()

Writes the document type definition to a buffer.

writeExternalDTDToClob()

Writes the document type definition to a clob.

getName()

Retrieves the name of the Document type.

getEntities()

Retrieves the nodemap of entities in the Document type.

getNotations()

Retrieves the nodemap of the notations in the Document type.

DOM Element Methods

isNull()

Tests if the Element is NULL.

makeNode()

Casts the Element to a node.

getQualifiedName()

Retrieves the qualified name of the element.

getNamespace()

Retrieves the NS URI of the element.

getLocalName()

Retrieves the local name of the element.

getExpandedName()

Retrieves the expanded name of the element.

getChildrenByTagName()

Retrieves the children of the element by tag name.

getElementsByTagName()

Retrieves the elements in the subtree by tagname.

resolveNamespacePrefix()

Resolve the prefix to a namespace uri.

getTagName()

Retrieves the Tag name of the element.

getAttribute()

Retrieves the attribute node specified by the name.

setAttribute()

Sets the attribute specified by the name.

removeAttribute()

Removes the attribute specified by the name.

getAttributeNode()

Retrieves the attribute node specified by the name.

setAttributeNode()

Sets the attribute node in the element.

removeAttributeNode()

Removes the attribute node in the element.

normalize()

Normalizes the text children of the element.

DOM Entity Methods

isNull()

Tests if the Entity is NULL.

makeNode()

Casts the Entity to a node.

getPublicId()

Retrieves the public Id of the entity.

getSystemId()

Retrieves the system Id of the entity.

getNotationName()

Retrieves the notation name of the entity.

DOM Entity Reference Methods

isNull()

Tests if the Entity Reference is NULL.

makeNode()

Casts the Entity Reference to NULL.

DOM Notation Methods

isNull()

Tests if the Notation is NULL.

makeNode()

Casts the notation to a node.

getPublicId()

Retrieves the public Id of the notation.

getSystemId()

Retrieves the system Id of the notation.

DOM Processing Instruction Methods

isNull()

Tests if the Processing Instruction is NULL.

makeNode()

Casts the Processing Instruction to a node.

getData()

Retrieves the data of the processing instruction.

getTarget()

Retrieves the target of the processing instruction.

setData()

Sets the data of the processing instruction.

DOM Text Methods

isNull()

Tests if the text is NULL.

makeNode()

Casts the text to a node.

splitText()

Splits the contents of the text node into 2 text nodes.

DOM Document Methods

isNull()

Tests if the document is NULL.

makeNode()

Casts the document to a node.

newDOMDocument()

Creates a new Document.

freeDocument()

Frees the document.

getVersion()

Retrieves the version of the document.

setVersion()

Sets the version of the document.

getCharset()

Retrieves the Character set of the document.

setCharset()

Sets the Character set of the document.

getStandalone()

Retrieves if the document is specified as standalone.

setStandalone()

Sets the document standalone.

writeToFile()

Writes the document to a file.

writeToBuffer()

Writes the document to a buffer.

writeToClob()

Writes the document to a clob.

writeExternalDTDToFile()

Writes the DTD of the document to a file.

writeExternalDTDToBuffer()

Writes the DTD of the document to a buffer.

writeExternalDTDToClob()

Writes the DTD of the document to a clob.

getDoctype()

Retrieves the DTD of the document.

getImplementation()

Retrieves the DOM implementation.

getDocumentElement()

Retrieves the root element of the document.

createElement()

Creates a new Element.

createDocumentFragment()

Creates a new Document Fragment.

createTextNode()

Creates a Text node.

createComment()

Creates a Comment node.

createCDATASection()

Creates a CDatasection node.

createProcessingInstruction()

Creates a Processing Instruction.

createAttribute()

Creates an Attribute.

createEntityReference()

Creates an Entity reference.

getElementsByTagName()

Retrieves the elements in the by tag name.

DOM Node Methods

isNull()

Description

Checks if the given DOMNode is NULL. Returns TRUE if it is NULL, FALSE otherwise.

Syntax

FUNCTION isNull( n DOMNode) RETURN BOOLEAN;

Parameter IN / OUT Description

n

(IN)

DOMNode to check.

makeAttr()

Description

Casts a given DOMNode to a DOMAttr, and returns the DOMAttr.

Syntax

FUNCTION makeAttr( n DOMNode) RETURN DOMAttr;

Parameter IN / OUT Description

n

(IN)

DOMNode to cast

makeCDataSection()

Description

Casts a given DOMNode to a DOMCDataSection, and returns the DOMCDataSection.

Syntax

FUNCTION makeCDataSection( n DOMNode) RETURN DOMCDataSection;

Parameter IN / OUT Description

n

(IN)

DOMNode to cast

makeCharacterData()

Description

Casts a given DOMNode to a DOMCharacterData, and returns the DOMCharacterData.

Syntax

FUNCTION makeCharacterData( n DOMNode) RETURN DOMCharacterData;

Parameter IN / OUT Description

n

(IN)

DOMNode to cast

makeComment()

Description

Casts a given DOMNode to a DOMComment, and returns the DOMComment.

Syntax

FUNCTION makeComment(n DOMNode) RETURN DOMComment;

Parameter IN / OUT Description

n

(IN)

DOMNode to cast

makeDocumentFragment()

Description

Casts a given DOMNode to a DOMDocumentFragment, and returns the DOMDocumentFragment.

Syntax

FUNCTION makeDocumentFragment( n DOMNode) RETURN DOMDocumentFragment;

Parameter IN / OUT Description

n

(IN)

DOMNode to cast

makeDocumentType()

Description

Casts a given DOMNode to a DOMDocumentType and returns the DOMDocumentType.

Syntax

FUNCTION makeDocumentType(n DOMNode) RETURN DOMDocumentType;

Parameter IN / OUT Description

n

(IN)

DOMNode to cast

makeElement()

Description

Casts a given DOMNode to a DOMElement, and returns the DOMElement.

Syntax

FUNCTION makeElement(n DOMNode) RETURN DOMElement;

Parameter IN / OUT Description

n

(IN)

DOMNode to cast

makeEntity()

Description

Casts a given DOMNode to a DOMEntity, and returns the DOMEntity.

Syntax

FUNCTION makeEntity(n DOMNode) RETURN DOMEntity;

Parameter IN / OUT Description

n

(IN)

DOMNode to cast

makeEntityReference()

Description

Casts a given DOMNode to a DOMEntityReference, and returns the DOMEntityReference.

Syntax

FUNCTION makeEntityReference(n DOMNode) RETURN DOMEntityReference;

Parameter IN / OUT Description

n

(IN)

DOMNode to cast

makeNotation()

Description

Casts a given DOMNode to a DOMNotation, and returns the DOMNotation.

Syntax

FUNCTION makeNotation(n DOMNode) RETURN DOMNotation;

Parameter IN / OUT Description

n

(IN)

DOMNode to cast

makeProcessingInstruction()

Description

Casts a given DOMNode to a DOMProcessingInstruction, and returns the DOMProcessingInstruction.

Syntax

FUNCTION makeProcessingInstruction( n DOMNode)
                                    RETURN DOMProcessingInstruction;

Parameter IN / OUT Description

n

(IN)

DOMNode to cast

makeText()

Description

Casts a given DOMNode to a DOMText, and returns the DOMText.

Syntax

FUNCTION makeText(n DOMNode) RETURN DOMText;

Parameter IN / OUT Description

n

(IN)

DOMNode to cast

makeDocument()

Description

Casts a given DOMNode to a DOMDocument, and returns the DOMDocument.

Syntax

FUNCTION makeDocument(n DOMNode) RETURN DOMDocument;

Parameter IN / OUT Description

n

(IN)

DOMNode to cast

writeToFile()

Description

Writes XML node to specified file. The options are given in the following table.

Syntax Description

PROCEDURE writeToFile(

n DOMNode,

fileName VARCHAR2);

Writes XML node to specified file using the database character set.

PROCEDURE writeToFile(

n DOMNode,

fileName VARCHAR2,

charset VARCHAR2);

Writes XML node to specified file using the given character set, which is passed in as a separate parameter.

Parameter IN / OUT Description

n

(IN)

DOMNode.

fileName

(IN)

File to write to.

charset

(IN)

Given character set.

writeToBuffer()

Description

Writes XML node to specified buffer. The options are given in the following table.

Syntax Description

PROCEDURE writeToBuffer(

n DOMNode,

buffer IN OUT VARCHAR2);

Writes XML node to specified buffer using the database character set.

PROCEDURE writeToBuffer(

n DOMNode,

buffer IN OUT VARCHAR2,

charset VARCHAR2);

Writes XML node to specified buffer using the given character set, which is passed in as a separate parameter.

Parameter IN / OUT Description

n

(IN)

DOMNode.

buffer

(IN/OUT)

Buffer to write to.

charset

(IN)

Given character set.

writeToClob()

Description

Writes XML node to specified clob. The options are given in the following table.

Syntax Description

PROCEDURE writeToClob(

n DOMNode,

cl IN OUT CLOB);

Writes XML node to specified clob using the database character set.

PROCEDURE writeToClob(

n DOMNode,

cl IN OUT CLOB,

charset VARCHAR2);

Writes XML node to specified clob using the given character set, which is passed in as a separate parameter.

Parameter IN / OUT Description

n

(IN)

DOMNode.

cl

(IN/OUT)

CLOB to write to.

charset

(IN)

Given character set.

getNodeName()

Description

Get the name of the node depending on its type

Syntax

FUNCTION getNodeName(n DOMNode) RETURN VARCHAR2;

Parameter IN / OUT Description

n

IN

DOMNode

getNodeValue()

Description

Get the value of this node, depending on its type.

Syntax

FUNCTION getNodeValue(n DOMNode) RETURN VARCHAR2;

Parameter IN / OUT Description

n

IN

DOMNode.

setNodeValue()

Description

Sets the value of this node, depending on its type. When it is defined to be null, setting it has no effect.

Syntax

PROCEDURE setNodeValue( n DOMNode,
                        nodeValue IN VARCHAR2);

Parameter IN / OUT Description

n

IN

DOMNode.

nodeValue

IN

The value to which node is set.

getNodeType()

Description

Retrieves a code representing the type of the underlying object.

Syntax

FUNCTION getNodeType(n DOMNode) RETURN NUMBER;

Parameter IN / OUT Description

n

IN

DOMNode

getParentNode()

Description

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.

Syntax

FUNCTION getParentNode(n DOMNode) RETURN DOMNode;

Parameter IN / OUT Description

n

IN

DOMNode

getChildNodes()

Description

Retrieves a NodeList that contains all children of this node. If there are no children, this is a NodeList containing no nodes.

Syntax

FUNCTION getChildNodes(n DOMNode) RETURN DOMNodeList;

Parameter IN / OUT Description

n

IN

DOMNode

getFirstChild()

Description

Retrieves the first child of this node. If there is no such node, this returns null.

Syntax

FUNCTION getFirstChild( n DOMNode) RETURN DOMNode;

Parameter IN / OUT Description

n

IN

DOMNode

getLastChild()

Description

Retrieves the last child of this node. If there is no such node, this returns NULL.

Syntax

FUNCTION getLastChild( n DOMNode) RETURN DOMNode;

Parameter IN / OUT Description

n

IN

DOMNode

getPreviousSibling()

Description

Retrieves the node immediately preceding this node. If there is no such node, this returns NULL.

Syntax

FUNCTION getPreviousSibling( n DOMNode) RETURN DOMNode;

Parameter IN / OUT Description

n

IN

DOMNode

getNextSibling()

Description

Retrieves the node immediately following this node. If there is no such node, this returns NULL.

Syntax

FUNCTION getNextSibling( n DOMNode) RETURN DOMNode;

Parameter IN / OUT Description

n

IN

DOMNode

getAttributes()

Description

Retrieves a NamedNodeMap containing the attributes of this node (if it is an Element) or null otherwise.

Syntax

FUNCTION getAttributes( n DOMNode) RETURN DOMNamedNodeMap;

Parameter IN / OUT Description

n

IN

DOMNode

getOwnerDocument()

Description

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.

Syntax

FUNCTION getOwnerDocument( n DOMNode) RETURN DOMDocument;

Parameter IN / OUT Description

n

IN

DOMNode

insertBefore()

Description

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.

Syntax

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 n

refChild

IN

The reference node before which the newChild is to be inserted

replaceChild()

Description

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.

Syntax

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

removeChild()

Description

Removes the child node indicated by oldChild from the list of children, and returns it.

Syntax

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

appendChild()

Description

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.

Syntax

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

hasChildNodes()

Description

Returns whether this node has any children.

Syntax

FUNCTION hasChildNodes( n DOMNode) RETURN BOOLEAN;

Parameter IN / OUT Description

n

IN

DOMNode

cloneNode()

Description

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.

Syntax

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

DOM Named Node Map Methods

isNull()

Description

Checks that the given DOMNamedNodeMap is NULL; returns TRUE if it is NULL, FALSE otherwise.

Syntax

FUNCTION isNull( nnm DOMNamedNodeMap) RETURN BOOLEAN;

Parameter IN / OUT Description

nnm

(IN)

DOMNameNodeMap to check.

getNamedItem()

Description

Retrieves a node specified by name.

Syntax

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

setNamedItem()

Description

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.

Syntax

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.

removeNamedItem()

Description

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.

Syntax

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

item()

Description

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.

Syntax

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

getLength()

Description

The number of nodes in this map. The range of valid child node index is 0 to length-1 inclusive.

Syntax

FUNCTION getLength( nnm DOMNamedNodeMap) RETURN NUMBER;

Parameter IN / OUT Description

nnm

IN

DOMNamedNodeMap

DOM Node List Methods

isNull()

Description

Checks that the given DOMNodeList is NULL; returns TRUE if it is NULL, FALSE otherwise.

Syntax

FUNCTION isNull( nl DOMNodeList) RETURN BOOLEAN;

Parameter IN / OUT Description

nl

(IN)

DOMNodeList to check.

item()

Description

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.

Syntax

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

getLength()

Description

The number of nodes in the list. The range of valid child node index is 0 to length-1 inclusive.

Syntax

FUNCTION getLength( nl DOMNodeList) RETURN NUMBER;

Parameter IN / OUT Description

nl

IN

DOMNodeList

DOM Attr Methods

isNull()

Description

Checks that the given DOMAttr is NULL; returns TRUE if it is NULL, FALSE otherwise.

Syntax

FUNCTION isNull( a DOMAttr) RETURN BOOLEAN;

Parameter IN / OUT Description

a

(IN)

DOMAttr to check.

makeNode()

Description

Casts given DOMAttr to a DOMNode, and returns the DOMNode.

Syntax

FUNCTION makeNode( a DOMAttr) RETURN DOMNode;

Parameter IN / OUT Description

a

(IN)

DOMAttr to cast.

getQualifiedName()

Description

Returns the qualified name of the DOMAttr.

Syntax

FUNCTION getQualifiedName( a DOMAttr) RETURN VARCHAR2;

Parameter IN / OUT Description

a

(IN)

DOMAttr.

getNamespace()

Description

Returns the namespace of the DOMAttr.

Syntax

FUNCTION getNamespace( a DOMAttr) RETURN VARCHAR2;

Parameter IN / OUT Description

a

(IN)

DOMAttr.

getLocalName()

Description

Returns the local name of the DOMAttr.

Syntax

FUNCTION getLocalName( a DOMAttr) RETURN VARCHAR2;

Parameter IN / OUT Description

a

(IN)

DOMAttr.

getExpandedName()

Description

Returns the expanded name of the DOMAttr.

Syntax

FUNCTION getExpandedName( a DOMAttr) RETURN VARCHAR2;

Parameter IN / OUT Description

a

(IN)

DOMAttr.

getName()

Description

Returns the name of this attribute.

Syntax

FUNCTION getName( a DOMAttr) RETURN VARCHAR2;

Parameter IN / OUT Description

a

IN

DOMAttr

getSpecified()

Description

If this attribute was explicitly given a value in the original document, this is true; otherwise, it is false.

Syntax

FUNCTION getSpecified( a DOMAttr) RETURN BOOLEAN;

Parameter IN / OUT Description

a

IN

DOMAttr

getValue()

Description

Retrieves the value of the attribute.

Syntax

FUNCTION getValue( a DOMAttr) RETURN VARCHAR2;

Parameter IN / OUT Description

a

IN

DOMAttr

setValue()

Description

Sets the value of the attribute.

Syntax

PROCEDURE setValue( a DOMAttr,
                    value IN VARCHAR2);

Parameter IN / OUT Description

a

IN

DOMAttr

value

IN

The value to set the attribute to

DOM C Data Section Methods

isNull()

Description

Checks that the given DOMCDataSection is NULL; returns TRUE if it is NULL, FALSE otherwise.

Syntax

FUNCTION isNull( cds DOMCDataSection) RETURN BOOLEAN;

Parameter IN / OUT Description

cds

(IN)

DOMCDataSection to check.

makeNode()

Description

Casts the DOMCDataSection to a DOMNode, and returns that DOMNode.

Syntax

FUNCTION makeNode( cds DOMCDataSection) RETURN DOMNode;

Parameter IN / OUT Description

cds

(IN)

DOMCDataSection to cast.

Character Data Methods

isNull()

Description

Checks that the given DOMCharacterData is NULL; returns TRUE if it is NULL, FALSE otherwise.

Syntax

FUNCTION isNull( cd DOMCharacterData) RETURN BOOLEAN;

Parameter IN / OUT Description

cd

(IN)

DOMCharacterData to check.

makeNode()

Description

Casts the given DOMCharacterData as a DOMNode, and returns that DOMNode.

Syntax

FUNCTION makeNode( cd DOMCharacterData) RETURN DOMNode;

Parameter IN / OUT Description

cd

(IN)

DOMCharacterData to cast

getData()

Description

Gets the character data of the node that implements this interface.

Syntax

FUNCTION getData( cd DOMCharacterData) RETURN VARCHAR2;

Parameter IN / OUT Description

cd

IN

DOMCharacterData

setData()

Description

Sets the character data of the node that implements this interface.

Syntax

PROCEDURE setData( cd DOMCharacterData,
                   data IN VARCHAR2);

Parameter IN / OUT Description

cd

IN

DOMCharacterData

data

IN

The data to set the node to

getLength()

Description

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.

Syntax

FUNCTION getLength( cd DOMCharacterData) RETURN NUMBER;

Parameter IN / OUT Description

cd

IN

DOMCharacterData

substringData()

Description

Extracts a range of data from the node.

Syntax

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.

appendData()

Description

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.

Syntax

PROCEDURE appendData( cd DOMCharacterData, 
                      arg IN VARCHAR2);

Parameter IN / OUT Description

cd

IN

DOMCharacterData.

arg

IN

The data to append to the existing data.

insertData()

Description

Inserts a string at the specified 16-bit unit offset.

Syntax

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.

deleteData()

Description

Removes a range of 16-bit units from the node. Upon success, data and length reflect the change.

Syntax

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.

replaceData()

Description

Remove a range of 16-bit units from the node. Upon success, data and length reflect the change.

Syntax

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.

DOM Comment Methods

isNull()

Description

Checks that the given DOMComment is NULL; returns TRUE if it is NULL, FALSE otherwise.

Syntax

FUNCTION isNull( com DOMComment) RETURN BOOLEAN;

Parameter IN / OUT Description

com

(IN)

DOMComment to check.

makeNode()

Description

Casts the given DOMComment to a DOMNode, and returns that DOMNode.

Syntax

FUNCTION makeNode( com DOMComment) RETURN DOMNode;

Parameter IN / OUT Description

com

(IN)

DOMComment to cast.

DOM Implementation Methods

isNull()

Description

Checks that the given DOMImplementation is NULL; returns TRUE if it is NULL, FALSE otherwise.

Syntax

FUNCTION isNull( di DOMImplementation) RETURN BOOLEAN;

Parameter IN / OUT Description

di

(IN)

DOMImplementation to check.

hasFeature()

Description

Test if the DOM implementation implements a specific feature.

Syntax

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

DOM Document Fragment Methods

isNull()

Description

Checks that the given DOMDocumentFragment is NULL; returns TRUE if it is NULL, FALSE otherwise.

Syntax

FUNCTION isNull( df DOMDocumentFragment) RETURN BOOLEAN;

Parameter IN / OUT Description

df

(IN)

DOMDocumentFragment to check.

makeNode()

Description

Casts the given DOMDocumentFragment to a DOMNode, and returns that DOMNode.

Syntax

FUNCTION makeNode( df DOMDocumentFragment) RETURN DOMNode;

Parameter IN / OUT Description

df

(IN)

DOMDocumentFragment to cast.

DOM Document Type Methods

isNull()

Description

Checks that the given DOMDocumentType is NULL; returns TRUE if it is NULL, FALSE otherwise.

Syntax

FUNCTION isNull( dt DOMDocumentType) RETURN BOOLEAN;

Parameter IN / OUT Description

dt

(IN)

DOMDocumentType to check.

makeNode()

Description

Casts the given DOMDocumentType to a DOMNode, and returns that DOMNode.

Syntax

FUNCTION makeNode( dt DOMDocumentType) RETURN DOMNode;

Parameter IN / OUT Description

dt

(IN)

DOMDocumentType to cast.

findEntity()

Description

Finds an entity in the given DTD; returns that entity if found.

Syntax

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; TRUE for parameter entity and FALSE for normal entity.

findNotation()

Description

Finds the notation in the given DTD; returns it, if found.

Syntax

FUNCTION findNotation( dt   DOMDocumentType,
                       name VARCHAR2) 
                       RETURN DOMNotation;

Parameter IN / OUT Description

dt

(IN)

The DTD.

name

(IN)

The notation to find.

getPublicId()

Description

Returns the public id of the given DTD.

Syntax

FUNCTION getPublicId( dt DOMDocumentType) RETURN VARCHAR2;

Parameter IN / OUT Description

dt

(IN)

The DTD.

getSystemId()

Description

Returns the system id of the given DTD.

Syntax

FUNCTION getSystemId( dt DOMDocumentType) RETURN VARCHAR2;

Parameter IN / OUT Description

dt

(IN)

The DTD.

writeExternalDTDToFile()

Description

Writes DTD to a specified file. The options are given in the following table.

Syntax Description

PROCEDURE writeExternalDTDToFile(

dt DOMDocumentType,

fileName VARCHAR2);

Writes the DTD to a specified file using the database character set.

PROCEDURE writeExternalDTDToFile(

dt DOMDocumentType,

fileName VARCHAR2,

charset VARCHAR2);

Writes the DTD to a specified file using the given character set.

Parameter IN / OUT Description

dt

(IN)

The DTD.

fileName

(IN)

The file to write to.

charset

(IN)

Character set.

writeExternalDTDToBuffer()

Description

Writes DTD to a specified buffer. The options are given in the following table.

Syntax Description

PROCEDURE writeExternalDTDToBuffer(

dt DOMDocumentType,

buffer IN OUT VARCHAR2);

Writes the DTD to a specified buffer using the database character set.

PROCEDURE writeExternalDTDToBuffer(

dt DOMDocumentType,

buffer IN OUT VARCHAR2,

charset VARCHAR2);

Writes the DTD to a specified buffer using the given character set.

Parameter IN / OUT Description

dt

(IN)

The DTD.

buffer

(IN/OUT)

The buffer to write to.

charset

(IN)

Character set.

writeExternalDTDToClob()

Description

Writes DTD to a specified clob. The options are given in the following table.

Syntax Description

PROCEDURE writeExternalDTDToClob(

dt DOMDocumentType,

cl IN OUT CLOB);

Writes the DTD to a specified clob using the database character set.

PROCEDURE writeExternalDTDToClob(

dt DOMDocumentType,

cl IN OUT CLOB,

charset VARCHAR2);

Writes the DTD to a specified clob using the given character set.

Parameter IN / OUT Description

dt

(IN)

The DTD.

cl

(IN/OUT)

The clob to write to.

charset

(IN)

Character set.

getName()

Description

Retrieves the name of DTD, or the name immediately following the DOCTYPE keyword.

Syntax

FUNCTION getName( dt DOMDocumentType) RETURN VARCHAR2;

Parameter IN / OUT Description

dt

IN

DOMDocumentType

getEntities()

Description

Retrieves a NamedNodeMap containing the general entities, both external and internal, declared in the DTD.

Syntax

FUNCTION getEntities( dt DOMDocumentType) RETURN DOMNamedNodeMap;

Parameter IN / OUT Description

dt

IN

DOMDocumentType

getNotations()

Description

Retrieves a NamedNodeMap containing the notations declared in the DTD.

Syntax

FUNCTION getNotations( dt DOMDocumentType) RETURN DOMNamedNodeMap;

Parameter IN / OUT Description

dt

IN

DOMDocumentType

DOM Element Methods

isNull()

Description

Checks that the given DOMElement is NULL; returns TRUE if it is NULL, FALSE otherwise.

Syntax

FUNCTION isNull( elem DOMElement) RETURN BOOLEAN;

Parameter IN / OUT Description

elem

(IN)

DOMElement to check.

makeNode()

Description

Casts the given DOMElement to a DOMNode, and returns that DOMNode.

Syntax

FUNCTION makeNode( elem DOMElement) RETURN DOMNode;

Parameter IN / OUT Description

elem

(IN)

DOMElement to cast.

getQualifiedName()

Description

Returns the qualified name of the DOMElement.

Syntax

FUNCTION getQualifiedName( elem DOMElement) RETURN VARCHAR2;

Parameter IN / OUT Description

elem

(IN)

DOMElement.

getNamespace()

Description

Returns the namespace of the DOMElement.

Syntax

FUNCTION getNamespace( elem DOMElement) RETURN VARCHAR2;

Parameter IN / OUT Description

elem

(IN)

DOMElement.

getLocalName()

Description

Returns the local name of the DOMElement.

Syntax

FUNCTION getLocalName( elem DOMElement) RETURN VARCHAR2;

Parameter IN / OUT Description

elem

(IN)

DOMElement.

getExpandedName()

Description

Returns the expanded name of the DOMElement.

Syntax

FUNCTION getExpandedName( elem DOMElement) RETURN VARCHAR2;

Parameter IN / OUT Description

elem

(IN)

DOMElement.

getChildrenByTagName()

Description

Returns the children of the DOMElement. The options are given in the following table.

Syntax Description

FUNCTION getChildrenByTagName(

elem DOMElement,

name IN VARCHAR2)

RETURN DOMNodeList;

Returns children of the DOMElement given the tag name.

FUNCTION getChildrenByTagName(

elem DOMElement,

name IN VARCHAR2,

ns VARCHAR2)

RETURN DOMNodeList;

Returns children of the DOMElement given the tag name and namespace.

Parameter IN / OUT Description

elem

(IN)

The DOMElement.

name

(IN)

Tag name; * matches any tag.

ns

(IN)

Namespace.

getElementsByTagName()

Description

Returns the element children of the DOMElement. The options are given in the following table.

Syntax Description

FUNCTION getElementsByTagName(

elem DOMElement,

name IN VARCHAR2)

RETURN DOMNodeList;

Returns the element children of the DOMElement given the tag name.

FUNCTION getElementsByTagName(

elem DOMElement,

name IN VARCHAR2,

ns VARCHAR2)

RETURN DOMNodeList;

Returns the element children of the DOMElement given the tag name and namespace.

Parameters

elem

(IN)

The DOMElement.

name

(IN)

Tag name; * matches any tag.

ns

(IN)

Namespace.

resolveNamespacePrefix()

Description

Resolves the given namespace prefix, and returns the resolved namespace.

Syntax

FUNCTION resolveNamespacePrefix( elem DOMElement,
                                 prefix VARCHAR2) 
                                 RETURN VARCHAR2;

Parameter IN / OUT Description

elem

(IN)

The DOMElement.

prefix

(IN)

Namespace prefix.

getTagName()

Description

Returns the name of the DOMElement.

Syntax

FUNCTION getTagName(elem DOMElement) RETURN VARCHAR2;

Parameter IN / OUT Description

elem

(IN)

The DOMElement.

getAttribute()

Description

Returns the value of a DOMElement's attribute by name.

Syntax

FUNCTION getAttribute( elem DOMElement,
                       name IN VARCHAR2)
                       RETURN VARCHAR2;

Parameter IN / OUT Description

elem

(IN)

The DOMElement.

name

(IN)

Attribute name; * matches any attribute.

setAttribute()

Description

Sets the value of a DOMElement's attribute by name.

Syntax

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

removeAttribute()

Description

Removes an attribute from the DOMElement by name.

Syntax

PROCEDURE removeAttribute( elem DOMElement,
                           name IN VARCHAR2);

Parameter IN / OUT Description

elem

(IN)

The DOMElement.

name

(IN)

Attribute name; * matches any attribute.

getAttributeNode()

Description

Returns an attribute node from the DOMElement by name.

Syntax

FUNCTION getAttributeNode( elem DOMElement,
                           name IN VARCHAR2)
                           RETURN DOMAttr;

Parameter IN / OUT Description

elem

(IN)

The DOMElement.

name

(IN)

Attribute name; * matches any attribute.

setAttributeNode()

Description

Adds a new attribute node to the DOMElement.

Syntax

FUNCTION setAttributeNode( elem DOMElement,
                           newAttr IN DOMAttr)
                           RETURN DOMAttr;

Parameter IN / OUT Description

elem

(IN)

The DOMElement.

newAttr

(IN)

The new DOMAttr.

removeAttributeNode()

Description

Removes the specified attribute node from the DOMElement.

Syntax

FUNCTION removeAttributeNode( elem DOMElement,
                              oldAttr IN DOMAttr)
                              RETURN DOMAttr;

Parameter IN / OUT Description

elem

(IN)

The DOMElement.

oldAttr

(IN)

The old DOMAttr.

normalize()

Description

Normalizes the text children of the DOMElement.

Syntax

PROCEDURE normalize( elem DOMElement);

Parameter IN / OUT Description

elem

(IN)

The DOMElement.

DOM Entity Methods

isNull()

Description

Checks that the given DOMEntity is NULL; returns TRUE if it is NULL, FALSE otherwise.

Syntax

FUNCTION isNull( ent DOMEntity) RETURN BOOLEAN;

Parameter IN / OUT Description

ent

(IN)

DOMEntity to check.

makeNode()

Description

Casts given DOMEntity to a DOMNode, and returns that DOMNode.

Syntax

FUNCTION makeNode( ent DOMEntity) RETURN DOMNode;

Parameter IN / OUT Description

ent

(IN)

DOMEntity to cast.

getPublicId()

Description

Returns the public identifier of the DOMEntity.

Syntax

FUNCTION getPublicId( ent DOMEntity) RETURN VARCHAR2;

Parameter IN / OUT Description

ent

(IN)

DOMEntity.

getSystemId()

Description

Returns the system identifier of the DOMEntity.

Syntax

FUNCTION getSystemId( ent DOMEntity) RETURN VARCHAR2;

Parameter IN / OUT Description

ent

(IN)

DOMEntity.

getNotationName()

Description

Returns the notation name of the DOMEntity.

Syntax

FUNCTION getNotationName( ent DOMEntity) RETURN VARCHAR2;

Parameter IN / OUT Description

ent

(IN)

DOMEntity.

DOM Entity Reference Methods

isNull()

Description

Checks that the given DOMEntityRef is NULL; returns TRUE if it is NULL, FALSE otherwise.

Syntax

FUNCTION isNull( eref DOMEntityReference) RETURN BOOLEAN;

Parameter IN / OUT Description

eref

(IN)

DOMEntityReference to check.

makeNode()

Description

Casts the DOMEntityReference to a DOMNode, and returns that DOMNode.

Syntax

FUNCTION makeNode( eref DOMEntityReference) RETURN DOMNode;

Parameter IN / OUT Description

eref

(IN)

DOMEntityReference to cast.

DOM Notation Methods

isNull()

Description

Checks that the given DOMNotation is NULL; returns TRUE if it is NULL, FALSE otherwise.

Syntax

FUNCTION isNull( n DOMNotation) RETURN BOOLEAN;

Parameter IN / OUT Description

n

(IN)

DOMNotation to check.

makeNode()

Description

Casts the DOMNotation to a DOMNode, and returns that DOMNode.

Syntax

FUNCTION makeNode( n DOMNotation) RETURN DOMNode;

Parameter IN / OUT Description

n

(IN)

DOMNotation to cast.

getPublicId()

Description

Returns the public identifier of the DOMNotation.

Syntax

FUNCTION getPublicId( n DOMNotation) RETURN VARCHAR2;

Parameter IN / OUT Description

n

(IN)

DOMNotation.

getSystemId()

Description

Returns the system identifier of the DOMNotation.

Syntax

FUNCTION getSystemId( n DOMNotation) RETURN VARCHAR2;

Parameter IN / OUT Description

n

(IN)

DOMNotation.

DOM Processing Instruction Methods

isNull()

Description

Checks that the given DOMProcessingInstruction is NULL; returns TRUE if it is NULL, FALSE otherwise.

Syntax

FUNCTION isNull( pi DOMProcessingInstruction) RETURN BOOLEAN;

Parameter IN / OUT Description

pi

(IN)

DOMProcessingInstruction to check.

makeNode()

Description

Casts the DOMProcessingInstruction to a DOMNode, and returns that DOMNode.

Syntax

FUNCTION makeNode( pi DOMProcessingInstruction) RETURN DOMNode;

Parameter IN / OUT Description

pi

(IN)

DOMProcessingInstruction to cast.

getData()

Description

Returns the content data of the DOMProcessingInstruction.

Syntax

FUNCTION  getData( pi DOMProcessingInstruction) RETURN VARCHAR2;

Parameter IN / OUT Description

pi

(IN)

DOMProcessingInstruction.

getTarget()

Description

Returns the target of the DOMProcessingInstruction.

Syntax

FUNCTION getTarget( pi DOMProcessingInstruction) RETURN VARCHAR2;

Parameter IN / OUT Description

pi

(IN)

DOMProcessingInstruction.

setData()

Description

Sets the content data of the DOMProcessingInstruction.

Syntax

PROCEDURE setData( pi DOMProcessingInstruction,
                   data IN VARCHAR2);

Parameter IN / OUT Description

pi

(IN)

DOMProcessingInstruction.

data

(IN)

New processing instruction content data.

DOM Text Methods

isNull()

Description

Checks that the given DOMText is NULL; returns TRUE if it is NULL, FALSE otherwise.

Syntax

FUNCTION isNull( t DOMText) RETURN BOOLEAN;

Parameter IN / OUT Description

t

(IN)

DOMText to check.

makeNode()

Description

Casts the DOMText to a DOMNode, and returns that DOMNode.

Syntax

FUNCTION makeNode( t DOMText) RETURN DOMNode;

Parameter IN / OUT Description

t

(IN)

DOMText to cast.

splitText()

Description

Breaks this DOMText node into two DOMText nodes at the specified offset.

Syntax

FUNCTION splitText( t DOMText,
                    offset IN NUMBER)
                    RETURN DOMText;

Parameter IN / OUT Description

t

(IN)

DOMText

offset

(IN)

Offset at which to split.

DOM Document Methods

isNull()

Description

Checks that the given DOMDocument is NULL; returns TRUE if it is NULL, FALSE otherwise.

Syntax

FUNCTION isNull( doc DOMDocument) RETURN BOOLEAN;

Parameter IN / OUT Description

doc

(IN)

DOMDocument to check.

makeNode()

Description

Casts the DOMDocument to a DOMNode, and returns that DOMNode.

Syntax

FUNCTION makeNode( doc DOMDocument) RETURN DOMNode;

Parameter IN / OUT Description

doc

(IN)

DOMDocument to cast.

newDOMDocument()

Description

Returns a new DOMDocument instance.

Syntax

FUNCTION newDOMDocument RETURN DOMDocument;

freeDocument()

Description

Frees DOMDocument object.

Syntax

PROCEDURE freeDocument( doc DOMDocument);

Parameter IN / OUT Description

doc

(IN)

DOMDocument.

getVersion()

Description

Returns the version information for the XML document.

Syntax

FUNCTION getVersion( doc DOMDocument) RETURN VARCHAR2;

Parameter IN / OUT Description

doc

(IN)

DOMDocument.

setVersion()

Description

Sets version information for the XML document.

Syntax

PROCEDURE setVersion( doc     DOMDocument,
                      version VARCHAR2);

Parameter IN / OUT Description

doc

(IN)

DOMDocument.

version

((N)

Version information.

getCharset()

Description

Retrieves the character set of the XML document.

Syntax

FUNCTION getCharset( doc DOMDocument) RETURN VARCHAR2;

Parameter IN / OUT Description

doc

(IN)

DOMDocument.

setCharset()

Description

Sets character set of the XML document.

Syntax

PROCEDURE setCharset( doc DOMDocument,
                      charset VARCHAR2);

Parameter IN / OUT Description

doc

(IN)

DOMDocument.

charset

((N)

Character set.

getStandalone()

Description

Retrieves standalone information for the XML document.

Syntax

FUNCTION getStandalone( doc DOMDocument) RETURN VARCHAR2;

Parameter IN / OUT Description

doc

(IN)

DOMDocument.

setStandalone()

Description

Sets standalone information for the XML document.

Syntax

PROCEDURE setStandalone( doc DOMDocument,
                         value VARCHAR2);

Parameter IN / OUT Description

doc

(IN)

DOMDocument.

value

((N)

Standalone information

writeToFile()

Description

Writes XML document to a specified file. The options are given in the following table.

Syntax Description

PROCEDURE writeToFile(

doc DOMDocument,

fileName VARCHAR2);

Writes XML document to a specified file using database character set.

PROCEDURE writeToFile(

doc DOMDocument,

fileName VARCHAR2,

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.

writeToBuffer()

Description

Writes XML document to a specified buffer. The options are given in the following table.

Syntax Description

PROCEDURE writeToBuffer(

doc DOMDocument,

buffer IN OUT VARCHAR2);

Writes XML document to a specified buffer using database character set.

PROCEDURE writeToBuffer(

doc DOMDocument,

buffer IN OUT VARCHAR2,

charset VARCHAR2);

Writes XML document to a specified buffer using given character set.

Parameter IN / OUT Description

doc

(IN)

DOMDocument.

buffer

(N/OUT)

Buffer to write to.

charset

(IN)

Character set.

writeToClob()

Description

Writes XML document to a specified clob. The options are given in the following table.

Syntax Description

PROCEDURE writeToClob(

doc DOMDocument,

cl IN OUT CLOB);

Writes XML document to a specified clob using database character set.

PROCEDURE writeToClob(

doc DOMDocument,

cl IN OUT CLOB,

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.

writeExternalDTDToFile()

Description

Writes an external DTD to specified file. The options are given in the following table.

Syntax Description

PROCEDURE writeExternalDTDToFile(

doc DOMDocument,

fileName VARCHAR2);

Writes an external DTD to specified file using the database character set.

PROCEDURE writeExternalDTDToFile(

doc DOMDocument,

fileName VARCHAR2,

charset VARCHAR2);

Writes an external DTD to specified file using the given character set.

Parameter IN / OUT Description

doc

(IN)

DOMDocument.

fileName

(N)

File to write to.

charset

(IN)

Character set.

writeExternalDTDToBuffer()

Description

Writes an external DTD to specified buffer. The options are given in the following table.

Syntax Description

PROCEDURE writeExternalDTDToBuffer(

doc DOMDocument,

buffer IN OUT VARCHAR2);

Writes an external DTD to specified buffer using the database character set.

PROCEDURE writeExternalDTDToBuffer(

doc DOMDocument,

buffer IN OUT VARCHAR2,

charset VARCHAR2);

Writes an external DTD to specified buffer using the given character set.

Parameter IN / OUT Description

doc

(IN)

DOMDocument.

buffer

(N/OUT)

Buffer to write to.

charset

(IN)

Character set.

writeExternalDTDToClob()

Description

Writes an external DTD to specified clob. The options are given in the following table.

Syntax Description

PROCEDURE writeExternalDTDToClob(

doc DOMDocument,

cl IN OUT CLOB);

Writes an external DTD to specified clob using the database character set.

PROCEDURE writeExternalDTDToClob(

doc DOMDocument,

cl IN OUT CLOB,

charset VARCHAR2);

Writes an external DTD to specified clob using the given character set.

Parameter IN / OUT Description

doc

(IN)

DOMDocument.

cl

(N)

Clob to write to.

charset

(IN)

Character set.

getDoctype()

Description

Returns the DTD associated to the DOMDocument.

Syntax

FUNCTION getDoctype( doc DOMDocument) RETURN DOMDocumentType;

Parameter IN / OUT Description

doc

(IN)

DOMDocument.

getImplementation()

Description

Returns the DOMImplementation object that handles this DOMDocument.

Syntax

FUNCTION getImplementation( doc DOMDocument) RETURN DOMImplementation;

Parameter IN / OUT Description

doc

(IN)

DOMDocument.

getDocumentElement()

Description

Returns the child node, or the document element of the DOMDocument.

Syntax

FUNCTION getDocumentElement( doc DOMDocument) RETURN DOMElement;

Parameter IN / OUT Description

doc

(IN)

DOMDocument.

createElement()

Description

Creates a DOMElement.

Syntax

FUNCTION createElement( doc DOMDocument,
                        tagName IN VARCHAR2)
                        RETURN DOMElement;

Parameter IN / OUT Description

doc

(IN)

DOMDocument.

tagName

(IN)

Tagname for new DOMElement.

createDocumentFragment()

Description

Creates a DOMDocumentFragment.

Syntax

FUNCTION createDocumentFragment( doc DOMDocument) RETURN DOMDocumentFragment;

Parameter IN / OUT Description

doc

(IN)

DOMDocument.

createTextNode()

Description

Creates a DOMText node.

Syntax

FUNCTION createTextNode( doc DOMDocument,
                         data IN VARCHAR2)
                         RETURN DOMText;

Parameter IN / OUT Description

doc

(IN)

DOMDocument.

data

(IN)

Content of the DOMText node.

createComment()

Description

Creates a DOMComment node.

Syntax

FUNCTION createComment( doc DOMDocument,
                        data IN VARCHAR2)
                        RETURN DOMComment;

Parameter IN / OUT Description

doc

(IN)

DOMDocument.

data

(IN)

Content of the DOMComment node.

createCDATASection()

Description

Creates a DOMCDATASection node.

Syntax

FUNCTION createCDATASection( doc DOMDocument,
                             data IN VARCHAR2)
                             RETURN DOMCDATASection;

Parameter IN / OUT Description

doc

(IN)

DOMDocument.

data

(IN)

Content of the DOMCDATASection node.

createProcessingInstruction()

Description

Creates a DOMProcessingInstruction node.

Syntax

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.

createAttribute()

Description

Creates a DOMAttr node.

Syntax

FUNCTION createAttribute( doc DOMDocument,
                          name IN VARCHAR2)
                          RETURN DOMAttr;

Parameter IN / OUT Description

doc

(IN)

DOMDocument.

name

(IN)

New attribute name.

createEntityReference()

Description

Creates a DOMEntityReference node.

Syntax

FUNCTION createEntityReference( doc DOMDocument,
                                name IN VARCHAR2)
                                RETURN DOMEntityReference;

Parameter IN / OUT Description

doc

(IN)

DOMDocument.

name

(IN)

New entity reference name.

getElementsByTagName()

Description

Returns a DOMNodeList of all the elements with a given tagname.

Syntax

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.


Go to previous page Go to next page
Oracle
Copyright © 2001, 2002 Oracle Corporation.

All Rights Reserved.
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents
Go To Index
Index

Master Index

Feedback