Gnome XML Library Reference Manual | |||
---|---|---|---|
<<< Previous Page | Home | Up | Next Page >>> |
struct xmlParserInput { /* Input buffer */ xmlParserInputBufferPtr buf; /* UTF-8 encoded buffer */ const char *filename; /* The file analyzed, if any */ const char *directory; /* the directory/base of teh file */ const xmlChar *base; /* Base of the array to parse */ const xmlChar *cur; /* Current char being parsed */ const xmlChar *end; /* end of the arry to parse */ int length; /* length if known */ int line; /* Current line */ int col; /* Current column */ int consumed; /* How many xmlChars already consumed */ xmlParserInputDeallocate free; /* function to deallocate the base */ const xmlChar *encoding; /* the encoding string for entity */ const xmlChar *version; /* the version string for entity */ int standalone; /* Was that entity marked standalone */ }; |
struct xmlParserNodeInfo { const struct _xmlNode* node; /* Position & line # that text that created the node begins & ends on */ unsigned long begin_pos; unsigned long begin_line; unsigned long end_pos; unsigned long end_line; }; |
struct xmlParserNodeInfoSeq { unsigned long maximum; unsigned long length; xmlParserNodeInfo* buffer; }; |
typedef enum { XML_PARSER_EOF = -1, /* nothing is to be parsed */ XML_PARSER_START = 0, /* nothing has been parsed */ XML_PARSER_MISC, /* Misc* before int subset */ XML_PARSER_PI, /* Whithin a processing instruction */ XML_PARSER_DTD, /* within some DTD content */ XML_PARSER_PROLOG, /* Misc* after internal subset */ XML_PARSER_COMMENT, /* within a comment */ XML_PARSER_START_TAG, /* within a start tag */ XML_PARSER_CONTENT, /* within the content */ XML_PARSER_CDATA_SECTION, /* within a CDATA section */ XML_PARSER_END_TAG, /* within a closing tag */ XML_PARSER_ENTITY_DECL, /* within an entity declaration */ XML_PARSER_ENTITY_VALUE, /* within an entity value in a decl */ XML_PARSER_ATTRIBUTE_VALUE, /* within an attribute value */ XML_PARSER_SYSTEM_LITERAL, /* within a SYSTEM value */ XML_PARSER_EPILOG, /* the Misc* after the last end tag */ XML_PARSER_IGNORE /* within an IGNORED section */ } xmlParserInputState; |
struct xmlParserCtxt { struct _xmlSAXHandler *sax; /* The SAX handler */ void *userData; /* For SAX interface only, used by DOM build */ xmlDocPtr myDoc; /* the document being built */ int wellFormed; /* is the document well formed */ int replaceEntities; /* shall we replace entities ? */ const xmlChar *version; /* the XML version string */ const xmlChar *encoding; /* the declared encoding, if any */ int standalone; /* standalone document */ int html; /* an HTML(1)/Docbook(2) document */ /* Input stream stack */ xmlParserInputPtr input; /* Current input stream */ int inputNr; /* Number of current input streams */ int inputMax; /* Max number of input streams */ xmlParserInputPtr *inputTab; /* stack of inputs */ /* Node analysis stack only used for DOM building */ xmlNodePtr node; /* Current parsed Node */ int nodeNr; /* Depth of the parsing stack */ int nodeMax; /* Max depth of the parsing stack */ xmlNodePtr *nodeTab; /* array of nodes */ int record_info; /* Whether node info should be kept */ xmlParserNodeInfoSeq node_seq; /* info about each node parsed */ int errNo; /* error code */ int hasExternalSubset; /* reference and external subset */ int hasPErefs; /* the internal subset has PE refs */ int external; /* are we parsing an external entity */ int valid; /* is the document valid */ int validate; /* shall we try to validate ? */ xmlValidCtxt vctxt; /* The validity context */ xmlParserInputState instate; /* current type of input */ int token; /* next char look-ahead */ char *directory; /* the data directory */ /* Node name stack */ xmlChar *name; /* Current parsed Node */ int nameNr; /* Depth of the parsing stack */ int nameMax; /* Max depth of the parsing stack */ xmlChar * *nameTab; /* array of nodes */ long nbChars; /* number of xmlChar processed */ long checkIndex; /* used by progressive parsing lookup */ int keepBlanks; /* ugly but ... */ int disableSAX; /* SAX callbacks are disabled */ int inSubset; /* Parsing is in int 1/ext 2 subset */ xmlChar * intSubName; /* name of subset */ xmlChar * extSubURI; /* URI of external subset */ xmlChar * extSubSystem; /* SYSTEM ID of external subset */ /* xml:space values */ int * space; /* Should the parser preserve spaces */ int spaceNr; /* Depth of the parsing stack */ int spaceMax; /* Max depth of the parsing stack */ int * spaceTab; /* array of space infos */ int depth; /* to prevent entity substitution loops */ xmlParserInputPtr entity; /* used to check entities boundaries */ int charset; /* encoding of the in-memory content actually an xmlCharEncoding */ int nodelen; /* Those two fields are there to */ int nodemem; /* Speed up large node parsing */ int pedantic; /* signal pedantic warnings */ void *_private; /* For user data, libxml won't touch it */ int loadsubset; /* should the external subset be loaded */ }; |
struct xmlSAXLocator { const xmlChar *(*getPublicId)(void *ctx); const xmlChar *(*getSystemId)(void *ctx); int (*getLineNumber)(void *ctx); int (*getColumnNumber)(void *ctx); }; |
xmlParserInputPtr (*resolveEntitySAXFunc) (void *ctx, const xmlChar *publicId, const xmlChar *systemId); |
ctx : | |
publicId : | |
systemId : | |
Returns : |
void (*internalSubsetSAXFunc) (void *ctx, const xmlChar *name, const xmlChar *ExternalID, const xmlChar *SystemID); |
ctx : | |
name : | |
ExternalID : | |
SystemID : |
void (*externalSubsetSAXFunc) (void *ctx, const xmlChar *name, const xmlChar *ExternalID, const xmlChar *SystemID); |
ctx : | |
name : | |
ExternalID : | |
SystemID : |
xmlEntityPtr (*getEntitySAXFunc) (void *ctx, const xmlChar *name); |
ctx : | |
name : | |
Returns : |
xmlEntityPtr (*getParameterEntitySAXFunc) (void *ctx, const xmlChar *name); |
ctx : | |
name : | |
Returns : |
void (*entityDeclSAXFunc) (void *ctx, const xmlChar *name, int type, const xmlChar *publicId, const xmlChar *systemId, xmlChar *content); |
ctx : | |
name : | |
type : | |
publicId : | |
systemId : | |
content : |
void (*notationDeclSAXFunc) (void *ctx, const xmlChar *name, const xmlChar *publicId, const xmlChar *systemId); |
ctx : | |
name : | |
publicId : | |
systemId : |
void (*attributeDeclSAXFunc) (void *ctx, const xmlChar *elem, const xmlChar *name, int type, int def, const xmlChar *defaultValue, xmlEnumerationPtr tree); |
ctx : | |
elem : | |
name : | |
type : | |
def : | |
defaultValue : | |
tree : |
void (*elementDeclSAXFunc) (void *ctx, const xmlChar *name, int type, xmlElementContentPtr content); |
ctx : | |
name : | |
type : | |
content : |
void (*unparsedEntityDeclSAXFunc) (void *ctx, const xmlChar *name, const xmlChar *publicId, const xmlChar *systemId, const xmlChar *notationName); |
ctx : | |
name : | |
publicId : | |
systemId : | |
notationName : |
void (*setDocumentLocatorSAXFunc) (void *ctx, xmlSAXLocatorPtr loc); |
ctx : | |
loc : |
void (*startElementSAXFunc) (void *ctx, const xmlChar *name, const xmlChar **atts); |
ctx : | |
name : | |
atts : |
void (*attributeSAXFunc) (void *ctx, const xmlChar *name, const xmlChar *value); |
ctx : | |
name : | |
value : |
void (*charactersSAXFunc) (void *ctx, const xmlChar *ch, int len); |
ctx : | |
ch : | |
len : |
void (*ignorableWhitespaceSAXFunc) (void *ctx, const xmlChar *ch, int len); |
ctx : | |
ch : | |
len : |
void (*processingInstructionSAXFunc) (void *ctx, const xmlChar *target, const xmlChar *data); |
ctx : | |
target : | |
data : |
void (*cdataBlockSAXFunc) (void *ctx, const xmlChar *value, int len); |
ctx : | |
value : | |
len : |
struct xmlSAXHandler { internalSubsetSAXFunc internalSubset; isStandaloneSAXFunc isStandalone; hasInternalSubsetSAXFunc hasInternalSubset; hasExternalSubsetSAXFunc hasExternalSubset; resolveEntitySAXFunc resolveEntity; getEntitySAXFunc getEntity; entityDeclSAXFunc entityDecl; notationDeclSAXFunc notationDecl; attributeDeclSAXFunc attributeDecl; elementDeclSAXFunc elementDecl; unparsedEntityDeclSAXFunc unparsedEntityDecl; setDocumentLocatorSAXFunc setDocumentLocator; startDocumentSAXFunc startDocument; endDocumentSAXFunc endDocument; startElementSAXFunc startElement; endElementSAXFunc endElement; referenceSAXFunc reference; charactersSAXFunc characters; ignorableWhitespaceSAXFunc ignorableWhitespace; processingInstructionSAXFunc processingInstruction; commentSAXFunc comment; warningSAXFunc warning; errorSAXFunc error; fatalErrorSAXFunc fatalError; getParameterEntitySAXFunc getParameterEntity; cdataBlockSAXFunc cdataBlock; externalSubsetSAXFunc externalSubset; }; |
xmlParserInputPtr (*xmlExternalEntityLoader) (const char *URL, const char *ID, xmlParserCtxtPtr context); |
URL : | |
ID : | |
context : | |
Returns : |
#define xmlSubstituteEntitiesDefaultValue xmlSubstituteEntitiesDefaultVal |
void xmlInitParser (void); |
Initialization function for the XML parser. This is not reentrant. Call once before processing in case of use in multithreaded programs.
void xmlCleanupParser (void); |
Cleanup function for the XML parser. It tries to reclaim all parsing related global memory allocated for the parser processing. It doesn't deallocate any document related memory. Calling this function should not prevent reusing the parser.
int xmlParserInputRead (xmlParserInputPtr in, int len); |
This function refresh the input for the parser. It doesn't try to preserve pointers to the input buffer, and discard already read data
in : | an XML parser input |
len : | an indicative size for the lookahead |
Returns : | the number of xmlChars read, or -1 in case of error, 0 indicate the end of this entity |
int xmlParserInputGrow (xmlParserInputPtr in, int len); |
This function increase the input for the parser. It tries to preserve pointers to the input buffer, and keep already read data
in : | an XML parser input |
len : | an indicative size for the lookahead |
Returns : | the number of xmlChars read, or -1 in case of error, 0 indicate the end of this entity |
xmlChar* xmlStrdup (const xmlChar *cur); |
a strdup for array of xmlChar's. Since they are supposed to be encoded in UTF-8 or an encoding with 8bit based chars, we assume a termination mark of '0'.
cur : | the input xmlChar * |
Returns : | a new xmlChar * or NULL |
xmlChar* xmlStrndup (const xmlChar *cur, int len); |
a strndup for array of xmlChar's
cur : | the input xmlChar * |
len : | the len of cur |
Returns : | a new xmlChar * or NULL |
xmlChar* xmlStrsub (const xmlChar *str, int start, int len); |
Extract a substring of a given string
str : | the xmlChar * array (haystack) |
start : | the index of the first char (zero based) |
len : | the length of the substring |
Returns : | the xmlChar * for the first occurence or NULL. |
const xmlChar* xmlStrchr (const xmlChar *str, xmlChar val); |
a strchr for xmlChar's
str : | the xmlChar * array |
val : | the xmlChar to search |
Returns : | the xmlChar * for the first occurence or NULL. |
const xmlChar* xmlStrstr (const xmlChar *str, xmlChar *val); |
a strstr for xmlChar's
str : | the xmlChar * array (haystack) |
val : | the xmlChar to search (needle) |
Returns : | the xmlChar * for the first occurence or NULL. |
const xmlChar* xmlStrcasestr (const xmlChar *str, xmlChar *val); |
a case-ignoring strstr for xmlChar's
str : | the xmlChar * array (haystack) |
val : | the xmlChar to search (needle) |
Returns : | the xmlChar * for the first occurence or NULL. |
int xmlStrcmp (const xmlChar *str1, const xmlChar *str2); |
a strcmp for xmlChar's
str1 : | the first xmlChar * |
str2 : | the second xmlChar * |
Returns : | the integer result of the comparison |
int xmlStrncmp (const xmlChar *str1, const xmlChar *str2, int len); |
a strncmp for xmlChar's
str1 : | the first xmlChar * |
str2 : | the second xmlChar * |
len : | the max comparison length |
Returns : | the integer result of the comparison |
int xmlStrcasecmp (const xmlChar *str1, const xmlChar *str2); |
a strcasecmp for xmlChar's
str1 : | the first xmlChar * |
str2 : | the second xmlChar * |
Returns : | the integer result of the comparison |
int xmlStrncasecmp (const xmlChar *str1, const xmlChar *str2, int len); |
a strncasecmp for xmlChar's
str1 : | the first xmlChar * |
str2 : | the second xmlChar * |
len : | the max comparison length |
Returns : | the integer result of the comparison |
int xmlStrEqual (const xmlChar *str1, const xmlChar *str2); |
Check if both string are equal of have same content Should be a bit more readable and faster than xmlStrEqual()
str1 : | the first xmlChar * |
str2 : | the second xmlChar * |
Returns : | 1 if they are equal, 0 if they are different |
int xmlStrlen (const xmlChar *str); |
length of a xmlChar's string
str : | the xmlChar * array |
Returns : | the number of xmlChar contained in the ARRAY. |
xmlChar* xmlStrcat (xmlChar *cur, const xmlChar *add); |
a strcat for array of xmlChar's. Since they are supposed to be encoded in UTF-8 or an encoding with 8bit based chars, we assume a termination mark of '0'.
cur : | the original xmlChar * array |
add : | the xmlChar * array added |
Returns : | a new xmlChar * containing the concatenated string. |
xmlChar* xmlStrncat (xmlChar *cur, const xmlChar *add, int len); |
a strncat for array of xmlChar's, it will extend cur with the len first bytes of add.
cur : | the original xmlChar * array |
add : | the xmlChar * array added |
len : | the length of add |
Returns : | a new xmlChar *, the original cur is reallocated if needed and should not be freed |
xmlDocPtr xmlParseDoc (xmlChar *cur); |
parse an XML in-memory document and build a tree.
cur : | a pointer to an array of xmlChar |
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. |
int xmlKeepBlanksDefault (int val); |
Set and return the previous value for default blanks text nodes support. The 1.x version of the parser used an heuristic to try to detect ignorable white spaces. As a result the SAX callback was generating ignorableWhitespace() callbacks instead of characters() one, and when using the DOM output text nodes containing those blanks were not generated. The 2.x and later version will switch to the XML standard way and ignorableWhitespace() are only generated when running the parser in validating mode and when the current element doesn't allow CDATA or mixed content. This function is provided as a way to force the standard behaviour on 1.X libs and to switch back to the old mode for compatibility when running 1.X client code on 2.X . Upgrade of 1.X code should be done by using xmlIsBlankNode() commodity function to detect the "empty" nodes generated. This value also affect autogeneration of indentation when saving code if blanks sections are kept, indentation is not generated.
val : | int 0 or 1 |
Returns : | the last value for 0 for no substitution, 1 for substitution. |
void xmlStopParser (xmlParserCtxtPtr ctxt); |
Blocks further parser processing
ctxt : | an XML parser context |
int xmlPedanticParserDefault (int val); |
Set and return the previous value for enabling pedantic warnings.
val : | int 0 or 1 |
Returns : | the last value for 0 for no substitution, 1 for substitution. |
xmlDocPtr xmlRecoverDoc (xmlChar *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 xmlChar |
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. |
int xmlParseExtParsedEnt (xmlParserCtxtPtr ctxt); |
parse a genreral parsed entity An external general parsed entity is well-formed if it matches the production labeled extParsedEnt.
[78] extParsedEnt ::= TextDecl? content
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, xmlChar *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 xmlChar |
recovery : | work in recovery mode, i.e. tries to read no Well Formed documents |
Returns : | the resulting document tree |
int xmlSAXUserParseFile (xmlSAXHandlerPtr sax, void *user_data, const char *filename); |
parse an XML file and call the given SAX handler routines. Automatic support for ZLIB/Compress compressed document is provided
sax : | a SAX handler |
user_data : | The user data returned on SAX callbacks |
filename : | a file name |
Returns : | 0 in case of success or a error number otherwise |
int xmlSAXUserParseMemory (xmlSAXHandlerPtr sax, void *user_data, char *buffer, int size); |
A better SAX parsing routine. parse an XML in-memory buffer and call the given SAX handler routines.
sax : | a SAX handler |
user_data : | The user data returned on SAX callbacks |
buffer : | an in-memory XML document input |
size : | the length of the XML document in bytes |
Returns : | 0 in case of success or a error number otherwise |
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 size of the array |
recovery : | work in recovery mode, i.e. tries to read not 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 |
xmlDocPtr xmlSAXParseEntity (xmlSAXHandlerPtr sax, const char *filename); |
parse an XML external entity out of context 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.
[78] extParsedEnt ::= TextDecl? content
This correspond to a "Well Balanced" chunk
sax : | the SAX handler block |
filename : | the filename |
Returns : | the resulting document tree |
xmlDocPtr xmlParseEntity (const char *filename); |
parse an XML external entity out of context and build a tree.
[78] extParsedEnt ::= TextDecl? content
This correspond to a "Well Balanced" chunk
filename : | the filename |
Returns : | the resulting document tree |
xmlDtdPtr xmlParseDTD (const xmlChar *ExternalID, const xmlChar *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 xmlChar *ExternalID, const xmlChar *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. |
xmlDtdPtr xmlIOParseDTD (xmlSAXHandlerPtr sax, xmlParserInputBufferPtr input, xmlCharEncoding enc); |
Load and parse a DTD
sax : | the SAX handler block or NULL |
input : | an Input Buffer |
enc : | the charset encoding if known |
Returns : | the resulting xmlDtdPtr or NULL in case of error. input will be freed at parsing end. |
int xmlParseBalancedChunkMemory (xmlDocPtr doc, xmlSAXHandlerPtr sax, void *user_data, int depth, const xmlChar *string, xmlNodePtr *list); |
Parse a well-balanced chunk of an XML document called by the parser The allowed sequence for the Well Balanced Chunk is the one defined by the content production in the XML grammar:
[43] content ::= (element | CharData | Reference | CDSect | PI | Comment)*
doc : | the document the chunk pertains to |
sax : | the SAX handler bloc (possibly NULL) |
user_data : | The user data returned on SAX callbacks (possibly NULL) |
depth : | Used for loop detection, use 0 |
string : | the input string in UTF8 or ISO-Latin (zero terminated) |
list : | the return value for the set of parsed nodes |
Returns : | 0 if the chunk is well balanced, -1 in case of args problem and the parser error code otherwise |
int xmlParseExternalEntity (xmlDocPtr doc, xmlSAXHandlerPtr sax, void *user_data, int depth, const xmlChar *URL, const xmlChar *ID, xmlNodePtr *list); |
Parse an external general entity An external general parsed entity is well-formed if it matches the production labeled extParsedEnt.
[78] extParsedEnt ::= TextDecl? content
doc : | the document the chunk pertains to |
sax : | the SAX handler bloc (possibly NULL) |
user_data : | The user data returned on SAX callbacks (possibly NULL) |
depth : | Used for loop detection, use 0 |
URL : | the URL for the entity to load |
ID : | the System ID for the entity to load |
list : | the return value for the set of parsed nodes |
Returns : | 0 if the entity is well formed, -1 in case of args problem and the parser error code otherwise |
int xmlParseCtxtExternalEntity (xmlParserCtxtPtr ctx, const xmlChar *URL, const xmlChar *ID, xmlNodePtr *list); |
Parse an external general entity within an existing parsing context An external general parsed entity is well-formed if it matches the production labeled extParsedEnt.
[78] extParsedEnt ::= TextDecl? content
ctx : | the existing parsing context |
URL : | the URL for the entity to load |
ID : | the System ID for the entity to load |
list : | the return value for the set of parsed nodes |
Returns : | 0 if the entity is well formed, -1 in case of args problem and the parser error code otherwise |
void htmlDefaultSAXHandlerInit (void); |
Initialize the default SAX handler
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 xmlFreeParserCtxt (xmlParserCtxtPtr ctxt); |
Free all the memory used by a parser context. However the parsed document in ctxt->myDoc is not freed.
ctxt : | an XML parser context |
void xmlSetupParserForBuffer (xmlParserCtxtPtr ctxt, const xmlChar *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 xmlChar * buffer |
filename : | a file name |
xmlParserCtxtPtr xmlCreateDocParserCtxt (xmlChar *cur); |
Creates a parser context for an XML in-memory document.
cur : | a pointer to an array of xmlChar |
Returns : | the new parser context or NULL |
int xmlGetFeaturesList (int *len, const char **result); |
len : | |
result : | |
Returns : |
int xmlGetFeature (xmlParserCtxtPtr ctxt, const char *name, void *result); |
ctxt : | |
name : | |
result : | |
Returns : |
int xmlSetFeature (xmlParserCtxtPtr ctxt, const char *name, void *value); |
ctxt : | |
name : | |
value : | |
Returns : |
xmlParserCtxtPtr xmlCreatePushParserCtxt (xmlSAXHandlerPtr sax, void *user_data, const char *chunk, int size, const char *filename); |
Create a parser context for using the XML parser in push mode To allow content encoding detection, size should be >= 4 The value of filename is used for fetching external entities and error/warning reports.
sax : | a SAX handler |
user_data : | The user data returned on SAX callbacks |
chunk : | a pointer to an array of chars |
size : | number of chars in the array |
filename : | an optional file name or URI |
Returns : | the new parser context or NULL |
int xmlParseChunk (xmlParserCtxtPtr ctxt, const char *chunk, int size, int terminate); |
Parse a Chunk of memory
ctxt : | an XML parser context |
chunk : | an char array |
size : | the size in byte of the chunk |
terminate : | last chunk indicator |
Returns : | zero if no error, the xmlParserErrors otherwise. |
xmlParserCtxtPtr xmlCreateIOParserCtxt (xmlSAXHandlerPtr sax, void *user_data, xmlInputReadCallback ioread, xmlInputCloseCallback ioclose, void *ioctx, xmlCharEncoding enc); |
Create a parser context for using the XML parser with an existing I/O stream
sax : | a SAX handler |
user_data : | The user data returned on SAX callbacks |
ioread : | an I/O read function |
ioclose : | an I/O close function |
ioctx : | an I/O handler |
enc : | the charset encoding if known |
Returns : | the new parser context or NULL |
xmlParserInputPtr xmlNewIOInputStream (xmlParserCtxtPtr ctxt, xmlParserInputBufferPtr input, xmlCharEncoding enc); |
Create a new input stream structure encapsulating the input into a stream suitable for the parser.
ctxt : | an XML parser context |
input : | an I/O Input |
enc : | the charset encoding if known |
Returns : | the new input stream or NULL |
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 |
xmlParserInputPtr xmlLoadExternalEntity (const char *URL, const char *ID, xmlParserCtxtPtr context); |
URL : | |
ID : | |
context : | |
Returns : |