Oracle® Database XML C API Reference 11g Release 2 (11.2) Part Number E10770-02 |
|
|
PDF · Mobi · ePub |
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:
CAXML5016Table 1-1 lists all C datatypes and their descriptions.
CAXML5017Table 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.
CAXML5019Definition
typedef ub4 oracheck;CAXML5020
Error code: 0
is success, non-0
is failure.
CAXML5021Definition
typedef ub4 oraerr;CAXML5022
The id of property; if >= 0
it is valid, if < 0
, it is invalid.
CAXML5023Definition
typedef sb2 oraprop_id;CAXML5024
Opaque memory context.
CAXML5025Definition
typedef struct oramemctx oramemctx;CAXML5026
Property name.
CAXML5027Definition
typedef struct oraprop { oratext *name_oraprop; oraprop_id id_oraprop; oraprop_t type_oraprop; oraprop_v value_oraprop; } oraprop;CAXML5028
Property value type.
CAXML5029Definition
typedef enum { ORAPROP_TYPE_BOOLEAN, ORAPROP_TYPE_SIGNED, ORAPROP_TYPE_UNSIGNED, ORAPROP_TYPE_POINTER } oraprop_t;CAXML5030
Value: union of storage for all data types.
CAXML5031Definition
typedef union oraprop_v { boolean b_oraprop_v; sb4 s_oraprop_v; ub4 u_oraprop_v; void *p_oraprop_v; } oraprop_v;CAXML5032
Opaque stream object.
CAXML5033Definition
typedef struct orastream orastream;CAXML5034
Storage for file handles.
CAXML5035Definition
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;CAXML5036
Constant used for DOM Range comparisons.
CAXML5037Definition
typedef enum { XMLDOM_START_TO_START , XMLDOM_START_TO_END , XMLDOM_END_TO_END , XMLDOM_END_TO_START } xmlcmphow;CAXML5038
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.
CAXML5039Definition
struct xmlctx; typedef struct xmlctx xmlctx;CAXML5040
Operation type, represents one or more operations. Used for passing the diff
to a custom Operation Buildder (OB) in XmlDiff().
CAXML5041Definition
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;CAXML5042
Specifies input types for XmlDiff
operations.
CAXML5043Definition
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;CAXML5044
Numeric error code returned by many functions. A zero value indicates success; a nonzero value indicates error.
CAXML5045Definition
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;CAXML5046
XML Event context.
CAXML5047Definition
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;CAXML5048
The event type for parser pull events.
CAXML5049Definition
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;CAXML5050
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.
CAXML5051Definition
struct xmlhasht { ub4 l_xmlhasht; /* lenght of digest in bytes */ ub1 d_xmlhasht[XMLDF_DIGEST_MAX]; /* the digest */ }; typedef struct xmlhasht xmlhasht;CAXML5052
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.
CAXML5053Definition
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;CAXML5054
Control structure for DOM 2 NodeIterator
and TreeWalker
.
CAXML5055Definition
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;CAXML5056
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.
CAXML5057Definition
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;CAXML5058
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.
CAXML5059Definition
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;CAXML5060
XPointer point location.
CAXML5061Definition
typedef struct xmlpoint xmlpoint;CAXML5062
Control structure for DOM 2 Range.
CAXML5063Definition
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;CAXML5064
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.
CAXML5065Definition
typedef enum xmlsoapbind { XMLSOAP_BIND_NONE , /* none */ XMLSOAP_BIND_HTTP /* HTTP */ } xmlsoapbind;CAXML5066
SOAP connection object. Each distinct connection requires an instance of this type, which contains binding and endpoint information.
CAXML5067Definition
typedef struct xmlsoapcon xmlsoapcon;CAXML5068
Context for SOAP operations. Only a single context is needed and it can be shared by several SOAP messages.
CAXML5069Definition
typedef struct xmlsoapctx xmlsoapctx;CAXML5070
Role for a SOAP node.
CAXML5071Definition
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;CAXML5072
Bit flags used to select which nodes types to show.
CAXML5073Definition
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)CAXML5074
This is an enumeration of the known access methods for retrieving data from a URL. Open/read/close functions may be plugged in to override the default behavior.
CAXML5075Definition
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;CAXML5076
This union contains the handle(s) needed to access URL data, be it a stream or stdio pointer, file descriptor(s), and so on.
CAXML5077Definition
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;CAXML5078
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.
CAXML5079Definition
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;CAXML5080
XPointer location data type.
CAXML5081Definition
typedef struct xmlxptrloc xmlxptrloc;CAXML5082
XPointer location set data type.
CAXML5083Definition
typedef struct xmlxptrlocset xmlxptrlocset;CAXML5084
Type of XSLT object that may be returned.
CAXML5085Definition
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;CAXML5086
Type of output to be produced by the XSLT processor.
CAXML5087Definition
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;CAXML5088
An object of type xmlxvm
is used for XML documents transformation. The contents of xmlxvm
are private and must not be accessed by users.
CAXML5089Definition
struct xmlxvm; typedef struct xmlxvm xmlxvm;CAXML5090
An object of type xmlxvmcomp
is used for compiling XSL stylesheets. The contents of xmlxvmcomp
are private and must not be accessed by users.
CAXML5091Definition
struct xmlxvmcomp; typedef struct xmlxvmcomp xmlxvmcomp;CAXML5092
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="*"
CAXML5093Definition
typedef ub4 xmlxvmflag; #define XMLXVM_NOFLAG #define XMLXVM_DEBUG /* insert debug info into bytecode */ #define XMLXVM_STRIPSPACE /* same as xsl:strip-space elements="*" */CAXML5094
Type of XSLTVM object.
CAXML5095Definition
typedef enum xmlxvmobjtype { XMLXVM_TYPE_UNKNOWN , XMLXVM_TYPE_NDSET , XMLXVM_TYPE_BOOL , XMLXVM_TYPE_NUM , XMLXVM_TYPE_STR , XMLXVM_TYPE_FRAG } xmlxvmobjtype;CAXML5096
XPath top-level context.
CAXML5097Definition
struct xpctx; typedef struct xpctx xpctx;CAXML5098
XPath expression.
CAXML5099Definition
struct xpexpr; typedef struct xpexpr xpexpr;CAXML5100
Xpath object.
CAXML5101Definition
struct xpobj;typedef struct xpobj xpobj;CAXML5102
XML Schema validator context, created by XmlSchemaCreate
and passed to most Schema functions.
CAXML5103Definition
# define XSDCTX_DEFINED struct xsdctx; typedef struct xsdctx xsdctx;CAXML5104
XSL top-level context.
CAXML5105Definition
struct xslctx; typedef struct xslctx xslctx;CAXML5106
XSLVM processor run-time object; content is private and must not be accessed by users.
CAXML5107Definition
struct xvmobj; typedef struct xvmobj xvmobj;