parser

Name

parser — one line description goes here.

Synopsis



#define     XML_DEFAULT_VERSION
void        (*xmlParserInputDeallocate)     (CHAR*);
typedef     xmlParserInputPtr
typedef     xmlParserNodeInfo
typedef     xmlParserNodeInfoSeq
typedef     xmlParserNodeInfoSeqPtr
typedef     xmlParserCtxt
typedef     xmlParserCtxtPtr
typedef     xmlSAXLocator
typedef     xmlSAXLocatorPtr
xmlParserInputPtr (*resolveEntitySAXFunc)   (xmlParserCtxtPtr ctxt,
                                             const CHAR *publicId,
                                             const CHAR *systemId);
void        (*notationDeclSAXFunc)          (xmlParserCtxtPtr ctxt,
                                             const CHAR *name,
                                             const CHAR *publicId,
                                             const CHAR *systemId);
void        (*unparsedEntityDeclSAXFunc)    (xmlParserCtxtPtr ctxt,
                                             const CHAR *name,
                                             const CHAR *publicId,
                                             const CHAR *systemId,
                                             const CHAR *notationName);
void        (*setDocumentLocatorSAXFunc)    (xmlParserCtxtPtr ctxt,
                                             xmlSAXLocatorPtr loc);
void        (*startDocumentSAXFunc)         (xmlParserCtxtPtr ctxt);
void        (*endDocumentSAXFunc)           (xmlParserCtxtPtr ctxt);
void        (*startElementSAXFunc)          (xmlParserCtxtPtr ctxt,
                                             const CHAR *name);
void        (*endElementSAXFunc)            (xmlParserCtxtPtr ctxt,
                                             const CHAR *name);
void        (*attributeSAXFunc)             (xmlParserCtxtPtr ctxt,
                                             const CHAR *name,
                                             const CHAR *value);
void        (*charactersSAXFunc)            (xmlParserCtxtPtr ctxt,
                                             const CHAR *ch,
                                             int start,
                                             int len);
void        (*ignorableWhitespaceSAXFunc)   (xmlParserCtxtPtr ctxt,
                                             const CHAR *ch,
                                             int start,
                                             int len);
void        (*processingInstructionSAXFunc) (xmlParserCtxtPtr ctxt,
                                             const CHAR *target,
                                             const CHAR *data);
void        (*warningSAXFunc)               (xmlParserCtxtPtr ctxt,
                                             const char *msg,
                                             ...);
void        (*errorSAXFunc)                 (xmlParserCtxtPtr ctxt,
                                             const char *msg,
                                             ...);
void        (*fatalErrorSAXFunc)            (xmlParserCtxtPtr ctxt,
                                             const char *msg,
                                             ...);
typedef     xmlSAXHandlerPtr
CHAR*       xmlStrdup                       (const CHAR *cur);
CHAR*       xmlStrndup                      (const CHAR *cur,
                                             int len);
CHAR*       xmlStrchr                       (const CHAR *str,
                                             CHAR val);
int         xmlStrcmp                       (const CHAR *str1,
                                             const CHAR *str2);
int         xmlStrncmp                      (const CHAR *str1,
                                             const CHAR *str2,
                                             int len);
int         xmlStrlen                       (const CHAR *str);
CHAR*       xmlStrcat                       (CHAR *cur,
                                             const CHAR *add);
CHAR*       xmlStrncat                      (CHAR *cur,
                                             const CHAR *add,
                                             int len);
xmlDocPtr   xmlParseDoc                     (CHAR *cur);
xmlDocPtr   xmlParseMemory                  (char *buffer,
                                             int size);
xmlDocPtr   xmlParseFile                    (const char *filename);
xmlDocPtr   xmlRecoverDoc                   (CHAR *cur);
xmlDocPtr   xmlRecoverMemory                (char *buffer,
                                             int size);
xmlDocPtr   xmlRecoverFile                  (const char *filename);
int         xmlParseDocument                (xmlParserCtxtPtr ctxt);
xmlDocPtr   xmlSAXParseDoc                  (xmlSAXHandlerPtr sax,
                                             CHAR *cur,
                                             int recovery);
xmlDocPtr   xmlSAXParseMemory               (xmlSAXHandlerPtr sax,
                                             char *buffer,
                                             int size,
                                             int recovery);
xmlDocPtr   xmlSAXParseFile                 (xmlSAXHandlerPtr sax,
                                             const char *filename,
                                             int recovery);
void        xmlInitParserCtxt               (xmlParserCtxtPtr ctxt);
void        xmlClearParserCtxt              (xmlParserCtxtPtr ctxt);
void        xmlSetupParserForBuffer         (xmlParserCtxtPtr ctxt,
                                             const CHAR *buffer,
                                             const char *filename);
const xmlParserNodeInfo* xmlParserFindNodeInfo
                                            (const xmlParserCtxt *ctxt,
                                             const xmlNode *node);
void        xmlInitNodeInfoSeq              (xmlParserNodeInfoSeqPtr seq);
void        xmlClearNodeInfoSeq             (xmlParserNodeInfoSeqPtr seq);
unsigned long xmlParserFindNodeInfoIndex    (const xmlParserNodeInfoSeq *seq,
                                             const xmlNode *node);
void        xmlParserAddNodeInfo            (xmlParserCtxtPtr ctxt,
                                             const xmlParserNodeInfo *info);
void        xmlDefaultSAXHandlerInit        (void);

Description

Details


XML_DEFAULT_VERSION

#define XML_DEFAULT_VERSION	"1.0"


xmlParserInputDeallocate()

void        (*xmlParserInputDeallocate)     (CHAR*);

Param1 : 


xmlParserInputPtr

typedef xmlParserInput *xmlParserInputPtr;


xmlParserNodeInfo

typedef _xmlParserNodeInfo xmlParserNodeInfo;


xmlParserNodeInfoSeq

typedef _xmlParserNodeInfoSeq xmlParserNodeInfoSeq;


xmlParserNodeInfoSeqPtr

typedef xmlParserNodeInfoSeq *xmlParserNodeInfoSeqPtr;


xmlParserCtxt

typedef _xmlParserCtxt xmlParserCtxt;


xmlParserCtxtPtr

typedef xmlParserCtxt *xmlParserCtxtPtr;


xmlSAXLocator

typedef _xmlSAXLocator xmlSAXLocator;


xmlSAXLocatorPtr

typedef xmlSAXLocator *xmlSAXLocatorPtr;


resolveEntitySAXFunc()

xmlParserInputPtr (*resolveEntitySAXFunc)   (xmlParserCtxtPtr ctxt,
                                             const CHAR *publicId,
                                             const CHAR *systemId);

ctxt : 
publicId : 
systemId : 
Returns : 


notationDeclSAXFunc()

void        (*notationDeclSAXFunc)          (xmlParserCtxtPtr ctxt,
                                             const CHAR *name,
                                             const CHAR *publicId,
                                             const CHAR *systemId);

ctxt : 
name : 
publicId : 
systemId : 


unparsedEntityDeclSAXFunc()

void        (*unparsedEntityDeclSAXFunc)    (xmlParserCtxtPtr ctxt,
                                             const CHAR *name,
                                             const CHAR *publicId,
                                             const CHAR *systemId,
                                             const CHAR *notationName);

ctxt : 
name : 
publicId : 
systemId : 
notationName : 


setDocumentLocatorSAXFunc()

void        (*setDocumentLocatorSAXFunc)    (xmlParserCtxtPtr ctxt,
                                             xmlSAXLocatorPtr loc);

ctxt : 
loc : 


startDocumentSAXFunc()

void        (*startDocumentSAXFunc)         (xmlParserCtxtPtr ctxt);

ctxt : 


endDocumentSAXFunc()

void        (*endDocumentSAXFunc)           (xmlParserCtxtPtr ctxt);

ctxt : 


startElementSAXFunc()

void        (*startElementSAXFunc)          (xmlParserCtxtPtr ctxt,
                                             const CHAR *name);

ctxt : 
name : 


endElementSAXFunc()

void        (*endElementSAXFunc)            (xmlParserCtxtPtr ctxt,
                                             const CHAR *name);

ctxt : 
name : 


attributeSAXFunc()

void        (*attributeSAXFunc)             (xmlParserCtxtPtr ctxt,
                                             const CHAR *name,
                                             const CHAR *value);

ctxt : 
name : 
value : 


charactersSAXFunc()

void        (*charactersSAXFunc)            (xmlParserCtxtPtr ctxt,
                                             const CHAR *ch,
                                             int start,
                                             int len);

ctxt : 
ch : 
start : 
len : 


ignorableWhitespaceSAXFunc()

void        (*ignorableWhitespaceSAXFunc)   (xmlParserCtxtPtr ctxt,
                                             const CHAR *ch,
                                             int start,
                                             int len);

ctxt : 
ch : 
start : 
len : 


processingInstructionSAXFunc()

void        (*processingInstructionSAXFunc) (xmlParserCtxtPtr ctxt,
                                             const CHAR *target,
                                             const CHAR *data);

ctxt : 
target : 
data : 


warningSAXFunc()

void        (*warningSAXFunc)               (xmlParserCtxtPtr ctxt,
                                             const char *msg,
                                             ...);

ctxt : 
msg : 
... : 


errorSAXFunc()

void        (*errorSAXFunc)                 (xmlParserCtxtPtr ctxt,
                                             const char *msg,
                                             ...);

ctxt : 
msg : 
... : 


fatalErrorSAXFunc()

void        (*fatalErrorSAXFunc)            (xmlParserCtxtPtr ctxt,
                                             const char *msg,
                                             ...);

ctxt : 
msg : 
... : 


xmlSAXHandlerPtr

typedef xmlSAXHandler *xmlSAXHandlerPtr;


xmlStrdup()

CHAR*       xmlStrdup                       (const CHAR *cur);

a strdup for array of CHAR's

cur : the input CHAR *
Returns :a new CHAR * or NULL


xmlStrndup()

CHAR*       xmlStrndup                      (const CHAR *cur,
                                             int len);

a strndup for array of CHAR's

cur : the input CHAR *
len : the len of cur
Returns :a new CHAR * or NULL


xmlStrchr()

CHAR*       xmlStrchr                       (const CHAR *str,
                                             CHAR val);

a strchr for CHAR's

str : the CHAR * array
val : the CHAR to search
Returns :the CHAR * for the first occurence or NULL.


xmlStrcmp()

int         xmlStrcmp                       (const CHAR *str1,
                                             const CHAR *str2);

a strcmp for CHAR's

str1 : the first CHAR *
str2 : the second CHAR *
Returns :the integer result of the comparison


xmlStrncmp()

int         xmlStrncmp                      (const CHAR *str1,
                                             const CHAR *str2,
                                             int len);

a strncmp for CHAR's

str1 : the first CHAR *
str2 : the second CHAR *
len : the max comparison length
Returns :the integer result of the comparison


xmlStrlen()

int         xmlStrlen                       (const CHAR *str);

lenght of a CHAR's string

str : the CHAR * array
Returns :the number of CHAR contained in the ARRAY.


xmlStrcat()

CHAR*       xmlStrcat                       (CHAR *cur,
                                             const CHAR *add);

a strcat for array of CHAR's

cur : the original CHAR * array
add : the CHAR * array added
Returns :a new CHAR * containing the concatenated string.


xmlStrncat()

CHAR*       xmlStrncat                      (CHAR *cur,
                                             const CHAR *add,
                                             int len);

a strncat for array of CHAR's

cur : the original CHAR * array
add : the CHAR * array added
len : the length of add
Returns :a new CHAR * containing the concatenated string.


xmlParseDoc()

xmlDocPtr   xmlParseDoc                     (CHAR *cur);

parse an XML in-memory document and build a tree.

cur : a pointer to an array of CHAR
Returns :the resulting document tree


xmlParseMemory()

xmlDocPtr   xmlParseMemory                  (char *buffer,
                                             int size);

parse an XML in-memory block and build a tree.

buffer : an pointer to a char array
size : the size of the array
Returns :the resulting document tree


xmlParseFile()

xmlDocPtr   xmlParseFile                    (const char *filename);

parse an XML file and build a tree. Automatic support for ZLIB/Compress compressed document is provided by default if found at compile-time.

filename : the filename
Returns :the resulting document tree


xmlRecoverDoc()

xmlDocPtr   xmlRecoverDoc                   (CHAR *cur);

parse an XML in-memory document and build a tree. In the case the document is not Well Formed, a tree is built anyway

cur : a pointer to an array of CHAR
Returns :the resulting document tree


xmlRecoverMemory()

xmlDocPtr   xmlRecoverMemory                (char *buffer,
                                             int size);

parse an XML in-memory block and build a tree. In the case the document is not Well Formed, a tree is built anyway

buffer : an pointer to a char array
size : the size of the array
Returns :the resulting document tree


xmlRecoverFile()

xmlDocPtr   xmlRecoverFile                  (const char *filename);

parse an XML file and build a tree. Automatic support for ZLIB/Compress compressed document is provided by default if found at compile-time. In the case the document is not Well Formed, a tree is built anyway

filename : the filename
Returns :the resulting document tree


xmlParseDocument()

int         xmlParseDocument                (xmlParserCtxtPtr ctxt);

parse an XML document (and build a tree if using the standard SAX interface).

[1] document ::= prolog element Misc*

[22] prolog ::= XMLDecl? Misc* (doctypedecl Misc*)?

ctxt : an XML parser context
Returns :0, -1 in case of error. the parser context is augmented as a result of the parsing.


xmlSAXParseDoc()

xmlDocPtr   xmlSAXParseDoc                  (xmlSAXHandlerPtr sax,
                                             CHAR *cur,
                                             int recovery);

parse an XML in-memory document and build a tree. It use the given SAX function block to handle the parsing callback. If sax is NULL, fallback to the default DOM tree building routines.

sax : the SAX handler block
cur : a pointer to an array of CHAR
recovery : work in recovery mode, i.e. tries to read no Well Formed documents
Returns :the resulting document tree


xmlSAXParseMemory()

xmlDocPtr   xmlSAXParseMemory               (xmlSAXHandlerPtr sax,
                                             char *buffer,
                                             int size,
                                             int recovery);

parse an XML in-memory block and use the given SAX function block to handle the parsing callback. If sax is NULL, fallback to the default DOM tree building routines.

TODO : plug some encoding conversion routines here. !!!

sax : the SAX handler block
buffer : an pointer to a char array
size : the siwe of the array
recovery : work in recovery mode, i.e. tries to read no Well Formed documents
Returns :the resulting document tree


xmlSAXParseFile()

xmlDocPtr   xmlSAXParseFile                 (xmlSAXHandlerPtr sax,
                                             const char *filename,
                                             int recovery);

parse an XML file and build a tree. Automatic support for ZLIB/Compress compressed document is provided by default if found at compile-time. It use the given SAX function block to handle the parsing callback. If sax is NULL, fallback to the default DOM tree building routines.

sax : the SAX handler block
filename : the filename
recovery : work in recovery mode, i.e. tries to read no Well Formed documents
Returns :the resulting document tree


xmlInitParserCtxt()

void        xmlInitParserCtxt               (xmlParserCtxtPtr ctxt);

Initialize a parser context

ctxt : an XML parser context


xmlClearParserCtxt()

void        xmlClearParserCtxt              (xmlParserCtxtPtr ctxt);

Clear (release owned resources) and reinitialize a parser context

ctxt : an XML parser context


xmlSetupParserForBuffer()

void        xmlSetupParserForBuffer         (xmlParserCtxtPtr ctxt,
                                             const CHAR *buffer,
                                             const char *filename);

Setup the parser context to parse a new buffer; Clears any prior contents from the parser context. The buffer parameter must not be NULL, but the filename parameter can be

ctxt : an XML parser context
buffer : a CHAR * buffer
filename : a file name


xmlParserFindNodeInfo()

const xmlParserNodeInfo* xmlParserFindNodeInfo
                                            (const xmlParserCtxt *ctxt,
                                             const xmlNode *node);

Find the parser node info struct for a given node

ctxt : an XML parser context
node : an XML node within the tree
Returns :an xmlParserNodeInfo block pointer or NULL


xmlInitNodeInfoSeq()

void        xmlInitNodeInfoSeq              (xmlParserNodeInfoSeqPtr seq);

-- Initialize (set to initial state) node info sequence

seq : a node info sequence pointer


xmlClearNodeInfoSeq()

void        xmlClearNodeInfoSeq             (xmlParserNodeInfoSeqPtr seq);

-- Clear (release memory and reinitialize) node info sequence

seq : a node info sequence pointer


xmlParserFindNodeInfoIndex()

unsigned long xmlParserFindNodeInfoIndex    (const xmlParserNodeInfoSeq *seq,
                                             const xmlNode *node);

xmlParserFindNodeInfoIndex : Find the index that the info record for the given node is or should be at in a sorted sequence

seq : a node info sequence pointer
node : an XML node pointer
Returns :a long indicating the position of the record


xmlParserAddNodeInfo()

void        xmlParserAddNodeInfo            (xmlParserCtxtPtr ctxt,
                                             const xmlParserNodeInfo *info);

Insert node info record into the sorted sequence

ctxt : an XML parser context
info : a node info sequence pointer


xmlDefaultSAXHandlerInit()

void        xmlDefaultSAXHandlerInit        (void);

Initialize the default SAX handler