Oracle9i Supplied Java Packages Reference Release 2 (9.2) Part Number A96609-01 |
|
The classes described in this chapter are contained in package oracle.xdb.dom and implement the Java DOM API for XMLType.
This chapter contains these sections:
The classes described in this chapter implement the Java DOM API for XMLType and are contained in package oracle.xdb.dom. Oracle XML DB supports the Document Object Model (DOM) as set forth by the W3C DOM Recommendation. For more information about the DOM, refer to http://www.w3.org/DOM/.
See Also:
For more information about developing applications using the features of Oracle XML DB, see Oracle9i XML Database Developer's Guide - Oracle XML DB |
In addition to implementing the W3C DOM Recommendation, the DOM API for Oracle XML DB provides Oracle-specific extensions.
public class XDBAttribute oracle.xdb.dom.XDBAttribute
This class implements org.w3c.dom.Attribute
, the W3C DOM Node interface for interacting with XOB
s.
public class XDBCData oracle.xdb.dom.XDBCData
This class implements org.w3c.dom.CData
, the W3C text interface.
public class XDBCharData oracle.xdb.dom.XDBCharData
This class implements org.w3c.dom.CharData
, the W3C CharacterData interface.
public class XDBComment oracle.xdb.dom.XDBComment
This class implements the org.w3c.dom.Comment
interface.
public class XDBDocument oracle.xdb.dom.XDBDocument
This class implements the org.w3c.dom.Document
interface.
public XDBDocument()
Creates new Document. Can be used in server only.
public XDBDocument(byte[] source)
Populates Document from source. Can be used in server only.
source
- Bytes containing XML text.
public XDBDocument(java.sql.Connection conn)
Opens connection for caching Document source.
conn
- Connection to be used for Document.
public XDBDocument(java.sql.Connection conn, byte[] source)
Connection for caching bytes for Document source.
conn
- Connection to be used for Document.
source
- Bytes containing XML text.
public XDBDocument(java.sql.Connection conn, java.lang.String source)
Opens connection for caching string containing XML text.
source
- String containing XML text.
conn
- Connection to be used for String.
public XDBDocument(java.lang.String source)
String containing XML text. Can be used in server only.
public class XDBDomImplementation oracle.xdb.dom.XDBDomImplementation
This class implements org.w3c.dom.DomImplementation
.
public XDBDomImplementation()
Opens a JDBC connection to the server.
public class XDBElement oracle.xdb.dom.XDBElement
This class implements org.w3c.dom.Element
.
public class XDBNamedNodeMap oracle.xdb.dom.XDBNamedNodeMap
This class implements org.w3c.dom.NamedNodeMap
.
public abstract class XDBNode oracle.xdb.dom.XDBNode
This class implements org.w3c.dom.Node
, the W3C DOM Node interface for interacting with XOBs.
Writes the XML for this Node (and all subnodes) to an OutputStream. If the OutputStream is a ServletOutputStream, the servlet output is committed and the data is written using a native stream mechanism.
public void write(java.io.OutputStream s, java.lang.String charEncoding, short indent)
s
- The stream to write the output to
charEncoding
- The IANA char code (e.g. "ISO-8859")
indent
- Number of chars to indent nested elements
public class XDBNodeList oracle.xdb.dom.XDBNodeList
This class implements org.w3c.dom.NodeList
.
public class XDBProcInst oracle.xdb.dom.XDBProcInst
This class implements org.w3c.dom.ProcInst
, the W3C DOM ProcessingInstruction interface.
public class XDBText oracle.xdb.dom.XDBText
This class implements org.w3c.dom.Text
.
oracle.xdb.XMLType public class XMLType
XMLType class implements the native datatype XMLType
in Oracle XML DB, which supports storage and manipulation of XML in the server. Multiple storage options including structured XML and Character Large Object (CLOB) are available with XMLType.
The native structured XML storage is a decomposition of XML into underlying object-relational structures (automatically created and managed by Oracle) for better SQL queriability. CLOB storage is an un-decomposed storage that retains an image of the original XML, including white space.
Field | Description |
---|---|
SQL_TYPECODE |
static int |
SQL_TYPENAME |
static java.lang.String |
public static final int _SQL_TYPECODE
public static final java.lang.String _SQL_TYPENAME
public XMLType() throws java.sql.SQLException
public static oracle.sql.ORADataFactory getORADataFactory()
Get the oradata factory for this XMLType. This is required as part of the oradata interface
the ORADataFactory assoicated with this XMLType.
public oracle.sql.Datum toDatum(java.sql.Connection conn) throws java.sql.SQLException
Construct an image from the XMLType data. This function pickles the XMLType bytes and returns the bytes as a Datum.
conn - the connection to be used for Datum creation
the pickled image
java.sql.SQLException -
public static XMLType createXML(oracle.sql.OPAQUE opq) throws java.sql.SQLException
Create an XMLType given the opaque type containing the XMLType bytes
opq - the opaque data object from which the XMLType is to be generated
the created XMLType
java.sql.SQLException -
public static XMLType createXML(java.sql.Connection conn, java.lang.String xmlval) throws java.sql.SQLException
Create an XMLType given the string containing the XML data
conn - the connection object to be used.
xmlval - the string containing the XML data
the created XMLType
java.sql.SQLException -
public static XMLType createXML(java.sql.Connection conn, oracle.sql.CLOB xmlval) throws java.sql.SQLException
Create an XMLType given a CLOB containing the XML data
conn - the connection object to be used.
xmlval - the CLOB containing the XML data
the created XMLType
java.sql.SQLException
public java.lang.String getStringVal() throws java.sql.SQLException
Get the string value containing the XML data from the XMLType.
the string containing the XML data bytes.
java.sql.SQLException -
public oracle.sql.CLOB getClobVal() throws java.sql.SQLException
Get the CLOB value containing the XML data from the XMLType.
the CLOB containing the XML data bytes.
java.sql.SQLException -
public static XMLType createXML(java.sql.Connection conn, org.w3c.dom.Document domdoc) throws java.sql.SQLException
Create an XMLType given an instance of the DOM document
domdoc - the DOM Document which represents the DOM tree
the constructed XMLType.
java.sql.SQLException -
public XMLType extract(java.lang.String xpath, java.lang.String nsmap) throws java.sql.SQLException
Function to extract the given set of nodes from the XMLType. This set of nodes is specified by the XPath expression. The original XMLType remains unchanged. Works only in the thick case.
xpath - the xpath expression which specifies the nodes to search for.
nsmap - the map of namespaces which resolves the prefixes in the xpath expression. format is "xmlns=a.com xmlns:b=b.com"
XMLType which contains the extracted nodes. null if no nodes match the specified expression.
public boolean existsNode(java.lang.String xpath, java.lang.String nsmap) throws java.sql.SQLException
Function to check for the existence of the given set of nodes in the XMLType. This set of nodes is specified by the xpath expression.
xpath - the xpath expression which specifies the nodes to search for.
nsmap - the map of namespaces which resolves the prefixes in the xpath expression. format is "xmlns=a.com xmlns:b=b.com"
TRUE if specified nodes exist in the XMLType else FALSE
public XMLType transform(XMLType xsldoc, java.lang.String parammap) throws java.sql.SQLException
Function to transform the XMLType using the given XSL document. The new (transformed) XML document is returned.
xsldoc - the XSL document to be applied to the XMLType
parammap - the top level parameters to be passed to the XSL transformation. This should be of the format "a=b c=d e=f". This can be null.
the transformed XMLType
public boolean isFragment() throws java.sql.SQLException
Function to check if the XMLType is a regular document or a document fragment.
TRUE if doc is a fragment else FALSE
public boolean isSchemaValid(java.lang.String schurl, java.lang.String elname) throws java.sql.SQLException
Function to check if the XMLType is schema based.
schurl - the URL of the schema to be validated against; if this is null then the documents own schema URL is used (if one exists).
TRUE if doc is schema based else FALSE
public org.w3c.dom.Document getDOM() throws java.sql.SQLException
Gets the DOM document associated with the XMLType. This document is the org.w3c.dom.Document. The caller can perform all the DOM operations on the Document. If the document is a binary document the getDOM function will return null.
the DOM Document object associated with the XMLType
public byte[] getBytesValue() throws java.sql.SQLException
Gets the bytes value containing the XML data from the XMLType.
|
Copyright © 1996, 2002 Oracle Corporation. All Rights Reserved. |
|