Gnome XML Library Reference Manual | |||
---|---|---|---|
<<< Previous Page | Home | Up | Next Page >>> |
#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; extern xmlSAXLocator xmlDefaultSAXLocator; extern xmlSAXHandler xmlDefaultSAXHandler; 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 |
xmlParserInputPtr (*resolveEntitySAXFunc) (void *ctx, const CHAR *publicId, const CHAR *systemId); |
ctx : | |
publicId : | |
systemId : | |
Returns : |
void (*internalSubsetSAXFunc) (void *ctx, const CHAR *name, const CHAR *ExternalID, const CHAR *SystemID); |
ctx : | |
name : | |
ExternalID : | |
SystemID : |
xmlEntityPtr (*getEntitySAXFunc) (void *ctx, const CHAR *name); |
ctx : | |
name : | |
Returns : |
void (*entityDeclSAXFunc) (void *ctx, const CHAR *name, int type, const CHAR *publicId, const CHAR *systemId, CHAR *content); |
ctx : | |
name : | |
type : | |
publicId : | |
systemId : | |
content : |
void (*notationDeclSAXFunc) (void *ctx, const CHAR *name, const CHAR *publicId, const CHAR *systemId); |
ctx : | |
name : | |
publicId : | |
systemId : |
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 : |
void (*elementDeclSAXFunc) (void *ctx, const CHAR *name, int type, xmlElementContentPtr content); |
ctx : | |
name : | |
type : | |
content : |
void (*unparsedEntityDeclSAXFunc) (void *ctx, const CHAR *name, const CHAR *publicId, const CHAR *systemId, const CHAR *notationName); |
ctx : | |
name : | |
publicId : | |
systemId : | |
notationName : |
void (*setDocumentLocatorSAXFunc) (void *ctx, xmlSAXLocatorPtr loc); |
ctx : | |
loc : |
void (*startElementSAXFunc) (void *ctx, const CHAR *name, const CHAR **atts); |
ctx : | |
name : | |
atts : |
void (*attributeSAXFunc) (void *ctx, const CHAR *name, const CHAR *value); |
ctx : | |
name : | |
value : |
void (*ignorableWhitespaceSAXFunc) (void *ctx, const CHAR *ch, int len); |
ctx : | |
ch : | |
len : |
void (*processingInstructionSAXFunc) (void *ctx, const CHAR *target, const CHAR *data); |
ctx : | |
target : | |
data : |
CHAR* xmlStrdup (const CHAR *cur); |
a strdup for array of CHAR's
cur : | the input CHAR * |
Returns : | a new CHAR * or NULL |
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 |
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. |
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 |
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 |
int xmlStrlen (const CHAR *str); |
lenght of a CHAR's string
str : | the CHAR * array |
Returns : | the number of CHAR contained in the ARRAY. |
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. |
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. |
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 |
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 |
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 |
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::
val : | int 0 or 1 |
Returns : | the last value for 0 for no substitution, 1 for substitution. |
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 |
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 |
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 |
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. |
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 |
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 |
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 |
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. |
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. |
void xmlInitParserCtxt (xmlParserCtxtPtr ctxt); |
Initialize a parser context
ctxt : | an XML parser context |
void xmlClearParserCtxt (xmlParserCtxtPtr ctxt); |
Clear (release owned resources) and reinitialize a parser context
ctxt : | an XML parser context |
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 |
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 |
void xmlInitNodeInfoSeq (xmlParserNodeInfoSeqPtr seq); |
-- Initialize (set to initial state) node info sequence
seq : | a node info sequence pointer |
void xmlClearNodeInfoSeq (xmlParserNodeInfoSeqPtr seq); |
-- Clear (release memory and reinitialize) node info sequence
seq : | a node info sequence pointer |
unsigned |
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 |
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 |