Skip Headers
Oracle® Database XML C API Reference
10g Release 2 (10.2)

Part Number B16207-01
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Master Index
Master Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
PDF · Mobi · ePub

1 Datatypes for C

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:

See Also:


C Datatypes

Table 1-1 lists all C datatypes and their descriptions.

Table 1-1 Summary of C Datatypes

Datatype Purpose
xmlcmphow Constant used for DOM Range comparisons.
xmlctx Context shared for all documents in an XML session.
xmlerr Numeric error code returned by many functions.
xmlistream Generic user-defined input stream.
xmliter Control structure for DOM2 NodeIterator and TreeWalker.
xmlnodetype The numeric type code of a node.
xmlostream Generic user-defined output stream.
xmlpoint XPointer point location.
xmlrange Controls structure for DOM2 Range.
xmlsoapbind Binding for SOAP connections.
xmlsoapcon SOAP connection object.
xmlsoapctx Context for SOAP operations.
xmlsoaprole Role for a SOAP node.
xmlshowbits Bit flags used to select which node types to show.
xmlurlacc This is an enumeration of the known access methods for retrieving data from a URL.
xmlurlhdl This union contains the handle(s) needed to access URL data, be it a stream or stdio pointer, file descriptor(s), and so on.
xmlurlpart This structure contains the sub-parts of a URL.
xmlxptrloc XPointer location datatype.
xmlxptrlocset XPointer location set datatype.
xmlxslobjtype Type of XSLT object that may be returned.
xmlxslomethod Type of output produced by the XSLT processor.
xmlxvm An object of type xmlxvm is used for XML document transformation.
xmlxvmcomp An object of type xmlxvmcomp is used for compiling XSL stylesheets.
xmlxvmflags Control flags for the XSLT compiler.
xmlxvmobjtype Type of XSLTVM object.
xpctx XPath top-level context.
xpexpr XPath expression.
xpobj XPath object.
xsdctx XMLSchema validator context.
xslctx XSL top-level context.
xvmobj XSLVM processor run-time object; contents are private and must not be accessed by users.


xmlcmphow

Constant used for DOM Range comparisons.

Definition

typedef enum {
    XMLDOM_START_TO_START = 0,
    XMLDOM_START_TO_END   = 1,
    XMLDOM_END_TO_END     = 2, 
    XMLDOM_END_TO_START   = 3
} xmlcmphow;

xmlctx

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;

xmlerr

Numeric error code returned by many functions. A zero value indicates success; a nonzero value indicates error.

Definition

typedef enum {
   XMLERR_OK              = 0, /* success return */
   XMLERR_NULL_PTR        = 1, /* NULL pointer */
   XMLERR_NO_MEMORY       = 2, /* out of memory */
   XMLERR_HASH_DUP        = 3, /* duplicate entry in hash table */
   XMLERR_INTERNAL        = 4,  /* internal error */
   XMLERR_BUFFER_OVERFLOW = 5,  /* name/quoted string too long */
   XMLERR_BAD_CHILD       = 6,  /* invalid child for parent */
   XMLERR_EOI             = 7,  /* unexpected EndOfInformation */
   XMLERR_BAD_MEMCB       = 8,  /* invalid memory callbacks */
   XMLERR_UNICODE_ALIGN   = 12, /* Unicode data misalignment */
   XMLERR_NODE_TYPE       = 13, /* wrong node type */
   XMLERR_UNCLEAN         = 14, /* context is not clean */
   XMLERR_NESTED_STRINGS  = 18, /* internal: nested open str */
   XMLERR_PROP_NOT_FOUND  = 19, /* property not found */
   XMLERR_SAVE_OVERFLOW   = 20, /* save output overflowed */
   XMLERR_NOT_IMP         = 21, /* feature not implemented */
   XMLERR_NLS_MISMATCH    = 50, /* specify lxglo/lxd or neither*/
   XMLERR_NLS_INIT        = 51, /* error at NLS initialization */
   XMLERR_LEH_INIT        = 52, /* error at LEH initialization */
   XMLERR_LML_INIT        = 53, /* error at LML initialization */
   XMLERR_LPU_INIT        = 54  /* error at LPU initialization */
} xmlerr;


xmlistream

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;


xmliter

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;


xmlnodetype

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     = 0,  /* bogus node */
    XMLDOM_ELEM     = 1,  /* element */
    XMLDOM_ATTR     = 2,  /* attribute */
    XMLDOM_TEXT     = 3,  /* char data not escaped by CDATA */
    XMLDOM_CDATA    = 4,  /* char data escaped by CDATA */
    XMLDOM_ENTREF   = 5,  /* entity reference */
    XMLDOM_ENTITY   = 6,  /* entity */
    XMLDOM_PI       = 7,  /* <?processing instructions?> */
    XMLDOM_COMMENT  = 8,  /* <!-- Comments --> */
    XMLDOM_DOC      = 9,  /* Document */
    XMLDOM_DTD      = 10, /* DTD */
    XMLDOM_FRAG     = 11, /* Document fragment */
    XMLDOM_NOTATION = 12, /* notation */

    /* Oracle extensions from here on */
    XMLDOM_ELEMDECL = 13, /* DTD element declaration */
    XMLDOM_ATTRDECL = 14, /* DTD attribute declaration */

    /* Content Particles (nodes in element's Content Model) */
    XMLDOM_CPELEM   = 15, /* element */
    XMLDOM_CPCHOICE = 16, /* choice (a|b) */
    XMLDOM_CPSEQ    = 17, /* sequence (a,b) */
    XMLDOM_CPPCDATA = 18, /* #PCDATA */
    XMLDOM_CPSTAR   = 19, /* '*' (zero or more) */
    XMLDOM_CPPLUS   = 20, /* '+' (one or more) */
    XMLDOM_CPOPT    = 21, /* '?' (optional) */
    XMLDOM_CPEND    = 22  /* end marker */
} xmlnodetype;


xmlostream

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;

xmlpoint

XPointer point location.

Definition

typedef struct xmlpoint xmlpoint;


xmlrange

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;


xmlsoapbind

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  = 0,  /* none */
   XMLSOAP_BIND_HTTP  = 1   /* HTTP */ } xmlsoapbind;


xmlsoapcon

SOAP connection object. Each distinct connection requires an instance of this type, which contains binding and endpoint information.

Definition

typedef struct xmlsoapcon xmlsoapcon;


xmlsoapctx

Context for SOAP operations. Only a single context is needed and it can be shared by several SOAP messages.

Definition

typedef struct xmlsoapctx xmlsoapctx;


xmlsoaprole

Role for a SOAP node.

Definition

typedef enum xmlsoaprole {
    XMLSOAP_ROLE_UNSET = 0,  /* not specified */
    XMLSOAP_ROLE_NONE  = 1,  /* "none" */
    XMLSOAP_ROLE_NEXT  = 2,  /* "next" */
    XMLSOAP_ROLE_ULT   = 3,   /* "ultimateReceiver" */
    XMLSOAP_ROLE_OTHER = 4    /* other - user defined */
} xmlsoaprole;

xmlshowbits

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)

xmlurlacc

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.

Definition

typedef enum {
    XML_ACCESS_NONE    = 0, /* not specified */
    XML_ACCESS_UNKNOWN = 1, /* specified but unknown */
    XML_ACCESS_FILE    = 2, /* filesystem access */
    XML_ACCESS_HTTP    = 3, /* HTTP */
    XML_ACCESS_FTP     = 4, /* FTP */
    XML_ACCESS_GOPHER  = 5, /* Gopher */
    XML_ACCESS_ORADB   = 6, /* Oracle DB */
    XML_ACCESS_STREAM  = 7  /* user-defined stream */
} xmlurlacc;


xmlurlhdl

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;

xmlurlpart

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;


xmlxptrloc

XPointer location data type.

Definition

typedef struct xmlxptrloc xmlxptrloc;


xmlxptrlocset

XPointer location set data type.

Definition

typedef struct xmlxptrlocset xmlxptrlocset;


xmlxslobjtype

Type of XSLT object that may be returned.

Definition

typedef enum xmlxslobjtype {
    XMLXSL_TYPE_UNKNOWN = 0, /* Not a defined type */
    XMLXSL_TYPE_NDSET   = 1, /* Node-set */
    XMLXSL_TYPE_BOOL    = 2, /* Boolean value */
    XMLXSL_TYPE_NUM     = 3, /* Numeric value (double) */
    XMLXSL_TYPE_STR     = 4, /* String */
    XMLXSL_TYPE_FRAG    = 5  /* Document Fragment */
} xmlxslobjtype;


xmlxslomethod

Type of output to be produced by the XSLT processor.

Definition

typedef enum xmlxslomethod {
 XMLXSL_OUTPUT_UNKNOWN = 0, /* Not defined */
 XMLXSL_OUTPUT_XML     = 1, /* Produce a Document Fragment */
 XMLXSL_OUTPUT_STREAM  = 2, /* Stream out formatted result */
 XMLXSL_OUTPUT_HTML    = 3  /* Stream out HTML formatted result */
} xmlxslomethod;


xmlxvm

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;


xmlxvmcomp

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;


xmlxvmflags

Control flags for the XSLT compiler.

Definition

typedef ub4 xmlxvmflag;
#define XMLXVM_NOFLAG     0x00
#define XMLXVM_DEBUG      0x01 /* insert debug info into bytecode */
#define XMLXVM_STRIPSPACE 0x02 /* same as xsl:strip-space elements="*" */


xmlxvmobjtype

Type of XSLTVM object.

Definition

typedef enum xmlxvmobjtype {
    XMLXVM_TYPE_UNKNOWN = 0,
    XMLXVM_TYPE_NDSET   = 1,
    XMLXVM_TYPE_BOOL    = 2,
    XMLXVM_TYPE_NUM     = 3,
    XMLXVM_TYPE_STR     = 4,
    XMLXVM_TYPE_FRAG    = 5
} xmlxvmobjtype;


xpctx

XPath top-level context.

Definition

struct xpctx;
typedef struct xpctx xpctx;


xpexpr

XPath expression.

Definition

struct xpexpr;
typedef struct xpexpr xpexpr;

xpobj

Xpath object.

Definition

struct xpobj;typedef struct xpobj xpobj;


xsdctx

XML Schema validator context, created by XmlSchemaCreate and passed to most Schema functions.

Definition

# define XSDCTX_DEFINED
struct xsdctx; typedef struct xsdctx xsdctx;

xslctx

XSL top-level context.

Definition

struct xslctx;
typedef struct xslctx xslctx;

xvmobj

XSLVM processor run-time object; content is private and must not be accessed by users.

Definition

struct xvmobj;
typedef struct xvmobj xvmobj;