Oracle8i Application Developer's Guide - XML
Release 3 (8.1.7)

Part Number A86030-01


Solution Area



Go to previous page Go to beginning of chapter Go to next page

XDK for C: Specifications and Cheat Sheets, 4 of 8

XML Parser for C: Parser Functions

Table D-2 lists the XML Parser for C Parser functions, a brief description, and syntax.

Table D-2 XML Parser for C: Parser Function s 
Function  Brief Description  Syntax and Comments 


Initialize XML parser 

xmlctx *xmlinit (uword *err, const oratext *encoding, void (*msghdlr)(void *msgctx, const oratext *msg, ub4 errcode), void *msgctx, const xmlsaxcb *saxcb, void *saxcbctx, const xmlmemcb *memcb, void *memcbctx, const oratext *lang); 


Clean up memory used during parse 

void xmlclean(xmlctx *ctx);

For those who want to parse multiple files but would like to free the memory used for parses before the subsequent call to xmlparse() or xmlparsebuf(). 


Parse a file 

uword xmlparse(xmlctx *ctx, const oratext *filename, const oratext *encoding, ub4 flags);

Flag bits must be OR'd to override the default behavior of the parser. The following flag bits may be set:

  • XML_FLAG_VALIDATE turns validation on.

  • XML_FLAG_DISCARD_WHITESPACE discards whitespace where it appears to be insignificant.

The default behavior is to not validate the input. The default behavior for whitespace processing is to be fully conformant to the XML 1.0 spec, i.e. all whitespace is reported back to the application but it is indicated which whitespace is ignorable.  


Parse a buffer 

uword xmlparsebuf(xmlctx *ctx, const oratext *buffer, size_t len, const oratext *encoding, ub4 flags); 


Shut down XML parser 

uword xmlterm(xmlctx *ctx); 


Create a new document 

xmlnode* createDocument(xmlctx *ctx)

An XML document is always rooted in a node of type DOCUMENT_NODE-- this function creates that root node and sets it in the context. 


Return document's standalone flag 

boolean isStandalone(xmlctx *ctx)

Returns the boolean value of the document's standalone flag, as specified in the <?xml?> processing instruction.  

Go to previous page Go to beginning of chapter Go to next page
Copyright © 1996-2000, Oracle Corporation.

All Rights Reserved.


Solution Area