PK
-;Aoa, mimetypeapplication/epub+zipPK -;A iTunesMetadata.plistI
This chapter maps the XML C APIs available in Oracle9i release to the Unified XML C APIs available in this release of Oracle Database.
The chapter contains these topics:
Pre-existing C APIs were available through the oraxml
package. It had the following characteristics:
Specification is limited to a one-to-one mapping between the xml context (xmlctx
) and an xml document. Only one document can be accessed by DOM at any one time, however the data of multiple documents can be concurrent.
The APIs are not always consistent, and don't always follow the declarations of the xmlctx
.
In contrast, the new unified C APIs solve these problems:
Multiple independent documents share the xmlctx
.
All APIs conform to the declarations of the xmlctx
.
Each document can be accessed simultaneously by DOM until explicitly destroyed by an XmlDestroy()
call.
The initialization and parsing of documents has changed in the Unified C API.
Example A-1 Initializing and Parsing Sequence for the Pre-Unified C API, One Document at a Time
The following pseudo-code demonstrates how to initialize and parse documents, one at a time, using the old C APIs. Contrast this with Example A-2.
#include <oraxml.h> uword err; xmlctx *ctx = xmlinit(&err, options); for (;;) { err = xmlparse(ctx, URI, options); ... /* DOM operations */ ... /* recycle memory from document */ xmlclean(ctx); } xmlterm(ctx);
Example A-2 Initializing and Parsing Sequence for the Unified C API, One Document at a Time
The following pseudo-code demonstrates how to initialize and parse documents, one at a time, using the new C APIs. Contrast this with Example A-1.
#include <xml.h> xmlerr err; xmldocnode *doc; xmlctx *xctx = XmlCreate(&err, options, NULL); for (;;) { doc = XmlLoadDom(xctx, &err, "URI", URI, NULL); ... /* DOM operations */ ... XmlFreeDocument(xctx, doc); } XmlDestroy(xctx);
Example A-3 Initializing and Parsing Sequence for the Pre-Unified C API, Multiple Documents and Simultaneous DOM Access
The following pseudo-code demonstrates how to initialize and parse multiple documents with simultaneous DOM access using the old C APIs. Contrast this with Example A-4.
xmlctx *ctx1 = xmlinitenc(&err, options); xmlctx *ctx2 = xmlinitenc(&err, options); err = xmlparse(ctx1, URI_1, options); err = xmlparse(ctx2, URI_2, options); ... /* DOM operations for both documents */ ... xmlterm(ctx1); xmlterm(ctx2);
Example A-4 Initializing and Parsing Sequence for the Unified C API, Multiple Documents and Simultaneous DOM Access
The following pseudo-code example demonstrates how to initialize and parse multiple documents with simultaneous DOM access using the new C APIs. Contrast this with Example A-3.
xmldocnode *doc1; xmldocnode *doc2; xmlctx *xctx = XmlCreate(&err, options, NULL); doc1 = XmlLoadDom(xctx, &err, "URI", URI_1, NULL); doc2 = XmlLoadDom(xctx, &err, "URI", URI_2, NULL); ... /* DOM operations for both documents*/ ... XmlFreeDocument(xctx, doc1); XmlFreeDocument(xctx, doc2); ... XmlDestroy(xctx);
Table A-1 outlines the changes made to datatypes for the new C API.
Table A-1 Datatypes Supported by oraxml Package versus xml Package
oraxml Supported Datatype | xml Supported Datatype |
---|---|
uword |
xmlerr |
xmlacctype |
xmlurlacc |
xmlattrnode |
xmlattrnode |
xmlcdatanode |
xmlcdatanode |
xmlcommentnode |
xmlcommentnode |
xmlctx |
xmlctx |
xmldocnode |
xmldocnode |
xmldomimp |
Obsolete.Use |
xmldtdnode |
xmldtdnode |
xmlelemnode |
xmlelemnode |
xmlentnode |
xmlentnode |
xmlentrefnode |
xmlentrefnode |
xmlflags |
ub4 |
xmlfragnode |
xmlfragnode |
xmlihdl |
xmlurlhdl |
xmlmemcb |
Use individual function pointers. |
xmlnode |
xmlnode |
xmlnodes |
xmlnodelist, xmlnamedmap |
xmlnotenode |
xmlnotenode |
xmlntype |
xmlnodetype |
xmlpflags |
ub4 |
xmlpinode |
xmlpinode |
xmlsaxcb |
xmlsaxcb |
xmlstream |
xmlistream, xmliostream |
xmltextnode |
xmltextnode |
xpctx |
xpctx |
xpexpr |
xpexpr |
xpnset |
Obsolete.Use |
xpnsetele |
Obsolete.Use |
xpobj |
xpobj |
xpobjtyp |
xmlxslobjtype |
xslctx |
xslctx |
xsloutputmethod |
xmlxsloutputmethod |
Table A-2 outlines the changes made to the methods of the new C API.
Table A-2 Methods of the oraxml Package versus the xml Package
Package oraxml Method | Package xml Method(s) |
---|---|
appendChild() |
XmlDomAppendChild() |
appendData() |
XmlDomAppendData() |
cloneNode() |
XmlDomCloneNode() |
createAttribute() |
XmlDomCreateAttr() |
createAttributeNS() |
XmlDomCreateAttrNS() |
createCDATASection() |
XmlDomCreateCDATA() |
createComment() |
XmlDomCreateComment() |
createDocument() |
XmlCreateDocument() |
createDocumentFragment() |
XmlDomCreateFragment() |
createDocumentNS() |
XmlCreateDocument() |
createDocumentType() |
XmlCreateDTD() |
createElement() |
XmlDomCreateElem() |
createElementNS() |
XmlDomCreateElemNS() |
createEntityReference() |
XmlDomCreateEntityRef() |
createProcessingInstruction() |
XmlDomCreatePI() |
createTextNode() |
XmlDomCreateText() |
deleteData() |
XmlDomDeleteData() |
freeElements() |
XmlDomFreeNodeList() |
getAttribute() |
XmlDomGetAttr() |
getAttributeIndex() |
XmlDomGetAttrs(), XmlDomGetNodeMapItem() |
getAttributeNode() |
XmlDomGetAttrNode() |
getAttributes() |
XmlDomGetAttrs() |
getAttrLocal() |
XmlDomGetAttrLocal(), XmlDomGetAttrLocalLen() |
getAttrName() |
XmlDomGetAttrName() |
getAttrNamespace() |
XmlDomGetAttrURI(), XmlDomGetAttrURILen() |
getAttrPrefix() |
XmlDomGetAttrPrefix() |
getAttrQualifiedName() |
XmlDomGetAttrName() |
getAttrSpecified() |
XmlDomGetAttrSpecified() |
getAttrValue() |
XmlDomGetAttrValue() |
getCharData() |
XmlDomGetCharData() |
getChildNode() |
XmlDomGetChildNode() |
getChildNodes() |
XmlDomGetChildNodes() |
getContentModel() |
XmlDomGetContentModel() |
getDocType() |
XmlDomGetDTD() |
getDocTypeEntities() |
XmlDomGetDTDEntities() |
getDocTypeName() |
XmlDomGetDTDName() |
getDocTypeNotations() |
XmlDomGetDTDNotations() |
getDocument() |
Obsolete; document returned by |
getDocumentElement() |
XmlDomGetDoctElem() |
getElementByID() |
XmlDomGetElemByID() |
getElementsByTagName() |
XmlDomGetElemsByTag() |
getElementsByTagNameNS() |
XmlDomGetElemsByTag() |
getEncoding() |
XmlDomGetEncoding() |
getEntityNotation() |
XmlDomGetEntityNotation() |
getEntityPubID() |
XmlDomGetEntityPubID() |
getEntitySysID() |
XmlDomGetEntitySysID() |
getFirstChild() |
XmlDomGetFirstChild() |
getImplementation() |
Obsolete; use |
getLastChild() |
XmlDomGetLastChild() |
getNamedItem() |
XmlDomGetNamedItem() |
getNextSibling() |
XmlDomGetNextSibling() |
getNodeLocal() |
XmlDomGetNodeLocal(), XmlDomGetNodeLocalLen() |
getNodeMapLength() |
XmlDomGetNodeMapLength() |
getNodeName() |
XmlDomGetNodeName(), XmlDomGetNodeNameLen() |
getNodeNameSpace() |
XmlDomGetNodeURI(), XmlDomGetNodeURILen() |
getNodePrefix() |
XmlDomGetNodePrefix() |
getNodeQualifiedName() |
XmlDomGetNodedName(), XmlDomGetNodedNameLen() |
getNodeType() |
XmlDomGetNodeType() |
getNodeValue() |
XmlDomGetNodeValue(), XmlDomGetNodeValueLen() |
getNotationPubID() |
XmlDomGetNotationPubID() |
getNotationSysID() |
XmlDomGetNotationSysID() |
getOwnerDocument() |
XmlDomGetOwnerDocument() |
getParentNode() |
XmlDomGetParentNode() |
getPIData() |
XmlDomGetPIData() |
getPITarget() |
XmlDomGetPITarget() |
getPreviousSibling() |
XmlDomGetPrevSibling() |
getTagName() |
XmlDomGetTagName() |
hasAttributes() |
XmlDomHasAttrs() |
hasChildNodes() |
XmlDomHasChildNodes() |
hasFeature() |
XmlHasFeature() |
importNode() |
XmlDomImportNode() |
insertBefore() |
XmlDomInsertBefore() |
insertData() |
XmlDomInsertData() |
isSingleChar() |
XmlIsSimple() |
isStandalone() |
XmlDomGetDecl() |
isUnicode() |
XmlDomIsUnicode() |
nodeValid() |
XmlDomValidate() |
normalize() |
XmlDomNormalize() |
numAttributes() |
XmlDomNumAttrs() |
numChildNodes() |
XmlDomNumChildNodes() |
prefixToURI() |
XmlDomPrefixToURI() |
printBuffer() |
XmlSaveDomBuffer() |
printBufferEnc() |
XmlSaveDomBuffer() |
printCallback() |
XmlSaveDomStream() |
printCallbackEnc() |
XmlSaveDomStream() |
printSize() |
XmlSaveDomSize() |
printSizeEnc() |
XmlSaveDomSize() |
printStream() |
XmlSaveDomStdio() |
printStreamEnc() |
XmlSaveDomStdio() |
removeAttribute() |
XmlDomRemoveAttr() |
removeAttributeNode() |
XmlDomRemoveAttrNode() |
removeChild() |
XmlDomRemoveChild() |
removeNamedItem() |
XmlDomRemoveNamedItem() |
replaceChild() |
XmlDomReplaceChild() |
replaceData() |
XmlDomReplaceData() |
saveString2() |
XmlDomSaveString2() |
saveString() |
XmlDomSaveString() |
setAttribute() |
XmlDomSetAttr() |
setAttributeNode() |
XmlDomSetAttrNode() |
setAttrValue() |
XmlDomSetAttrValue() |
setCharData() |
XmlDomSetCharData() |
setNamedItem() |
XmlDomSetNamedItem() |
setNodeValue() |
XmlDomSetNodeValue(), XmlDomSetNodeValueLen() |
setPIData() |
XmlDomSetPIData() |
splitText() |
XmlDomSplitText() |
substringData() |
XmlDomSubstringData() |
xmlaccess() |
XmlAccess() |
xmlinit() |
XmlCreate() |
xmlinitenc() |
XmlCreate() |
xmlparse() |
XmlLoadDomURI() |
xmlparsebuf() |
XmlLoadDomBuffer() |
xmlparsedtd() |
Obsolete; use |
xmlparsefile() |
XmlLoadDomFile() |
xmlparsestream() |
XmlLoadDomStream() |
xmlterm() |
XmlDestroy() |
xpevalxpathexpr() |
XmlXPathEval() |
xpfreexpathctx() |
XmlXPathDeleteCtx() |
xpgetbooleanval() |
XmlXPathGetObjectBoolean() |
xpgetfirstnsetelem() |
XmlXPathGetObjectNSetNum() |
xpgetnextnsetelem() |
XmlXPathGetObjectNSetNum() |
xpgetnsetelemnode() |
XmlXPathGetObjectNSetNum() |
xpgetnsetval() |
XmlXPathGetObjectNSetNum() |
xpgetnumval() |
XmlXPathGetObjectNumber() |
xpgetrtfragval() |
XmlXPathGetObjectFragment() |
xpgetstrval() |
XmlXPathGetObjectString() |
xpgetxpobjtyp() |
XmlXPathGetObjectType() |
xpmakexpathctx() |
XmlXPathCreateCtx() |
xpparsexpathexpr() |
XmlXPathParse() |
xslgetbaseuri() |
XmlXslGetBaseURI() |
xslgetoutputdomctx() |
XmlXslGetOutputDom() |
xslgetoutputsax() |
Unnecessary |
xslgetoutputstream() |
Unnecessary |
xslgetresultdocfrag() |
XmlXslGetOutputFragment() |
xslgettextparam() |
XmlXslGetTextParam() |
xslgetxslctx() |
Unnecessary |
xslinit() |
XmlXslCreateCtx() |
xslprocess() |
XmlXslProcess() |
xslprocessex() |
XmlXslProcess() |
xslprocessxml() |
XmlXslProcess() |
xslprocessxmldocfrag() |
XmlXslProcess() |
xslresetallparams() |
XmlXslResetAllParams() |
xslsetoutputdomctx() |
XmlXslSetOutputDom() |
xslsetoutputencoding() |
XmlXslSetOutputEncoding() |
xslsetoutputmethod() |
XmlXslSetOutputMethod() |
xslsetoutputsax() |
XmlXslSetOutputSax() |
xslsetoutputsaxctx() |
XmlXslSetOutputSax() |
xslsetoutputstream() |
XmlXslSetOutputStream() |
xslsettextparam() |
XmlXslSetTextParam() |
xslterm() |
XmlXslDeleteCtx() |
This package defines macros which declare functions (or function pointers) for XML callbacks. Callbacks are used for error-message handling, memory allocation and freeing, and stream operations.
This chapter contains the following section:
Table 2-1 summarizes the methods available through the Callback interface.
Table 2-1 Summary of Callback Methods
Function | Summary |
---|---|
|
User-defined access method close callback. |
|
User-defined access method open callback. |
|
User-defined access method read callback. |
|
Low-level memory allocation. |
|
Handles error message. |
|
Low-level memory freeing. |
|
User-defined stream close callback. |
|
User-defined stream open callback. |
|
User-defined stream read callback. |
|
User-defined stream write callback. |
This macro defines a prototype for the close function callback used to access a URL.
Syntax
#define XML_ACCESS_CLOSE_F(func, ctx, uh) xmlerr func( void *ctx, xmlurlhdl *uh);
Parameter | In/Out | Description |
---|---|---|
ctx |
IN | user-defined context |
uh |
IN | URL handle(s) |
Returns
(xmlerr)
numeric error code, 0
on success
This macro defines a prototype for the open function callback used to access a URL.
Syntax
#define XML_ACCESS_OPEN_F(func, ctx, uri, parts, length, uh) xmlerr func( void *ctx, oratext *uri, xmlurlpart *parts, ubig_ora *length, xmlurlhdl *uh);
Parameter | In/Out | Description |
---|---|---|
ctx |
IN | user-defined context |
uri |
IN | URI to be opened |
parts |
IN | URI broken into components |
length |
OUT | total length of input data if known, 0 otherwise |
uh |
IN | URL handle(s) |
Returns
(xmlerr)
numeric error code, 0
on success
This macro defines a prototype for the read function callback used to access a URL.
Syntax
#define XML_ACCESS_READ_F(func, ctx, uh, data, nraw, eoi) xmlerr func( void *ctx, xmlurlhdl *uh, oratext **data, ubig_ora *nraw, ub1 *eoi);
Parameter | In/Out | Description |
---|---|---|
ctx |
IN | user-defined context |
uh |
IN | URL handle(s) |
data |
IN/OUT | recipient data buffer; reset to start of data |
nraw |
OUT | number of real data bytes read |
eoi |
OUT | signal to end of information; last chunk |
Returns
(xmlerr)
numeric error code, 0
on success
This macro defines a prototype for the low-level memory alloc
function provided by the user. If no allocator is provided, malloc
is used. Memory should not be zeroed by this function. Matches XML_FREE_F().
Syntax
#define XML_ALLOC_F(func, mctx, size) void *func( void *mctx, size_t size);
Parameter | In/Out | Description |
---|---|---|
mctx |
IN | low-level memory context |
size |
IN | number of bytes to allocated |
Returns
(void *)
allocated memory
This macro defines a prototype for the error message handling function. If no error message callback is provided at XML initialization time, errors will be printed to stderr
. If a handler is provided, it will be invoked instead of printing to stderr.
Syntax
#define XML_ERRMSG_F(func, ectx, msg, err) void func( void *ectx, oratext *msg, xmlerr err);
Parameter | In/Out | Description |
---|---|---|
ectx |
IN | error message context |
msg |
IN | text of error message |
err |
IN | numeric error code |
This macro defines a prototype for the low-level memory free function provided by the user. If no allocator is provided, free() is used. Matches XML_ALLOC_F().
Syntax
#define XML_FREE_F(func, mctx, ptr) void func( void *mctx, void *ptr);
Parameter | In/Out | Description |
---|---|---|
mctx |
IN | low-level memory context |
ptr |
IN | memory to be freed |
This macro defines a prototype for the close function callback, called to close an open source and free its resources.
Syntax
#define XML_STREAM_CLOSE_F(func, xctx, sctx) void func( xmlctx *xctx, void *sctx);
Parameter | In/Out | Description |
---|---|---|
xctx |
IN | XML context |
sctx |
IN | user-defined stream context |
This macro defines a prototype for the open function callback, which is called once to open the input source. This function should return XMLERR_OK
on success.
Syntax
#define XML_STREAM_OPEN_F(func, xctx, sctx, path, parts, length) xmlerr func( xmlctx *xctx, void *sctx, oratext *path, void *parts, ubig_ora *length);
Parameter | In/Out | Description |
---|---|---|
xctx |
IN | XML context |
sctx |
IN | user-defined stream context |
path |
IN | full path of the URI to be opened |
parts |
IN | URI broken down into components (opaque pointer) |
length |
(OUT) | total length of input data if known, 0 if not known |
Returns
(xmlerr)
numeric error code, 0
on success
This macro defines a prototype for the read function callback, called to read data from an open source into a buffer, returning the number of bytes read (< 0
on error). The eoi
flag determines if this is the final block of data.
On EOI, the close function will be called automatically.
Syntax
#define XML_STREAM_READ_F(func, xctx, sctx, path, dest, size, nraw, eoi) xmlerr func( xmlctx *xctx, void *sctx, oratext *path, oratext *dest, size_t size, sbig_ora *nraw, boolean *eoi);
Parameter | In/Out | Description |
---|---|---|
xctx |
IN | XML context |
sctx |
IN | user-defined stream context |
path |
IN | full URI of the open source (for error messages) |
dest |
(OUT) | destination buffer to read data into |
size |
IN | size of destination buffer |
nra@w |
(OUT) | number of bytes read |
eoi |
(OUT) | signal to end of information; last chunk |
Returns
(xmlerr)
numeric error code, 0
on success
This macro defines a prototype for the write function callback, called to write data to a user-defined stream.
Syntax
#define XML_STREAM_WRITE_F(func, xctx, sctx, path, src, size) xmlerr func( xmlctx *xctx, void *sctx, oratext *path, oratext *src, size_t size);
Parameter | In/Out | Description |
---|---|---|
xctx |
IN | XML context |
sctx |
IN | user-defined stream context |
path |
IN | full URI of the open source (for error messages) |
src |
IN | source buffer to read data from |
size |
IN | size of source in bytes |
Returns
(xmlerr)
numeric error code, 0
on success
This section describes new features in Oracle Database XML C API Reference and supplies pointers to additional information.
The following features are new to the Oracle Database 11g Release 2:
The orastream package handles large (over 64K) text and binary nodes in XML documents.
Information about this feature is in Chapter Chapter 5, "Package Orastream APIs for C" . Additionally, these new datatypes have been documented in Chapter 1, "Datatypes for C":
The following features are new to the Oracle Database 11g Release 1:
Information about this feature is in the chapter Chapter 3, "Package DOM APIs for C". In includes support for the following functions:
The following functions update the name of the specified node.
Information about this feature is in the new Chapter 12, "Package XmlDiff APIs for C". It includes support for the following functions:
Information about this feature is in the new Chapter 4, "Package Event APIs for C".
XML C API Reference
11g Release 2 (11.2)
E10770-02
May 2010
Oracle Database XML C API Reference, 11g Release 2 (11.2)
E10770-02
Copyright © 2001, 2010, Oracle and/or its affiliates. All rights reserved.
Primary Author: Roza Leyderman
Contributors: Ian Macky, Vijay Medi
This software and related documentation are provided under a license agreement containing restrictions on use and disclosure and are protected by intellectual property laws. Except as expressly permitted in your license agreement or allowed by law, you may not use, copy, reproduce, translate, broadcast, modify, license, transmit, distribute, exhibit, perform, publish, or display any part, in any form, or by any means. Reverse engineering, disassembly, or decompilation of this software, unless required by law for interoperability, is prohibited.
The information contained herein is subject to change without notice and is not warranted to be error-free. If you find any errors, please report them to us in writing.
If this software or related documentation is delivered to the U.S. Government or anyone licensing it on behalf of the U.S. Government, the following notice is applicable:
U.S. GOVERNMENT RIGHTS Programs, software, databases, and related documentation and technical data delivered to U.S. Government customers are "commercial computer software" or "commercial technical data" pursuant to the applicable Federal Acquisition Regulation and agency-specific supplemental regulations. As such, the use, duplication, disclosure, modification, and adaptation shall be subject to the restrictions and license terms set forth in the applicable Government contract, and, to the extent applicable by the terms of the Government contract, the additional rights set forth in FAR 52.227-19, Commercial Computer Software License (December 2007). Oracle USA, Inc., 500 Oracle Parkway, Redwood City, CA 94065.
This software is developed for general use in a variety of information management applications. It is not developed or intended for use in any inherently dangerous applications, including applications which may create a risk of personal injury. If you use this software in dangerous applications, then you shall be responsible to take all appropriate fail-safe, backup, redundancy, and other measures to ensure the safe use of this software. Oracle Corporation and its affiliates disclaim any liability for any damages caused by use of this software in dangerous applications.
Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners.
This software and documentation may provide access to or information on content, products, and services from third parties. Oracle Corporation and its affiliates are not responsible for and expressly disclaim all warranties of any kind with respect to third-party content, products, and services. Oracle Corporation and its affiliates will not be responsible for any loss, costs, or damages incurred due to your access to or use of third-party content, products, or services.
This package defines macros which declare functions (or function pointers) for XML callbacks. Callbacks are used for error-message handling, memory allocation and freeing, and stream operations.
This chapter contains this section:
Table 1-1 lists all C datatypes and their descriptions.
Table 1-1 Summary of C Datatypes
Datatype | Purpose |
---|---|
|
Checkword for validating data structures. |
|
Error code: |
|
The id of property; if |
|
Opaque memory context. |
|
Property name. |
|
Property value type. |
|
Value: union of storage for all data types. |
|
Opaque stream object. |
|
Storage for file handles. |
|
Constant used for DOM Range comparisons. |
|
Context shared for all documents in an XML session. |
|
Specifies input types for |
|
Numeric error code returned by many functions. |
|
XML Event context. |
|
The hash value of an XML tree or sub-tree; also known as a digest. |
|
Generic user-defined input stream. |
|
Control structure for DOM2 |
|
The numeric type code of a node. |
|
Generic user-defined output stream. |
|
XPointer point location. |
|
Controls structure for DOM2 Range. |
|
Binding for SOAP connections. |
|
SOAP connection object. |
|
Context for SOAP operations. |
|
Role for a SOAP node. |
|
Bit flags used to select which node types to show. |
|
This is an enumeration of the known access methods for retrieving data from a URL. |
|
This union contains the handle(s) needed to access URL data, be it a stream or |
|
This structure contains the sub-parts of a URL. |
|
XPointer location datatype. |
|
XPointer location set datatype. |
|
Type of XSLT object that may be returned. |
|
Type of output produced by the XSLT processor. |
|
An object of type |
|
An object of type |
|
Control flags for the XSLT compiler. |
|
Type of XSLTVM object. |
|
XPath top-level context. |
|
XPath expression. |
|
XPath object. |
|
XMLSchema validator context. |
|
XSL top-level context. |
|
XSLVM processor run-time object; contents are private and must not be accessed by users. |
Checkword for validating data structures.
Definition
typedef ub4 oracheck;
Error code: 0
is success, non-0
is failure.
Definition
typedef ub4 oraerr;
The id of property; if >= 0
it is valid, if < 0
, it is invalid.
Definition
typedef sb2 oraprop_id;
Opaque memory context.
Definition
typedef struct oramemctx oramemctx;
Property name.
Definition
typedef struct oraprop { oratext *name_oraprop; oraprop_id id_oraprop; oraprop_t type_oraprop; oraprop_v value_oraprop; } oraprop;
Property value type.
Definition
typedef enum { ORAPROP_TYPE_BOOLEAN, ORAPROP_TYPE_SIGNED, ORAPROP_TYPE_UNSIGNED, ORAPROP_TYPE_POINTER } oraprop_t;
Value: union of storage for all data types.
Definition
typedef union oraprop_v { boolean b_oraprop_v; sb4 s_oraprop_v; ub4 u_oraprop_v; void *p_oraprop_v; } oraprop_v;
Opaque stream object.
Definition
typedef struct orastream orastream;
Storage for file handles.
Definition
typedef union orastreamhdl { void *ptr_orastreamhdl; /* generic pointer stream/file/etc */ struct { sb4 fd_orastreamhdl; /* file descriptor(s) [FTP needs all 3!] */ sb4 fd2_orastreamhdl; sb4 fd3_orastreamhdl; } fds_lpihdl; } orastreamhdl;
Constant used for DOM Range comparisons.
Definition
typedef enum { XMLDOM_START_TO_START , XMLDOM_START_TO_END , XMLDOM_END_TO_END , XMLDOM_END_TO_START } xmlcmphow;
Context shared for all documents in an XML session. Contains encoding information, low-level memory allocation function pointers, error message language or encoding and optional handler function, and so on. Required to load (parse) documents and create DOM, generate SAX, and so on.
Definition
struct xmlctx; typedef struct xmlctx xmlctx;
Operation type, represents one or more operations. Used for passing the diff
to a custom Operation Buildder (OB) in XmlDiff().
Definition
typedef enum { XMLDF_OP_NONE, /* Should not be set to non-zero for XMLDF_NUM_OP macro below */ XMLDF_OP_UPDATE, XMLDF_OP_RENAME, XMLDF_OP_DELETE, XMLDF_OP_INSERT_BEFORE, XMLDF_OP_APPEND } xmldfoptype;
Specifies input types for XmlDiff
operations.
Definition
typedef enum { XMLDF_SRCT_NONE , /* default is DOM */ XMLDF_SRCT_DOM, /* DOM: doc node must be specified */ XMLDF_SRCT_FILE, /* file name must be specified */ XMLDF_SRCT_URL, /* URL in compiler encoding */ XMLDF_SRCT_BUFFER, /* buffer: buffer pointer and length must be specified */ XMLDF_SRCT_FILEP, /* FILE */ XMLDF_SRCT_OSTREAM, /* orastream: stream pointer must be specified */ XMLDF_SRCT_DOMNODE /* DOM node, used with XmlHash() */ } xmldfsrct;
Numeric error code returned by many functions. A zero value indicates success; a nonzero value indicates error.
Definition
typedef enum { XMLERR_OK , /* success return */ XMLERR_NULL_PTR , /* NULL pointer */ XMLERR_NO_MEMORY , /* out of memory */ XMLERR_HASH_DUP , /* duplicate entry in hash table */ XMLERR_INTERNAL , /* internal error */ XMLERR_BUFFER_OVERFLOW , /* name/quoted string too long */ XMLERR_BAD_CHILD , /* invalid child for parent */ XMLERR_EOI , /* unexpected EndOfInformation */ XMLERR_BAD_MEMCB , /* invalid memory callbacks */ XMLERR_UNICODE_ALIGN , /* Unicode data misalignment */ XMLERR_NODE_TYPE , /* wrong node type */ XMLERR_UNCLEAN , /* context is not clean */ XMLERR_NESTED_STRINGS , /* internal: nested open str */ XMLERR_PROP_NOT_FOUND , /* property not found */ XMLERR_SAVE_OVERFLOW , /* save output overflowed */ XMLERR_NOT_IMP , /* feature not implemented */ XMLERR_NLS_MISMATCH , /* specify lxglo/lxd or neither*/ XMLERR_NLS_INIT , /* error at NLS initialization */ XMLERR_LEH_INIT , /* error at LEH initialization */ XMLERR_LML_INIT , /* error at LML initialization */ XMLERR_LPU_INIT /* error at LPU initialization */ } xmlerr;
XML Event context.
Definition
typedef struct { void *ctx_xmlevctx; /* implementation specific context */ xmlevdisp disp_xmlevctx; /* dispatch table */ ub4 checkword_xmlevctx; /* checkword for integrity check */ ub4 flags_xmlevctx; /* mode; default: expand_entity */ struct xmlevctx; /* input xmlevctx; chains the XML Event context */ } xmlevctx;
The event type for parser pull events.
Definition
typedef enum xmlevtype { XML_EVENT_FATAL_ERROR, /* Fatal Error */ XML_EVENT_BEFORE_START, /* Before Start Document */ XML_EVENT_START_DOCUMENT, /* Indicates Start Document */ XML_EVENT_START_DTD, /* Start DTD */ XML_EVENT_END_DTD, /* End DTD */ XML_EVENT_NOTATION_DECLARATION, /* Notation Decl */ XML_EVENT_PE_DECLARATION, /* PE Decl */ XML_EVENT_UE_DECLARATION, /* US Decl */ XML_EVENT_ELEMENT_DECLARATION, /* Element Decl */ XML_EVENT_ATTLIST_DECLARATION, /* Attribute Decl */ XML_EVENT_START_ELEMENT, /* Start Element */ XML_EVENT_END_ELEMENT, /* End Element */ XML_EVENT_CHARACTERS, /* Characters (text) */ XML_EVENT_CHARACTERS_CONT, /* Characters Continued */ XML_EVENT_PI, /* Processing Instruction */ XML_EVENT_PI_CONT, /* Processing Instruction Continued */ XML_EVENT_COMMENT, /* Comment */ XML_EVENT_COMMENT_CONT, /* Comment Continued */ XML_EVENT_SPACE, /* White Space */ XML_EVENT_SPACE_CONT, /* White Space Continued */ XML_EVENT_ENTITY_REFERENCE, /* Entity Reference */ XML_EVENT_CDATA, /* CDATA */ XML_EVENT_CDATA_CONT, /* CDATA continued */ XML_EVENT_START_ENTITY, /* Start Entity */ XML_EVENT_END_ENTITY, /* End Entity */ XML_EVENT_END_DOCUMENT, /* End Document */ XML_EVENT_ERROR /* Error */ }xmlevtype;
The hash value of an XML tree or sub-tree; also known as a digest.
If the hash values for two XML trees are equal, the trees are considered equal, to a very high probability; uses the MD5 algorithm.
Definition
struct xmlhasht { ub4 l_xmlhasht; /* lenght of digest in bytes */ ub1 d_xmlhasht[XMLDF_DIGEST_MAX]; /* the digest */ }; typedef struct xmlhasht xmlhasht;
Generic user-defined input stream. The three function pointers are required (but may be stubs). The context pointer is entirely user-defined; point it to whatever state information is required to manage the stream; it will be passed as first argument to the user functions.
Definition
typedef struct xmlistream { XML_STREAM_OPEN_F( (*open_xmlistream), xctx, sctx, path, parts, length); XML_STREAM_READ_F( (*read_xmlistream), xctx, sctx, path, dest, size, nraw, eoi); XML_STREAM_CLOSE_F( (*close_xmlistream), xctx, sctx); void *ctx_xmlistream; /* user's stream context */ } xmlistream;
Control structure for DOM 2 NodeIterator
and TreeWalker
.
Definition
struct xmliter { xmlnode *root_xmliter; /* root node of the iteration space */ xmlnode *cur_xmliter; /* current position iterator ref node */ ub4 show_xmliter; /* node filter mask */ void *filt_xmliter; /* node filter function */ boolean attach_xmliter; /* is iterator valid? */ boolean expan_xmliter; /* are external entities expanded? */ boolean before_xmliter; /* iter position before ref node? */ }; typedef struct xmliter xmliter; typedef struct xmliter xmlwalk;
The numeric type code of a node. 0
means invalid, 1-13 are the standard numberings from DOM 1.0, and higher numbers are for internal use only.
Definition
typedef enum { XMLDOM_NONE , /* bogus node */ XMLDOM_ELEM , /* element */ XMLDOM_ATTR , /* attribute */ XMLDOM_TEXT , /* char data not escaped by CDATA */ XMLDOM_CDATA , /* char data escaped by CDATA */ XMLDOM_ENTREF , /* entity reference */ XMLDOM_ENTITY , /* entity */ XMLDOM_PI , /* <?processing instructions?> */ XMLDOM_COMMENT , /* <!-- Comments --> */ XMLDOM_DOC , /* Document */ XMLDOM_DTD , /* DTD */ XMLDOM_FRAG , /* Document fragment */ XMLDOM_NOTATION , /* notation */ /* Oracle extensions from here on */ XMLDOM_ELEMDECL , /* DTD element declaration */ XMLDOM_ATTRDECL , /* DTD attribute declaration */ /* Content Particles (nodes in element's Content Model) */ XMLDOM_CPELEM , /* element */ XMLDOM_CPCHOICE , /* choice (a|b) */ XMLDOM_CPSEQ , /* sequence (a,b) */ XMLDOM_CPPCDATA , /* #PCDATA */ XMLDOM_CPSTAR , /* '*' (zero or more) */ XMLDOM_CPPLUS , /* '+' (one or more) */ XMLDOM_CPOPT , /* '?' (optional) */ XMLDOM_CPEND /* end marker */ } xmlnodetype;
Generic user-defined output stream. The three function pointers are required (but may be stubs). The context pointer is entirely user-defined; point it to whatever state information is required to manage the stream; it will be passed as first argument to the user functions.
Definition
typedef struct xmlostream { XML_STREAM_OPEN_F( (*open_xmlostream), xctx, sctx, path, parts, length); XML_STREAM_WRITE_F( (*write_xmlostream), xctx, sctx, path, src, size); XML_STREAM_CLOSE_F( (*close_xmlostream), xctx, sctx); void *ctx_xmlostream; /* user's stream context */ } xmlostream;
XPointer point location.
Definition
typedef struct xmlpoint xmlpoint;
Control structure for DOM 2 Range.
Definition
typedef struct xmlrange { xmlnode *startnode_xmlrange; /* start point container */ ub4 startofst_xmlrange; /* start point index */ xmlnode *endnode_xmlrange; /* end point container */ ub4 endofst_xmlrange; /* end point index */ xmlnode *doc_xmlrange; /* document node */ xmlnode *root_xmlrange; /* root node of the range */ boolean collapsed_xmlrange; /* is range collapsed? */ boolean detached_xmlrange; /* range invalid, invalidated?*/ } xmlrange;
Binding for SOAP connections. SOAP does not dictate the binding (transport) used for conveying messages; however the HTTP protocol is well-defined and currently the only choice.
Definition
typedef enum xmlsoapbind { XMLSOAP_BIND_NONE , /* none */ XMLSOAP_BIND_HTTP /* HTTP */ } xmlsoapbind;
SOAP connection object. Each distinct connection requires an instance of this type, which contains binding and endpoint information.
Definition
typedef struct xmlsoapcon xmlsoapcon;
Context for SOAP operations. Only a single context is needed and it can be shared by several SOAP messages.
Definition
typedef struct xmlsoapctx xmlsoapctx;
Role for a SOAP node.
Definition
typedef enum xmlsoaprole { XMLSOAP_ROLE_UNSET, /* not specified */ XMLSOAP_ROLE_NONE, /* "none" */ XMLSOAP_ROLE_NEXT, /* "next" */ XMLSOAP_ROLE_ULT, /* "ultimateReceiver" */ XMLSOAP_ROLE_OTHER /* other - user defined */ } xmlsoaprole;
Bit flags used to select which nodes types to show.
Definition
typedef ub4 xmlshowbits; #define XMLDOM_SHOW_ALL ~(ub4)0 #define XMLDOM_SHOW_BIT(ntype) ((ub4)1 << (ntype)) #define XMLDOM_SHOW_ELEM XMLDOM_SHOW_BIT(XMLDOM_ELEM) #define XMLDOM_SHOW_ATTR XMLDOM_SHOW_BIT(XMLDOM_ATTR) #define XMLDOM_SHOW_TEXT XMLDOM_SHOW_BIT(XMLDOM_TEXT) #define XMLDOM_SHOW_CDATA XMLDOM_SHOW_BIT(XMLDOM_CDATA) #define XMLDOM_SHOW_ENTREF XMLDOM_SHOW_BIT(XMLDOM_ENTREF) #define XMLDOM_SHOW_ENTITY XMLDOM_SHOW_BIT(XMLDOM_ENTITY) #define XMLDOM_SHOW_PI XMLDOM_SHOW_BIT(XMLDOM_PI) #define XMLDOM_SHOW_COMMENT XMLDOM_SHOW_BIT(XMLDOM_COMMENT) #define XMLDOM_SHOW_DOC XMLDOM_SHOW_BIT(XMLDOM_DOC) #define XMLDOM_SHOW_DTD XMLDOM_SHOW_BIT(XMLDOM_DTD) #define XMLDOM_SHOW_FRAG XMLDOM_SHOW_BIT(XMLDOM_FRAG) #define XMLDOM_SHOW_NOTATION XMLDOM_SHOW_BIT(XMLDOM_NOTATION) #define XMLDOM_SHOW_DOC_TYPE XMLDOM_SHOW_BIT(XMLDOM_DOC_TYPE)
This is an enumeration of the known access methods for retri0eving data from a URL. Open/read/close functions may be plugged in to override the default behavior.
Definition
typedef enum { XML_ACCESS_NONE , /* not specified */ XML_ACCESS_UNKNOWN , /* specified but unknown */ XML_ACCESS_FILE , /* filesystem access */ XML_ACCESS_HTTP , /* HTTP */ XML_ACCESS_FTP , /* FTP */ XML_ACCESS_GOPHER , /* Gopher */ XML_ACCESS_ORADB , /* Oracle DB */ XML_ACCESS_STREAM /* user-defined stream */ } xmlurlacc;
This union contains the handle(s) needed to access URL data, be it a stream or stdio pointer, file descriptor(s), and so on.
Definition
typedef union xmlurlhdl { void *ptr_xmlurlhdl; /* generic stream/file/... handle */ struct { sb4 fd1_xmlurlhdl; /* file descriptor(s) [FTP needs all 3!] */ sb4 fd2_xmlurlhdl; sb4 fd3_xmlurlhdl; } fds_lpihdl; } xmlurlhdl;
This structure contains the sub-parts of a URL. The original URL is parsed and the pieces copies (NULL
-terminated) to a working buffer, then this structure is filled in to point to the parts. Given URL http://user:pwd@baz.com:8080/pub/baz.html;quux=1?huh#fraggy
, the example component part from this URL will be shown.
Definition
typedef struct xmlurlpart { xmlurlacc access_xmlurlpart; /* access method code, XMLACCESS_HTTP */ oratext *accbuf_xmlurlpart; /* access method name: "http" */ oratext *host_xmlurlpart; /* hostname: "baz.com" */ oratext *dir_xmlurlpart; /* directory: "pub" */ oratext *file_xmlurlpart; /* filename: "baz.html" */ oratext *uid_xmlurlpart; /* userid/username: "user" */ oratext *passwd_xmlurlpart; /* password: "pwd" */ oratext *port_xmlurlpart; /* port (as string): "8080" */ oratext *frag_xmlurlpart; /* fragment: "fraggy" */ oratext *query_xmlurlpart; /* query: "huh" */ oratext *param_xmlurlpart; /* parameter: "quux=1" */ ub2 portnum_xmlurlpart; /* port (as number): 8080 */ ub1 abs_xmlurlpart; /* absolute path? TRUE */ } xmlurlpart;
XPointer location data type.
Definition
typedef struct xmlxptrloc xmlxptrloc;
XPointer location set data type.
Definition
typedef struct xmlxptrlocset xmlxptrlocset;
Type of XSLT object that may be returned.
Definition
typedef enum xmlxslobjtype { XMLXSL_TYPE_UNKNOWN , /* Not a defined type */ XMLXSL_TYPE_NDSET , /* Node-set */ XMLXSL_TYPE_BOOL , /* Boolean value */ XMLXSL_TYPE_NUM , /* Numeric value (double) */ XMLXSL_TYPE_STR , /* String */ XMLXSL_TYPE_FRAG /* Document Fragment */ } xmlxslobjtype;
Type of output to be produced by the XSLT processor.
Definition
typedef enum xmlxslomethod { XMLXSL_OUTPUT_UNKNOWN , /* Not defined */ XMLXSL_OUTPUT_XML , /* Produce a Document Fragment */ XMLXSL_OUTPUT_STREAM , /* Stream out formatted result */ XMLXSL_OUTPUT_HTML /* Stream out HTML formatted result */ } xmlxslomethod;
An object of type xmlxvm
is used for XML documents transformation. The contents of xmlxvm
are private and must not be accessed by users.
Definition
struct xmlxvm; typedef struct xmlxvm xmlxvm;
An object of type xmlxvmcomp
is used for compiling XSL stylesheets. The contents of xmlxvmcomp
are private and must not be accessed by users.
Definition
struct xmlxvmcomp; typedef struct xmlxvmcomp xmlxvmcomp;
Control flags for the XSLT compiler.
XMLXVM_DEBUG
forces compiler to insert debug information into the bytecode.
XMLXVM_STRIPSPACE
forces the same behavior as xsl:strip-space elements="*"
Definition
typedef ub4 xmlxvmflag; #define XMLXVM_NOFLAG #define XMLXVM_DEBUG /* insert debug info into bytecode */ #define XMLXVM_STRIPSPACE /* same as xsl:strip-space elements="*" */
Type of XSLTVM object.
Definition
typedef enum xmlxvmobjtype { XMLXVM_TYPE_UNKNOWN , XMLXVM_TYPE_NDSET , XMLXVM_TYPE_BOOL , XMLXVM_TYPE_NUM , XMLXVM_TYPE_STR , XMLXVM_TYPE_FRAG } xmlxvmobjtype;
XPath top-level context.
Definition
struct xpctx; typedef struct xpctx xpctx;
XPath expression.
Definition
struct xpexpr; typedef struct xpexpr xpexpr;
Xpath object.
Definition
struct xpobj;typedef struct xpobj xpobj;
XML Schema validator context, created by XmlSchemaCreate
and passed to most Schema functions.
Definition
# define XSDCTX_DEFINED struct xsdctx; typedef struct xsdctx xsdctx;
XSL top-level context.
Definition
struct xslctx; typedef struct xslctx xslctx;
XSLVM processor run-time object; content is private and must not be accessed by users.
Definition
struct xvmobj; typedef struct xvmobj xvmobj;
Package Traversal contains APIs for four interfaces.
This chapter contains the following sections:
Table 10-1 summarizes the methods available through the DocumentTraversal interface.
Table 10-1 Summary of DocumentTraversal Methods; Traversal Package
Function | Summary |
---|---|
|
Create node iterator object. |
|
Create a tree walker object. |
One of two methods of DocumentTraversal
interface, used to create a NodeIterator
object. This method is identical to XmlDomCreateTreeWalker() except for the type of object returned.
The whatToShow
argument is a mask of flag bits, one for each node type. The value XMLDOM_SHOW_ALL
passes all node types through, otherwise only the types whose bits are set will be passed.
Entity
reference expansion is controlled by the entrefExpansion
flag. If TRUE
, entity references are replaced with their final content; if FALSE
, entity references are left as nodes.
Syntax
xmliter* XmlDomCreateNodeIter( xmlctx *xctx, xmliter *iter, xmlnode *root, xmlshowbits whatToShow, XMLDOM_ACCEPT_NODE_F( (*nodeFilter), xctx, node), boolean entrefExpand);
Parameter | In/Out | Description |
---|---|---|
xctx |
IN | XML context |
iter |
IN | existing NodeIterator to set, NULL to create |
xerr |
IN | root node for NodeIterator |
whatToShow |
IN | mask of XMLDOM_SHOW_ XXX flag bits |
nodeFilter |
IN | node filter to be used, NULL if none |
xerr |
IN | whether to expand entity reference nodes |
Returns
(xmliter *)
original or new NodeIterator
object
One of two methods of DocumentTraversal interface, used to create a TreeWalker
object. This method is identical to XmlDomCreateNodeIter() except for the type of object returned.
The whatToShow
argument is a mask of flag bits, one for each node type. The value XMLDOM_SHOW_ALL
passes all node types through, otherwise only the types whose bits are set will be passed.
Entity
reference expansion is controlled by the entrefExpansion
flag. If TRUE
, entity references are replaced with their final content; if FALSE
, entity references are left as nodes.
Syntax
xmlwalk* XmlDomCreateTreeWalker( xmlctx *xctx, xmlwalk* walker, xmlnode *root, xmlshowbits whatToShow, XMLDOM_ACCEPT_NODE_F( (*nodeFilter), xctx, node), boolean entrefExpansion);
Parameter | In/Out | Description |
---|---|---|
xctx |
IN | XML context |
walker |
IN | existing TreeWalker to set, NULL to create |
xerr |
IN | root node for TreeWalker |
whatToShow |
IN | mask of XMLDOM_SHOW_ XXX flag bits |
nodeFilter |
IN | node filter to be used, NULL if none |
xerr |
IN | whether to expand entity reference nodes |
Returns
(xmlwalk *)
new TreeWalker
object
Table 10-2 summarizes the methods available through the NodeFilter interface.
Table 10-2 Summary of NodeFileter Methods; Traversal Package
Function | Summary |
---|---|
|
Determines the filtering action based on node adn filter.. |
Sole method of NodeFilter
interface. Given a node and a filter, determines the filtering action to perform.
This function pointer is passed to the node iterator/tree walker methods, as needed.
Values for xmlerr are:
XMLERR_OK
Accept the node. Navigation methods defined for NodeIterator
or TreeWalker
will return this node.
XMLERR_FILTER_REJECT
Reject the node. Navigation methods defined for NodeIterator
or TreeWalker
will not return this node. For TreeWalker
, the children of this node will also be rejected. NodeIterator
s treat this as a synonym for XMLDOM_FILTER_SKIP
XMLERR_FILTER_SKIP
Skip this single node. Navigation methods defined for NodeIterator
or TreeWalker
will not return this node. For both NodeIterator
and TreeWalker
, the children of this node will still be considered.
Syntax
#define XMLDOM_ACCEPT_NODE_F(func, xctx, node) xmlerr func( xmlctx *xctx, xmlnode *node);
Parameter | In/Out | Description |
---|---|---|
xctx |
IN | XML context |
node |
IN | node to test |
Returns
(xmlerr)
filtering result
Table 10-3 summarizes the methods available through the NodeIterator
interface.
Table 10-3 Summary of NodeIterator Methods; Package Traversal
Function | Summary |
---|---|
|
Detach a node iterator (deactivate it). |
|
Returns next node for iterator. |
|
Returns previous node for iterator. |
Detaches the NodeIterator
from the set which it iterated over, releasing any resources and placing the iterator in the INVALID
state. After detach has been invoked, calls to XmlDomIterNextNode
or XmlDomIterPrevNode
will raise the exception XMLERR_ITER_DETACHED
.
Syntax
xmlerr XmlDomIterDetach( xmlctx *xctx, xmliter *iter);
Parameter | In/Out | Description |
---|---|---|
xctx |
IN | XML context |
iter |
IN | node iterator object |
Returns the next node in the set and advances the position of the iterator in the set. After a node iterator is created, the first call to XmlDomIterNextNode
returns the first node in the set. It assumed that the reference node (current iterator position) is never deleted. Otherwise, changes in the underlying DOM tree do not invalidate the iterator.
Syntax
xmlnode* XmlDomIterNextNode( xmlctx *xctx, xmliter *iter, xmlerr *xerr);
Parameter | In/Out | Description |
---|---|---|
xctx |
IN | XML context |
iter |
IN | node iterator object |
xerr |
OUT | numeric return error code |
Returns
(xmlnode *)
next node in set being iterated over [or NULL
]
Returns the previous node in the set and moves the position of the iterator backward in the set.
Syntax
xmlnode* XmlDomIterPrevNode( xmlctx *xctx, xmliter *iter, xmlerr *xerr);
Parameter | In/Out | Description |
---|---|---|
xctx |
IN | XML context |
iter |
IN | node iterator object |
xerr |
OUT | numeric return error code |
Returns
(xmlnode *)
previous node in set being iterated over [or NULL
]
Table 10-4 summarizes the methods available through the TreeWalker
interface.
Table 10-4 Summary of TreeWalker Methods; Traversal Package
Function | Summary |
---|---|
|
Return first visible child of current node. |
|
Return current node. |
|
Return root node. |
|
Return last visible child of current node. |
|
Return next visible node. |
|
Return next sibling node. |
|
Return parent node. |
|
Return previous node. |
|
Return previous sibling node. |
|
Set current node. |
|
Set the root node. |
Moves the TreeWalker
to the first visible child of the current node, and returns the new node. If the current node has no visible children, returns NULL
, and retains the current node.
Syntax
xmlnode* XmlDomWalkerFirstChild( xmlctx *xctx, xmlwalk *walker, xmlerr *xerr);
Parameter | In/Out | Description |
---|---|---|
xctx |
IN | XML context |
walker |
IN | TreeWalker object |
xerr |
OUT | numeric return error code |
Returns
(xmlnode *)
first visible child [or NULL
]
Return (get) current node, or NULL
on error.
Syntax
xmlnode* XmlDomWalkerGetCurrentNode( xmlctx *xctx, xmlwalk *walker, xmlerr *xerr);
Parameter | In/Out | Description |
---|---|---|
xctx |
IN | XML context |
walker |
IN | TreeWalker object |
xerr |
OUT | numeric return error code |
Returns
(xmlnode *)
current node
Return (get) root node, or NULL
on error. Since the current node can be removed from under the root node together with a subtree where it belongs to, the current root node in a walker might have no relation to the current node any more. The TreeWalker
iterations are based on the current node. However, the root node defines the space of an iteration. This function checks if the root node is still in the root node (ancestor) relation to the current node. If so, it returns this root node. Otherwise, it finds the root of the tree where the current node belongs to, and sets and returns this root as the root node of the walker. It returns NULL
if the walker is a NULL
pointer.
Syntax
xmlnode* XmlDomWalkerGetRoot( xmlctx *xctx, xmlwalk *walker, xmlerr *xerr);
Parameter | In/Out | Description |
---|---|---|
xctx |
IN | XML context |
walker |
IN | TreeWalker object |
xerr |
OUT | numeric return error code |
Returns
(xmlnode *)
root node
Moves the TreeWalker
to the last visible child of the current node, and returns the new node. If the current node has no visible children, returns NULL
, and retains the current node.
Syntax
xmlnode* XmlDomWalkerLastChild( xmlctx *xctx, xmlwalk *walker, xmlerr *xerr);
Parameter | In/Out | Description |
---|---|---|
xctx |
IN | XML context |
walker |
IN | TreeWalker object |
xerr |
OUT | numeric return error code |
Returns
(xmlnode *)
last visible children [or NULL
]
Moves the TreeWalker
to the next visible node in document order relative to the current node, and returns the new node. If the current node has no next node, or if the search for the next node attempts to step upward from the TreeWalker
's root node, returns NULL
, and retains the current node.
Syntax
xmlnode* XmlDomWalkerNextNode( xmlctx *xctx, xmlwalk *walker, xmlerr *xerr);
Parameter | In/Out | Description |
---|---|---|
xctx |
IN | XML context |
walker |
IN | TreeWalker object |
xerr |
OUT | numeric return error code |
Returns
(xmlnode *)
next node [or NULL
]
Moves the TreeWalker
to the next sibling of the current node, and returns the new node. If the current node has no visible next sibling, returns NULL
, and retains the current node.
Syntax
xmlnode* XmlDomWalkerNextSibling( xmlctx *xctx, xmlwalk *walker, xmlerr *xerr);
Parameter | In/Out | Description |
---|---|---|
xctx |
IN | XML context |
walker |
IN | TreeWalker object |
xerr |
OUT | numeric return error code |
Returns
(xmlnode *)
next sibling [or NULL
]
Moves to and returns the closest visible ancestor node of the current node. If the search for the parent node attempts to step upward from the TreeWalker
's root node, or if it fails to find a visible ancestor node, this method retains the current position and returns null.
Syntax
xmlnode* XmlDomWalkerParentNode( xmlctx *xctx, xmlwalk *walker, xmlerr *xerr);
Parameter | In/Out | Description |
---|---|---|
xctx |
IN | XML context |
walker |
IN | TreeWalker object |
xerr |
OUT | numeric return error code |
Returns
(xmlnode *)
parent node [or NULL
]
Moves the TreeWalker
to the previous visible node in document order relative to the current node, and returns the new node. If the current node has no previous node, or if the search for the previous node attempts to step upward from the TreeWalker
's root node, returns NULL
, and retains the current node.
Syntax
xmlnode* XmlDomWalkerPrevNode( xmlctx *xctx, xmlwalk *walker, xmlerr *xerr);
Parameter | In/Out | Description |
---|---|---|
xctx |
IN | XML context |
walker |
IN | TreeWalker object |
xerr |
OUT | numeric return error code |
Returns
(xmlnode *)
previous node [or NULL
]
Moves the TreeWalker
to the previous sibling of the current node, and returns the new node. If the current node has no visible previous sibling, returns NULL
, and retains the current node.
Syntax
xmlnode* XmlDomWalkerPrevSibling( xmlctx *xctx, xmlwalk *walker, xmlerr *xerr);
Parameter | In/Out | Description |
---|---|---|
xctx |
IN | XML context |
walker |
IN | TreeWalker object |
xerr |
OUT | numeric return error code |
Returns
(xmlnode *)
previous sibling [or NULL
]
Sets and returns new current node. It also checks if the root node is an ancestor of the new current node. If not it does not set the current node, returns NULL
, and sets retval to XMLDOM_WALKER_BAD_NEW_CUR
. Returns NULL
if an error.
Syntax
xmlnode* XmlDomWalkerSetCurrentNode( xmlctx *xctx, xmlwalk *walker, xmlnode *node, xmlerr *xerr);
Parameter | In/Out | Description |
---|---|---|
xctx |
IN | XML context |
walker |
IN | TreeWalker object |
node |
IN | new current node |
xerr |
OUT | numeric return error code |
Returns
(xmlnode *)
new current node
Set the root node. Returns new root node if it is an ancestor of the current node. If not it signals an error and checks if the current root node is an ancestor of the current node. If yes it returns it. Otherwise it sets the root node to and returns the root of the tree where the current node belongs to. It returns NULL
if the walker or the root node parameter is a NULL
pointer.
Syntax
xmlnode* XmlDomWalkerSetRoot( xmlctx *xctx, xmlwalk *walker, xmlnode *node, xmlerr *xerr);
Parameter | In/Out | Description |
---|---|---|
xctx |
IN | XML context |
walker |
IN | TreeWalker object |
node |
IN | new root node |
xerr |
OUT | numeric return error code |
Returns
(xmlnode *)
new root node
The Oracle Database XML C API Reference describes Oracle XML Developer's Kits (XDK) and Oracle XML DB APIs for the C programming language. It primarily lists the syntax of functions, methods, and procedures associated with these APIs.
Oracle Database XML C API Reference is intended for developers who are building XML applications in Oracle.
To use this document, you need a basic understanding of object-oriented programming concepts, familiarity with Structured Query Language (SQL), and working knowledge of application development using the C programming language.
Our goal is to make Oracle products, services, and supporting documentation accessible to all users, including users that are disabled. To that end, our documentation includes features that make information available to users of assistive technology. This documentation is available in HTML format, and contains markup to facilitate access by the disabled community. Accessibility standards will continue to evolve over time, and Oracle is actively engaged with other market-leading technology vendors to address technical obstacles so that our documentation can be accessible to all of our customers. For more information, visit the Oracle Accessibility Program Web site at http://www.oracle.com/accessibility/
.
Accessibility of Code Examples in Documentation
Screen readers may not always correctly read the code examples in this document. The conventions for writing code require that closing braces should appear on an otherwise empty line; however, some screen readers may not always read a line of text that consists solely of a bracket or brace.
Accessibility of Links to External Web Sites in Documentation
This documentation may contain links to Web sites of other companies or organizations that Oracle does not own or control. Oracle neither evaluates nor makes any representations regarding the accessibility of these Web sites.
Deaf/Hard of Hearing Access to Oracle Support Services
To reach Oracle Support Services, use a telecommunications relay service (TRS) to call Oracle Support at 1.800.223.1711. An Oracle Support Services engineer will handle technical issues and provide customer support according to the Oracle service request process. Information about TRS is available at http://www.fcc.gov/cgb/consumerfacts/trs.html
, and a list of phone numbers is available at http://www.fcc.gov/cgb/dro/trsphonebk.html
.
For more information, see the following documents in the Oracle Database 11g Release 2 (11.2) documentation set:
The following text conventions are used in this document:
Convention | Meaning |
---|---|
boldface | Boldface type indicates graphical user interface elements associated with an action, or terms defined in text or the glossary. |
italic | Italic type indicates book titles, emphasis, or placeholder variables for which you supply particular values. |
monospace | Monospace type indicates commands within a paragraph, URLs, code in examples, text that appears on the screen, or text that you enter. |