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)   (void *ctx,
                                             const CHAR *publicId,
                                             const CHAR *systemId);
void        (*internalSubsetSAXFunc)        (void *ctx,
                                             const CHAR *name,
                                             const CHAR *ExternalID,
                                             const CHAR *SystemID);
xmlEntityPtr (*getEntitySAXFunc)            (void *ctx,
                                             const CHAR *name);
void        (*entityDeclSAXFunc)            (void *ctx,
                                             const CHAR *name,
                                             int type,
                                             const CHAR *publicId,
                                             const CHAR *systemId,
                                             CHAR *content);
void        (*notationDeclSAXFunc)          (void *ctx,
                                             const CHAR *name,
                                             const CHAR *publicId,
                                             const CHAR *systemId);
void        (*attributeDeclSAXFunc)         (void *ctx,
                                             const CHAR *elem,
                                             const CHAR *name,
                                             int type,
                                             int def,
                                             const CHAR *defaultValue,
                                             xmlEnumerationPtr tree);
void        (*elementDeclSAXFunc)           (void *ctx,
                                             const CHAR *name,
                                             int type,
                                             xmlElementContentPtr content);
void        (*unparsedEntityDeclSAXFunc)    (void *ctx,
                                             const CHAR *name,
                                             const CHAR *publicId,
                                             const CHAR *systemId,
                                             const CHAR *notationName);
void        (*setDocumentLocatorSAXFunc)    (void *ctx,
                                             xmlSAXLocatorPtr loc);
void        (*startDocumentSAXFunc)         (void *ctx);
void        (*endDocumentSAXFunc)           (void *ctx);
void        (*startElementSAXFunc)          (void *ctx,
                                             const CHAR *name,
                                             const CHAR **atts);
void        (*endElementSAXFunc)            (void *ctx,
                                             const CHAR *name);
void        (*attributeSAXFunc)             (void *ctx,
                                             const CHAR *name,
                                             const CHAR *value);
void        (*referenceSAXFunc)             (void *ctx,
                                             const CHAR *name);
void        (*charactersSAXFunc)            (void *ctx,
                                             const CHAR *ch,
                                             int len);
void        (*ignorableWhitespaceSAXFunc)   (void *ctx,
                                             const CHAR *ch,
                                             int len);
void        (*processingInstructionSAXFunc) (void *ctx,
                                             const CHAR *target,
                                             const CHAR *data);
void        (*commentSAXFunc)               (void *ctx,
                                             const CHAR *value);
void        (*warningSAXFunc)               (void *ctx,
                                             const char *msg,
                                             ...);
void        (*errorSAXFunc)                 (void *ctx,
                                             const char *msg,
                                             ...);
void        (*fatalErrorSAXFunc)            (void *ctx,
                                             const char *msg,
                                             ...);
int         (*isStandaloneSAXFunc)          (void *ctx);
int         (*hasInternalSubsetSAXFunc)     (void *ctx);
int         (*hasExternalSubsetSAXFunc)     (void *ctx);
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);
int         xmlSubstituteEntitiesDefault    (int val);
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);
xmlDtdPtr   xmlParseDTD                     (const CHAR *ExternalID,
                                             const CHAR *SystemID);
xmlDtdPtr   xmlSAXParseDTD                  (xmlSAXHandlerPtr sax,
                                             const CHAR *ExternalID,
                                             const CHAR *SystemID);
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)   (void *ctx,
                                             const CHAR *publicId,
                                             const CHAR *systemId);

ctx : 
publicId : 
systemId : 
Returns : 


internalSubsetSAXFunc()

void        (*internalSubsetSAXFunc)        (void *ctx,
                                             const CHAR *name,
                                             const CHAR *ExternalID,
                                             const CHAR *SystemID);

ctx : 
name : 
ExternalID : 
SystemID : 


getEntitySAXFunc()

xmlEntityPtr (*getEntitySAXFunc)            (void *ctx,
                                             const CHAR *name);

ctx : 
name : 
Returns : 


entityDeclSAXFunc()

void        (*entityDeclSAXFunc)            (void *ctx,
                                             const CHAR *name,
                                             int type,
                                             const CHAR *publicId,
                                             const CHAR *systemId,
                                             CHAR *content);

ctx : 
name : 
type : 
publicId : 
systemId : 
content : 


notationDeclSAXFunc()

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

ctx : 
name : 
publicId : 
systemId : 


attributeDeclSAXFunc()

void        (*attributeDeclSAXFunc)         (void *ctx,
                                             const CHAR *elem,
                                             const CHAR *name,
                                             int type,
                                             int def,
                                             const CHAR *defaultValue,
                                             xmlEnumerationPtr tree);

ctx : 
elem : 
name : 
type : 
def : 
defaultValue : 
tree : 


elementDeclSAXFunc()

void        (*elementDeclSAXFunc)           (void *ctx,
                                             const CHAR *name,
                                             int type,
                                             xmlElementContentPtr content);

ctx : 
name : 
type : 
content : 


unparsedEntityDeclSAXFunc()

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

ctx : 
name : 
publicId : 
systemId : 
notationName : 


setDocumentLocatorSAXFunc()

void        (*setDocumentLocatorSAXFunc)    (void *ctx,
                                             xmlSAXLocatorPtr loc);

ctx : 
loc : 


startDocumentSAXFunc()

void        (*startDocumentSAXFunc)         (void *ctx);

ctx : 


endDocumentSAXFunc()

void        (*endDocumentSAXFunc)           (void *ctx);

ctx : 


startElementSAXFunc()

void        (*startElementSAXFunc)          (void *ctx,
                                             const CHAR *name,
                                             const CHAR **atts);

ctx : 
name : 
atts : 


endElementSAXFunc()

void        (*endElementSAXFunc)            (void *ctx,
                                             const CHAR *name);

ctx : 
name : 


attributeSAXFunc()

void        (*attributeSAXFunc)             (void *ctx,
                                             const CHAR *name,
                                             const CHAR *value);

ctx : 
name : 
value : 


referenceSAXFunc()

void        (*referenceSAXFunc)             (void *ctx,
                                             const CHAR *name);

ctx : 
name : 


charactersSAXFunc()

void        (*charactersSAXFunc)            (void *ctx,
                                             const CHAR *ch,
                                             int len);

ctx : 
ch : 
len : 


ignorableWhitespaceSAXFunc()

void        (*ignorableWhitespaceSAXFunc)   (void *ctx,
                                             const CHAR *ch,
                                             int len);

ctx : 
ch : 
len : 


processingInstructionSAXFunc()

void        (*processingInstructionSAXFunc) (void *ctx,
                                             const CHAR *target,
                                             const CHAR *data);

ctx : 
target : 
data : 


commentSAXFunc()

void        (*commentSAXFunc)               (void *ctx,
                                             const CHAR *value);

ctx : 
value : 


warningSAXFunc()

void        (*warningSAXFunc)               (void *ctx,
                                             const char *msg,
                                             ...);

ctx : 
msg : 
... : 


errorSAXFunc()

void        (*errorSAXFunc)                 (void *ctx,
                                             const char *msg,
                                             ...);

ctx : 
msg : 
... : 


fatalErrorSAXFunc()

void        (*fatalErrorSAXFunc)            (void *ctx,
                                             const char *msg,
                                             ...);

ctx : 
msg : 
... : 


isStandaloneSAXFunc()

int         (*isStandaloneSAXFunc)          (void *ctx);

ctx : 
Returns : 


hasInternalSubsetSAXFunc()

int         (*hasInternalSubsetSAXFunc)     (void *ctx);

ctx : 
Returns : 


hasExternalSubsetSAXFunc()

int         (*hasExternalSubsetSAXFunc)     (void *ctx);

ctx : 
Returns : 


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


xmlSubstituteEntitiesDefault()

int         xmlSubstituteEntitiesDefault    (int val);

Set and return the previous value for default entity support. Initially the parser always keep entity references instead of substituting entity values in the output. This function has to be used to change the default parser behaviour SAX::subtituteEntities() has to be used for changing that on a file by file basis.

val : int 0 or 1
Returns :the last value for 0 for no substitution, 1 for substitution.


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.

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


xmlParseDTD()

xmlDtdPtr   xmlParseDTD                     (const CHAR *ExternalID,
                                             const CHAR *SystemID);

Load and parse an external subset.

ExternalID : a NAME* containing the External ID of the DTD
SystemID : a NAME* containing the URL to the DTD
Returns :the resulting xmlDtdPtr or NULL in case of error.


xmlSAXParseDTD()

xmlDtdPtr   xmlSAXParseDTD                  (xmlSAXHandlerPtr sax,
                                             const CHAR *ExternalID,
                                             const CHAR *SystemID);

Load and parse an external subset.

sax : the SAX handler block
ExternalID : a NAME* containing the External ID of the DTD
SystemID : a NAME* containing the URL to the DTD
Returns :the resulting xmlDtdPtr or NULL in case of error.


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