Table of Contentsvoid xmlSetupParserForBuffer (xmlParserCtxtPtr ctxt, const xmlChar * buffer, const char * filename)
xmlDocPtr xmlCtxtReadFile (xmlParserCtxtPtr ctxt, const char * filename, const char * encoding, int options)
int xmlStrcmp (const xmlChar * str1, const xmlChar * str2)
xmlDocPtr xmlParseMemory (const char * buffer, int size)
int xmlParseCtxtExternalEntity (xmlParserCtxtPtr ctx, const xmlChar * URL, const xmlChar * ID, xmlNodePtr * lst)
Structure xmlParserNodeInfoSeq struct _xmlParserNodeInfoSeq {
unsigned long maximum
unsigned long length
xmlParserNodeInfo * buffer
}
const xmlChar * xmlStrcasestr (const xmlChar * str, xmlChar * val)
xmlChar * xmlStrcat (xmlChar * cur, const xmlChar * add)
Function type: attributeDeclSAXFunc
void attributeDeclSAXFunc (void * ctx, const xmlChar * elem, const xmlChar * fullname, int type, int def, const xmlChar * defaultValue, xmlEnumerationPtr tree)
An attribute definition has been parsed. ctx: | the user data (XML parser context) | elem: | the name of the element | fullname: | the attribute name | type: | the attribute type | def: | the type of default value | defaultValue: | the attribute default value | tree: | the tree of enumerated value set |
Function type: getEntitySAXFunc
xmlEntityPtr getEntitySAXFunc (void * ctx, const xmlChar * name)
Get an entity by name. ctx: | the user data (XML parser context) | name: | The entity name | Returns: | the xmlEntityPtr if found. |
const xmlChar * xmlStrstr (const xmlChar * str, const xmlChar * val)
Function type: startElementSAXFunc
void startElementSAXFunc (void * ctx, const xmlChar * name, const xmlChar ** atts)
Called when an opening tag has been processed. ctx: | the user data (XML parser context) | name: | The element name, including namespace prefix | atts: | An array of name/value attributes pairs, NULL terminated |
Function type: charactersSAXFunc
void charactersSAXFunc (void * ctx, const xmlChar * ch, int len)
Receiving some chars from the parser. ctx: | the user data (XML parser context) | ch: | a xmlChar string | len: | the number of xmlChar |
void xmlClearNodeInfoSeq (xmlParserNodeInfoSeqPtr seq)
int xmlParseChunk (xmlParserCtxtPtr ctxt, const char * chunk, int size, int terminate)
xmlDocPtr xmlReadMemory (const char * buffer, int size, const char * URL, const char * encoding, int options)
xmlDocPtr xmlParseEntity (const char * filename)
xmlDocPtr xmlRecoverFile (const char * filename)
xmlChar * xmlStrdup (const xmlChar * cur)
Function type: unparsedEntityDeclSAXFunc
void unparsedEntityDeclSAXFunc (void * ctx, const xmlChar * name, const xmlChar * publicId, const xmlChar * systemId, const xmlChar * notationName)
What to do when an unparsed entity declaration is parsed. ctx: | the user data (XML parser context) | name: | The name of the entity | publicId: | The public ID of the entity | systemId: | The system ID of the entity | notationName: | the name of the notation |
Function type: startElementNsSAX2Func
void startElementNsSAX2Func (void * ctx, const xmlChar * localname, const xmlChar * prefix, const xmlChar * URI, int nb_namespaces, const xmlChar ** namespaces, int nb_attributes, int nb_defaulted, const xmlChar ** attributes)
SAX2 callback when an element start has been detected by the parser. It provides the namespace informations for the element, as well as the new namespace declarations on the element. ctx: | the user data (XML parser context) | localname: | the local name of the element | prefix: | the element namespace prefix if available | URI: | the element namespace name if available | nb_namespaces: | number of namespace definitions on that node | namespaces: | pointer to the array of prefix/URI pairs namespace definitions | nb_attributes: | the number of attributes on that node | nb_defaulted: | the number of defaulted attributes. The defaulted ones are at the end of the array | attributes: | pointer to the array of (localname/prefix/URI/value/end) attribute values. |
xmlParserCtxtPtr xmlCreateIOParserCtxt (xmlSAXHandlerPtr sax, void * user_data, xmlInputReadCallback ioread, xmlInputCloseCallback ioclose, void * ioctx, xmlCharEncoding enc)
Function type: referenceSAXFunc
void referenceSAXFunc (void * ctx, const xmlChar * name)
Called when an entity reference is detected. ctx: | the user data (XML parser context) | name: | The entity name |
xmlChar * xmlStrncat (xmlChar * cur, const xmlChar * add, int len)
Function type: hasExternalSubsetSAXFunc
int hasExternalSubsetSAXFunc (void * ctx)
Does this document has an external subset? ctx: | the user data (XML parser context) | Returns: | 1 if true |
Typedef xmlSAXHandlerV1 * xmlSAXHandlerV1Ptr
int xmlStrPrintf (xmlChar * buf, int len, const xmlChar * msg, ... ...)
xmlDocPtr xmlSAXParseDoc (xmlSAXHandlerPtr sax, xmlChar * cur, int recovery)
xmlChar * xmlStrndup (const xmlChar * cur, int len)
xmlChar * xmlCharStrdup (const char * cur)
xmlParserInputPtr xmlNewIOInputStream (xmlParserCtxtPtr ctxt, xmlParserInputBufferPtr input, xmlCharEncoding enc)
Function type: processingInstructionSAXFunc
void processingInstructionSAXFunc (void * ctx, const xmlChar * target, const xmlChar * data)
A processing instruction has been parsed. ctx: | the user data (XML parser context) | target: | the target name | data: | the PI data's |
int xmlParseBalancedChunkMemoryRecover (xmlDocPtr doc, xmlSAXHandlerPtr sax, void * user_data, int depth, const xmlChar * string, xmlNodePtr * lst, int recover)
void xmlInitParser (void)
Function type: errorSAXFunc
void errorSAXFunc (void * ctx, const char * msg, ... ...)
Display and format an error messages, callback. ctx: | an XML parser context | msg: | the message to display/transmit | ...: | extra parameters for the message display |
Enum xmlParserInputState {
XML_PARSER_EOF = -1 : nothing is to be parsed
XML_PARSER_START = 0 : nothing has been parsed
XML_PARSER_MISC = 1 : Misc* before int subset
XML_PARSER_PI = 2 : Within a processing instruction
XML_PARSER_DTD = 3 : within some DTD content
XML_PARSER_PROLOG = 4 : Misc* after internal subset
= 5 : within a comment
XML_PARSER_START_TAG = 6 : within a start tag
XML_PARSER_CONTENT = 7 : within the content
XML_PARSER_CDATA_SECTION = 8 : within a CDATA section
XML_PARSER_END_TAG = 9 : within a closing tag
XML_PARSER_ENTITY_DECL = 10 : within an entity declaration
XML_PARSER_ENTITY_VALUE = 11 : within an entity value in a decl
XML_PARSER_ATTRIBUTE_VALUE = 12 : within an attribute value
XML_PARSER_SYSTEM_LITERAL = 13 : within a SYSTEM value
XML_PARSER_EPILOG = 14 : the Misc* after the last end tag
XML_PARSER_IGNORE = 15 : within an IGNORED section
XML_PARSER_PUBLIC_LITERAL = 16 : within a PUBLIC value
}
xmlDocPtr xmlSAXParseMemory (xmlSAXHandlerPtr sax, const char * buffer, int size, int recovery)
xmlDocPtr xmlRecoverMemory (const char * buffer, int size)
Function type: xmlExternalEntityLoader
xmlParserInputPtr xmlExternalEntityLoader (const char * URL, const char * ID, xmlParserCtxtPtr context)
External entity loaders types. URL: | The System ID of the resource requested | ID: | The Public ID of the resource requested | context: | the XML parser context | Returns: | the entity input parser. |
Function type: hasInternalSubsetSAXFunc
int hasInternalSubsetSAXFunc (void * ctx)
Does this document has an internal subset. ctx: | the user data (XML parser context) | Returns: | 1 if true |
xmlDocPtr xmlReadDoc (const xmlChar * cur, const char * URL, const char * encoding, int options)
Function type: cdataBlockSAXFunc
void cdataBlockSAXFunc (void * ctx, const xmlChar * value, int len)
Called when a pcdata block has been parsed. ctx: | the user data (XML parser context) | value: | The pcdata content | len: | the block length |
#define XML_COMPLETE_ATTRS
xmlDocPtr xmlSAXParseFile (xmlSAXHandlerPtr sax, const char * filename, int recovery)
Function type: xmlParserInputDeallocate
void xmlParserInputDeallocate (xmlChar * str)
Callback for freeing some parser input allocations. str: | the string to deallocate |
Typedef xmlParserNodeInfo * xmlParserNodeInfoPtr
xmlDocPtr xmlCtxtReadIO (xmlParserCtxtPtr ctxt, xmlInputReadCallback ioread, xmlInputCloseCallback ioclose, void * ioctx, const char * URL, const char * encoding, int options)
xmlDocPtr xmlSAXParseMemoryWithData (xmlSAXHandlerPtr sax, const char * buffer, int size, int recovery, void * data)
const xmlParserNodeInfo * xmlParserFindNodeInfo (const xmlParserCtxtPtr ctx, const xmlNodePtr node)
int xmlGetFeature (xmlParserCtxtPtr ctxt, const char * name, void * result)
Structure xmlParserNodeInfo struct _xmlParserNodeInfo {
const struct _xmlNode * node : Position & line # that text that created the node
unsigned long begin_pos
unsigned long begin_line
unsigned long end_pos
unsigned long end_line
}
const xmlChar * xmlStrchr (const xmlChar * str, xmlChar val)
xmlDtdPtr xmlIOParseDTD (xmlSAXHandlerPtr sax, xmlParserInputBufferPtr input, xmlCharEncoding enc)
void xmlFreeParserCtxt (xmlParserCtxtPtr ctxt)
xmlDtdPtr xmlParseDTD (const xmlChar * ExternalID, const xmlChar * SystemID)
Function type: commentSAXFunc
void commentSAXFunc (void * ctx, const xmlChar * value)
A comment has been parsed. ctx: | the user data (XML parser context) | value: | the comment content |
int xmlInitParserCtxt (xmlParserCtxtPtr ctxt)
Function type: attributeSAXFunc
void attributeSAXFunc (void * ctx, const xmlChar * name, const xmlChar * value)
Handle an attribute that has been read by the parser. The default handling is to convert the attribute into an DOM subtree and past it in a new xmlAttr element added to the element. ctx: | the user data (XML parser context) | name: | The attribute name, including namespace prefix | value: | The attribute value |
int xmlStrQEqual (const xmlChar * pref, const xmlChar * name, const xmlChar * str)
int xmlParserInputGrow (xmlParserInputPtr in, int len)
xmlDocPtr xmlCtxtReadMemory (xmlParserCtxtPtr ctxt, const char * buffer, int size, const char * URL, const char * encoding, int options)
Function type: externalSubsetSAXFunc
void externalSubsetSAXFunc (void * ctx, const xmlChar * name, const xmlChar * ExternalID, const xmlChar * SystemID)
Callback on external subset declaration. ctx: | the user data (XML parser context) | name: | the root element name | ExternalID: | the external ID | SystemID: | the SYSTEM ID (e.g. filename or URL) |
Function type: resolveEntitySAXFunc
xmlParserInputPtr resolveEntitySAXFunc (void * ctx, const xmlChar * publicId, const xmlChar * systemId)
Callback: The entity loader, to control the loading of external entities, the application can either: - override this resolveEntity() callback in the SAX block - or better use the xmlSetExternalEntityLoader() function to set up it's own entity resolution routine ctx: | the user data (XML parser context) | publicId: | The public ID of the entity | systemId: | The system ID of the entity | Returns: | the xmlParserInputPtr if inlined or NULL for DOM behaviour. |
Enum xmlParserOption {
XML_PARSE_RECOVER = 1 : recover on errors
XML_PARSE_NOENT = 2 : substitute entities
XML_PARSE_DTDLOAD = 4 : load the external subset
XML_PARSE_DTDATTR = 8 : default DTD attributes
XML_PARSE_DTDVALID = 16 : validate with the DTD
XML_PARSE_NOERROR = 32 : suppress error reports
XML_PARSE_NOWARNING = 64 : suppress warning reports
XML_PARSE_PEDANTIC = 128 : pedantic error reporting
XML_PARSE_NOBLANKS = 256 : remove blank nodes
XML_PARSE_SAX1 = 512 : use the SAX1 interface internally
XML_PARSE_XINCLUDE = 1024 : Implement XInclude substitition
XML_PARSE_NONET = 2048 : Forbid network access
XML_PARSE_NODICT = 4096 : Do not reuse the context dictionnary
XML_PARSE_NSCLEAN = 8192 : remove redundant namespaces declarations
XML_PARSE_NOCDATA = 16384 : merge CDATA as text nodes
}
int xmlPedanticParserDefault (int val)
xmlDocPtr xmlSAXParseEntity (xmlSAXHandlerPtr sax, const char * filename)
xmlDocPtr xmlParseDoc (xmlChar * cur)
void xmlParserAddNodeInfo (xmlParserCtxtPtr ctxt, const xmlParserNodeInfoPtr info)
#define XML_SAX2_MAGIC
xmlDocPtr xmlSAXParseFileWithData (xmlSAXHandlerPtr sax, const char * filename, int recovery, void * data)
int xmlLineNumbersDefault (int val)
xmlExternalEntityLoader xmlGetExternalEntityLoader (void)
Function type: elementDeclSAXFunc
void elementDeclSAXFunc (void * ctx, const xmlChar * name, int type, xmlElementContentPtr content)
An element definition has been parsed. ctx: | the user data (XML parser context) | name: | the element name | type: | the element type | content: | the element value tree |
int xmlCtxtUseOptions (xmlParserCtxtPtr ctxt, int options)
xmlParserCtxtPtr xmlCreatePushParserCtxt (xmlSAXHandlerPtr sax, void * user_data, const char * chunk, int size, const char * filename)
xmlChar * xmlCharStrndup (const char * cur, int len)
xmlDocPtr xmlCtxtReadFd (xmlParserCtxtPtr ctxt, int fd, const char * URL, const char * encoding, int options)
Function type: internalSubsetSAXFunc
void internalSubsetSAXFunc (void * ctx, const xmlChar * name, const xmlChar * ExternalID, const xmlChar * SystemID)
Callback on internal subset declaration. ctx: | the user data (XML parser context) | name: | the root element name | ExternalID: | the external ID | SystemID: | the SYSTEM ID (e.g. filename or URL) |
xmlParserCtxtPtr xmlNewParserCtxt (void)
Function type: endDocumentSAXFunc
void endDocumentSAXFunc (void * ctx)
Called when the document end has been detected. ctx: | the user data (XML parser context) |
xmlDocPtr xmlParseFile (const char * filename)
Typedef xmlParserNodeInfoSeq * xmlParserNodeInfoSeqPtr
int xmlParseDocument (xmlParserCtxtPtr ctxt)
int xmlStrncmp (const xmlChar * str1, const xmlChar * str2, int len)
Function type: setDocumentLocatorSAXFunc
void setDocumentLocatorSAXFunc (void * ctx, xmlSAXLocatorPtr loc)
Receive the document locator at startup, actually xmlDefaultSAXLocator. Everything is available on the context, so this is useless in our case. ctx: | the user data (XML parser context) | loc: | A SAX Locator |
Function type: endElementSAXFunc
void endElementSAXFunc (void * ctx, const xmlChar * name)
Called when the end of an element has been detected. ctx: | the user data (XML parser context) | name: | The element name |
#define XML_DETECT_IDS
Function type: getParameterEntitySAXFunc
xmlEntityPtr getParameterEntitySAXFunc (void * ctx, const xmlChar * name)
Get a parameter entity by name. ctx: | the user data (XML parser context) | name: | The entity name | Returns: | the xmlEntityPtr if found. |
Function type: endElementNsSAX2Func
void endElementNsSAX2Func (void * ctx, const xmlChar * localname, const xmlChar * prefix, const xmlChar * URI)
SAX2 callback when an element end has been detected by the parser. It provides the namespace informations for the element. ctx: | the user data (XML parser context) | localname: | the local name of the element | prefix: | the element namespace prefix if available | URI: | the element namespace name if available |
Function type: ignorableWhitespaceSAXFunc
void ignorableWhitespaceSAXFunc (void * ctx, const xmlChar * ch, int len)
Receiving some ignorable whitespaces from the parser. UNUSED: by default the DOM building will use characters. ctx: | the user data (XML parser context) | ch: | a xmlChar string | len: | the number of xmlChar |
void xmlInitNodeInfoSeq (xmlParserNodeInfoSeqPtr seq)
int xmlStrlen (const xmlChar * str)
int xmlSubstituteEntitiesDefault (int val)
int xmlStrncasecmp (const xmlChar * str1, const xmlChar * str2, int len)
unsigned long xmlParserFindNodeInfoIndex (const xmlParserNodeInfoSeqPtr seq, const xmlNodePtr node)
int xmlSAXUserParseMemory (xmlSAXHandlerPtr sax, void * user_data, const char * buffer, int size)
void xmlCtxtReset (xmlParserCtxtPtr ctxt)
int xmlSetFeature (xmlParserCtxtPtr ctxt, const char * name, void * value)
int xmlStrEqual (const xmlChar * str1, const xmlChar * str2)
int xmlKeepBlanksDefault (int val)
int xmlParserInputRead (xmlParserInputPtr in, int len)
xmlDocPtr xmlReadFile (const char * filename, const char * encoding, int options)
int xmlGetFeaturesList (int * len, const char ** result)
xmlDocPtr xmlCtxtReadDoc (xmlParserCtxtPtr ctxt, const xmlChar * cur, const char * URL, const char * encoding, int options)
Structure xmlSAXHandlerV1 struct _xmlSAXHandlerV1 {
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 : unused error() get all the errors
getParameterEntitySAXFunc getParameterEntity
cdataBlockSAXFunc cdataBlock
externalSubsetSAXFunc externalSubset
unsigned int initialized
}
int xmlSAXUserParseFile (xmlSAXHandlerPtr sax, void * user_data, const char * filename)
Function type: fatalErrorSAXFunc
void fatalErrorSAXFunc (void * ctx, const char * msg, ... ...)
Display and format fatal error messages, callback. Note: so far fatalError() SAX callbacks are not used, error() get all the callbacks for errors. ctx: | an XML parser context | msg: | the message to display/transmit | ...: | extra parameters for the message display |
xmlDtdPtr xmlSAXParseDTD (xmlSAXHandlerPtr sax, const xmlChar * ExternalID, const xmlChar * SystemID)
Function type: entityDeclSAXFunc
void entityDeclSAXFunc (void * ctx, const xmlChar * name, int type, const xmlChar * publicId, const xmlChar * systemId, xmlChar * content)
An entity definition has been parsed. ctx: | the user data (XML parser context) | name: | the entity name | type: | the entity type | publicId: | The public ID of the entity | systemId: | The system ID of the entity | content: | the entity value (without processing). |
xmlParserInputPtr xmlLoadExternalEntity (const char * URL, const char * ID, xmlParserCtxtPtr ctxt)
#define XML_DEFAULT_VERSION
void xmlStopParser (xmlParserCtxtPtr ctxt)
xmlDocPtr xmlReadFd (int fd, const char * URL, const char * encoding, int options)
int xmlParseExtParsedEnt (xmlParserCtxtPtr ctxt)
xmlDocPtr xmlReadIO (xmlInputReadCallback ioread, xmlInputCloseCallback ioclose, void * ioctx, const char * URL, const char * encoding, int options)
int xmlStrVPrintf (xmlChar * buf, int len, const xmlChar * msg, va_list ap)
xmlParserCtxtPtr xmlCreateDocParserCtxt (const xmlChar * cur)
xmlChar * xmlStrsub (const xmlChar * str, int start, int len)
int xmlParseBalancedChunkMemory (xmlDocPtr doc, xmlSAXHandlerPtr sax, void * user_data, int depth, const xmlChar * string, xmlNodePtr * lst)
xmlDocPtr xmlRecoverDoc (xmlChar * cur)
void xmlCleanupParser (void)
int xmlStrcasecmp (const xmlChar * str1, const xmlChar * str2)
int xmlCtxtResetPush (xmlParserCtxtPtr ctxt, const char * chunk, int size, const char * filename, const char * encoding)
Function type: isStandaloneSAXFunc
int isStandaloneSAXFunc (void * ctx)
Is this document tagged standalone? ctx: | the user data (XML parser context) | Returns: | 1 if true |
Function type: startDocumentSAXFunc
void startDocumentSAXFunc (void * ctx)
Called when the document start being processed. ctx: | the user data (XML parser context) |
#define XML_SKIP_IDS
void xmlClearParserCtxt (xmlParserCtxtPtr ctxt)
int xmlParseExternalEntity (xmlDocPtr doc, xmlSAXHandlerPtr sax, void * user_data, int depth, const xmlChar * URL, const xmlChar * ID, xmlNodePtr * lst)
Function type: notationDeclSAXFunc
void notationDeclSAXFunc (void * ctx, const xmlChar * name, const xmlChar * publicId, const xmlChar * systemId)
What to do when a notation declaration has been parsed. ctx: | the user data (XML parser context) | name: | The name of the notation | publicId: | The public ID of the entity | systemId: | The system ID of the entity |
Function type: warningSAXFunc
void warningSAXFunc (void * ctx, const char * msg, ... ...)
Display and format a warning messages, callback. ctx: | an XML parser context | msg: | the message to display/transmit | ...: | extra parameters for the message display |
void xmlSetExternalEntityLoader (xmlExternalEntityLoader f)
Description
Function: xmlSetupParserForBuffervoid 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 |
Function: xmlCtxtReadFilexmlDocPtr xmlCtxtReadFile (xmlParserCtxtPtr ctxt, const char * filename, const char * encoding, int options)
parse an XML file from the filesystem or the network. This reuses the existing @ctxt parser context
ctxt: | an XML parser context | filename: | a file or URL | encoding: | the document encoding, or NULL | options: | a combination of xmlParserOption(s) | Returns: | the resulting document tree |
Function: xmlStrcmpint 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 |
Function: xmlParseMemoryxmlDocPtr xmlParseMemory (const 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 |
Function: xmlParseCtxtExternalEntityint xmlParseCtxtExternalEntity (xmlParserCtxtPtr ctx, const xmlChar * URL, const xmlChar * ID, xmlNodePtr * lst)
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 | lst: | 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 |
Function: xmlStrcasestrconst 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 occurrence or NULL. |
Function: xmlStrcatxmlChar * 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. |
An attribute definition has been parsed.
Get an entity by name.
Function: xmlStrstrconst xmlChar * xmlStrstr (const xmlChar * str, const xmlChar * val)
a strstr for xmlChar's
str: | the xmlChar * array (haystack) | val: | the xmlChar to search (needle) | Returns: | the xmlChar * for the first occurrence or NULL. |
Called when an opening tag has been processed.
Receiving some chars from the parser.
Function: xmlClearNodeInfoSeqvoid xmlClearNodeInfoSeq (xmlParserNodeInfoSeqPtr seq)
-- Clear (release memory and reinitialize) node info sequence
seq: | a node info sequence pointer |
Function: xmlParseChunkint 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. |
Function: xmlReadMemoryxmlDocPtr xmlReadMemory (const char * buffer, int size, const char * URL, const char * encoding, int options)
parse an XML in-memory document and build a tree.
buffer: | a pointer to a char array | size: | the size of the array | URL: | the base URL to use for the document | encoding: | the document encoding, or NULL | options: | a combination of xmlParserOption(s) | Returns: | the resulting document tree |
Function: xmlParseEntityxmlDocPtr 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 |
Function: xmlRecoverFilexmlDocPtr 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 |
Function: xmlStrdupxmlChar * 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'.
What to do when an unparsed entity declaration is parsed.
SAX2 callback when an element start has been detected by the parser. It provides the namespace informations for the element, as well as the new namespace declarations on the element.
Function: xmlCreateIOParserCtxtxmlParserCtxtPtr 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 |
Called when an entity reference is detected.
Function: xmlStrncatxmlChar * 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 |
Does this document has an external subset?
Function: xmlStrPrintfint xmlStrPrintf (xmlChar * buf, int len, const xmlChar * msg, ... ...)
Formats @msg and places result into @buf.
buf: | the result buffer. | len: | the result buffer length. | msg: | the message with printf formatting. | ...: | extra parameters for the message. | Returns: | the number of characters written to @buf or -1 if an error occurs. |
Function: xmlSAXParseDocxmlDocPtr 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 |
Function: xmlStrndupxmlChar * 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 |
Function: xmlCharStrdupxmlChar * xmlCharStrdup (const char * cur)
a strdup for char's to xmlChar's
cur: | the input char * | Returns: | a new xmlChar * or NULL |
Function: xmlNewIOInputStreamxmlParserInputPtr 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 |
A processing instruction has been parsed.
Function: xmlParseBalancedChunkMemoryRecoverint xmlParseBalancedChunkMemoryRecover (xmlDocPtr doc, xmlSAXHandlerPtr sax, void * user_data, int depth, const xmlChar * string, xmlNodePtr * lst, int recover)
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) | lst: | the return value for the set of parsed nodes | recover: | return nodes even if the data is broken (use 0) | Returns: | 0 if the chunk is well balanced, -1 in case of args problem and the parser error code otherwise In case recover is set to 1, the nodelist will not be empty even if the parsed chunk is not well balanced. |
Function: xmlInitParservoid xmlInitParser (void)
Initialization function for the XML parser. This is not reentrant. Call once before processing in case of use in multithreaded programs.
Display and format an error messages, callback.
Function: xmlSAXParseMemoryxmlDocPtr xmlSAXParseMemory (xmlSAXHandlerPtr sax, const 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 |
Function: xmlRecoverMemoryxmlDocPtr xmlRecoverMemory (const 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 |
External entity loaders types.
Does this document has an internal subset.
Function: xmlReadDocxmlDocPtr xmlReadDoc (const xmlChar * cur, const char * URL, const char * encoding, int options)
parse an XML in-memory document and build a tree.
cur: | a pointer to a zero terminated string | URL: | the base URL to use for the document | encoding: | the document encoding, or NULL | options: | a combination of xmlParserOption(s) | Returns: | the resulting document tree |
Called when a pcdata block has been parsed.
Macro: XML_COMPLETE_ATTRS#define XML_COMPLETE_ATTRS Bit in the loadsubset context field to tell to do complete the elements attributes lists with the ones defaulted from the DTDs. Use it to initialize xmlLoadExtDtdDefaultValue.
Function: xmlSAXParseFilexmlDocPtr 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 |
Callback for freeing some parser input allocations.
Function: xmlCtxtReadIOxmlDocPtr xmlCtxtReadIO (xmlParserCtxtPtr ctxt, xmlInputReadCallback ioread, xmlInputCloseCallback ioclose, void * ioctx, const char * URL, const char * encoding, int options)
parse an XML document from I/O functions and source and build a tree. This reuses the existing @ctxt parser context
ctxt: | an XML parser context | ioread: | an I/O read function | ioclose: | an I/O close function | ioctx: | an I/O handler | URL: | the base URL to use for the document | encoding: | the document encoding, or NULL | options: | a combination of xmlParserOption(s) | Returns: | the resulting document tree |
Function: xmlSAXParseMemoryWithDataxmlDocPtr xmlSAXParseMemoryWithData (xmlSAXHandlerPtr sax, const char * buffer, int size, int recovery, void * data)
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. User data (void *) is stored within the parser context in the context's _private member, so it is available nearly everywhere in libxml
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 no Well Formed documents | data: | the userdata | Returns: | the resulting document tree |
Function: xmlParserFindNodeInfoconst xmlParserNodeInfo * xmlParserFindNodeInfo (const xmlParserCtxtPtr ctx, const xmlNodePtr node)
Find the parser node info struct for a given node
ctx: | an XML parser context | node: | an XML node within the tree | Returns: | an xmlParserNodeInfo block pointer or NULL |
Function: xmlGetFeatureint xmlGetFeature (xmlParserCtxtPtr ctxt, const char * name, void * result)
Read the current value of one feature of this parser instance
ctxt: | an XML/HTML parser context | name: | the feature name | result: | location to store the result | Returns: | -1 in case or error, 0 otherwise |
Function: xmlStrchrconst xmlChar * xmlStrchr (const xmlChar * str, xmlChar val)
a strchr for xmlChar's
Function: xmlIOParseDTDxmlDtdPtr 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. |
Function: xmlFreeParserCtxtvoid 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 |
Function: xmlParseDTDxmlDtdPtr 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. |
A comment has been parsed.
Function: xmlInitParserCtxtint xmlInitParserCtxt (xmlParserCtxtPtr ctxt)
Initialize a parser context
ctxt: | an XML parser context | Returns: | 0 in case of success and -1 in case of error |
Handle an attribute that has been read by the parser. The default handling is to convert the attribute into an DOM subtree and past it in a new xmlAttr element added to the element.
Function: xmlStrQEqualint xmlStrQEqual (const xmlChar * pref, const xmlChar * name, const xmlChar * str)
Check if a QName is Equal to a given string
pref: | the prefix of the QName | name: | the localname of the QName | str: | the second xmlChar * | Returns: | 1 if they are equal, 0 if they are different |
Function: xmlParserInputGrowint 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 |
Function: xmlCtxtReadMemoryxmlDocPtr xmlCtxtReadMemory (xmlParserCtxtPtr ctxt, const char * buffer, int size, const char * URL, const char * encoding, int options)
parse an XML in-memory document and build a tree. This reuses the existing @ctxt parser context
ctxt: | an XML parser context | buffer: | a pointer to a char array | size: | the size of the array | URL: | the base URL to use for the document | encoding: | the document encoding, or NULL | options: | a combination of xmlParserOption(s) | Returns: | the resulting document tree |
Callback on external subset declaration.
Callback: The entity loader, to control the loading of external entities, the application can either: - override this resolveEntity() callback in the SAX block - or better use the xmlSetExternalEntityLoader() function to set up it's own entity resolution routine
Function: xmlPedanticParserDefaultint 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. |
Function: xmlSAXParseEntityxmlDocPtr 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 |
Function: xmlParseDocxmlDocPtr 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 |
Function: xmlParserAddNodeInfovoid xmlParserAddNodeInfo (xmlParserCtxtPtr ctxt, const xmlParserNodeInfoPtr info)
Insert node info record into the sorted sequence
ctxt: | an XML parser context | info: | a node info sequence pointer |
Macro: XML_SAX2_MAGIC#define XML_SAX2_MAGIC Special constant found in SAX2 blocks initialized fields
Function: xmlSAXParseFileWithDataxmlDocPtr xmlSAXParseFileWithData (xmlSAXHandlerPtr sax, const char * filename, int recovery, void * data)
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. User data (void *) is stored within the parser context in the context's _private member, so it is available nearly everywhere in libxml
sax: | the SAX handler block | filename: | the filename | recovery: | work in recovery mode, i.e. tries to read no Well Formed documents | data: | the userdata | Returns: | the resulting document tree |
Function: xmlLineNumbersDefaultint xmlLineNumbersDefault (int val)
Set and return the previous value for enabling line numbers in elements contents. This may break on old application and is turned off by default.
val: | int 0 or 1 | Returns: | the last value for 0 for no substitution, 1 for substitution. |
Function: xmlGetExternalEntityLoaderxmlExternalEntityLoader xmlGetExternalEntityLoader (void)
Get the default external entity resolver function for the application
An element definition has been parsed.
Function: xmlCtxtUseOptionsint xmlCtxtUseOptions (xmlParserCtxtPtr ctxt, int options)
Applies the options to the parser context
ctxt: | an XML parser context | options: | a combination of xmlParserOption(s) | Returns: | 0 in case of success, the set of unknown or unimplemented options in case of error. |
Function: xmlCreatePushParserCtxtxmlParserCtxtPtr 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. If @buffer and @size are non-NULL, the data is used to detect the encoding. The remaining characters will be parsed so they don't need to be fed in again through xmlParseChunk. 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 |
Function: xmlCharStrndupxmlChar * xmlCharStrndup (const char * cur, int len)
a strndup for char's to xmlChar's
cur: | the input char * | len: | the len of @cur | Returns: | a new xmlChar * or NULL |
Function: xmlCtxtReadFdxmlDocPtr xmlCtxtReadFd (xmlParserCtxtPtr ctxt, int fd, const char * URL, const char * encoding, int options)
parse an XML from a file descriptor and build a tree. This reuses the existing @ctxt parser context
ctxt: | an XML parser context | fd: | an open file descriptor | URL: | the base URL to use for the document | encoding: | the document encoding, or NULL | options: | a combination of xmlParserOption(s) | Returns: | the resulting document tree |
Callback on internal subset declaration.
Function: xmlNewParserCtxtxmlParserCtxtPtr xmlNewParserCtxt (void)
Allocate and initialize a new parser context.
Called when the document end has been detected.
Function: xmlParseFilexmlDocPtr 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 if the file was wellformed, NULL otherwise. |
Function: xmlParseDocumentint 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. |
Function: xmlStrncmpint 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 |
Receive the document locator at startup, actually xmlDefaultSAXLocator. Everything is available on the context, so this is useless in our case.
Called when the end of an element has been detected.
Macro: XML_DETECT_IDS#define XML_DETECT_IDS Bit in the loadsubset context field to tell to do ID/REFs lookups. Use it to initialize xmlLoadExtDtdDefaultValue.
Get a parameter entity by name.
SAX2 callback when an element end has been detected by the parser. It provides the namespace informations for the element.
Receiving some ignorable whitespaces from the parser. UNUSED: by default the DOM building will use characters.
Function: xmlInitNodeInfoSeqvoid xmlInitNodeInfoSeq (xmlParserNodeInfoSeqPtr seq)
-- Initialize (set to initial state) node info sequence
seq: | a node info sequence pointer |
Function: xmlStrlenint xmlStrlen (const xmlChar * str)
length of a xmlChar's string
str: | the xmlChar * array | Returns: | the number of xmlChar contained in the ARRAY. |
Function: xmlSubstituteEntitiesDefaultint 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 behavior SAX::substituteEntities() 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. |
Function: xmlStrncasecmpint 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 |
Function: xmlParserFindNodeInfoIndexunsigned long xmlParserFindNodeInfoIndex (const xmlParserNodeInfoSeqPtr seq, const xmlNodePtr 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 |
Function: xmlSAXUserParseMemoryint xmlSAXUserParseMemory (xmlSAXHandlerPtr sax, void * user_data, const 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 |
Function: xmlCtxtResetvoid xmlCtxtReset (xmlParserCtxtPtr ctxt)
Reset a parser context
ctxt: | an XML parser context |
Function: xmlSetFeatureint xmlSetFeature (xmlParserCtxtPtr ctxt, const char * name, void * value)
Change the current value of one feature of this parser instance
ctxt: | an XML/HTML parser context | name: | the feature name | value: | pointer to the location of the new value | Returns: | -1 in case or error, 0 otherwise |
Function: xmlStrEqualint 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 |
Function: xmlKeepBlanksDefaultint 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 xmlSAX2IgnorableWhitespace() 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 behavior 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. |
Function: xmlParserInputReadint 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 |
Function: xmlReadFilexmlDocPtr xmlReadFile (const char * filename, const char * encoding, int options)
parse an XML file from the filesystem or the network.
filename: | a file or URL | encoding: | the document encoding, or NULL | options: | a combination of xmlParserOption(s) | Returns: | the resulting document tree |
Function: xmlGetFeaturesListint xmlGetFeaturesList (int * len, const char ** result)
Copy at most *@len feature names into the @result array
len: | the length of the features name array (input/output) | result: | an array of string to be filled with the features name. | Returns: | -1 in case or error, or the total number of features, len is updated with the number of strings copied, strings must not be deallocated |
Function: xmlCtxtReadDocxmlDocPtr xmlCtxtReadDoc (xmlParserCtxtPtr ctxt, const xmlChar * cur, const char * URL, const char * encoding, int options)
parse an XML in-memory document and build a tree. This reuses the existing @ctxt parser context
ctxt: | an XML parser context | cur: | a pointer to a zero terminated string | URL: | the base URL to use for the document | encoding: | the document encoding, or NULL | options: | a combination of xmlParserOption(s) | Returns: | the resulting document tree |
Function: xmlSAXUserParseFileint 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 |
Display and format fatal error messages, callback. Note: so far fatalError() SAX callbacks are not used, error() get all the callbacks for errors.
Function: xmlSAXParseDTDxmlDtdPtr 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. |
An entity definition has been parsed.
Function: xmlLoadExternalEntityxmlParserInputPtr xmlLoadExternalEntity (const char * URL, const char * ID, xmlParserCtxtPtr ctxt)
Load an external entity, note that the use of this function for unparsed entities may generate problems TODO: a more generic External entity API must be designed
URL: | the URL for the entity to load | ID: | the Public ID for the entity to load | ctxt: | the context in which the entity is called or NULL | Returns: | the xmlParserInputPtr or NULL |
Macro: XML_DEFAULT_VERSION#define XML_DEFAULT_VERSION The default version of XML used: 1.0
Function: xmlStopParservoid xmlStopParser (xmlParserCtxtPtr ctxt)
Blocks further parser processing
ctxt: | an XML parser context |
Function: xmlReadFdxmlDocPtr xmlReadFd (int fd, const char * URL, const char * encoding, int options)
parse an XML from a file descriptor and build a tree.
fd: | an open file descriptor | URL: | the base URL to use for the document | encoding: | the document encoding, or NULL | options: | a combination of xmlParserOption(s) | Returns: | the resulting document tree |
Function: xmlParseExtParsedEntint xmlParseExtParsedEnt (xmlParserCtxtPtr ctxt)
parse a general 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. |
Function: xmlReadIOxmlDocPtr xmlReadIO (xmlInputReadCallback ioread, xmlInputCloseCallback ioclose, void * ioctx, const char * URL, const char * encoding, int options)
parse an XML document from I/O functions and source and build a tree.
ioread: | an I/O read function | ioclose: | an I/O close function | ioctx: | an I/O handler | URL: | the base URL to use for the document | encoding: | the document encoding, or NULL | options: | a combination of xmlParserOption(s) | Returns: | the resulting document tree |
Function: xmlStrVPrintfint xmlStrVPrintf (xmlChar * buf, int len, const xmlChar * msg, va_list ap)
Formats @msg and places result into @buf.
buf: | the result buffer. | len: | the result buffer length. | msg: | the message with printf formatting. | ap: | extra parameters for the message. | Returns: | the number of characters written to @buf or -1 if an error occurs. |
Function: xmlCreateDocParserCtxtxmlParserCtxtPtr xmlCreateDocParserCtxt (const 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 |
Function: xmlStrsubxmlChar * 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 occurrence or NULL. |
Function: xmlParseBalancedChunkMemoryint xmlParseBalancedChunkMemory (xmlDocPtr doc, xmlSAXHandlerPtr sax, void * user_data, int depth, const xmlChar * string, xmlNodePtr * lst)
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) | lst: | 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 |
Function: xmlRecoverDocxmlDocPtr 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 |
Function: xmlCleanupParservoid xmlCleanupParser (void)
Cleanup function for the XML library. It tries to reclaim all parsing related global memory allocated for the library processing. It doesn't deallocate any document related memory. Calling this function should not prevent reusing the library but one should call xmlCleanupParser() only when the process has finished using the library or XML document built with it.
Function: xmlStrcasecmpint 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 |
Function: xmlCtxtResetPushint xmlCtxtResetPush (xmlParserCtxtPtr ctxt, const char * chunk, int size, const char * filename, const char * encoding)
Reset a push parser context
ctxt: | an XML parser context | chunk: | a pointer to an array of chars | size: | number of chars in the array | filename: | an optional file name or URI | encoding: | the document encoding, or NULL | Returns: | 0 in case of success and 1 in case of error |
Is this document tagged standalone?
Called when the document start being processed.
Macro: XML_SKIP_IDS#define XML_SKIP_IDS Bit in the loadsubset context field to tell to not do ID/REFs registration. Used to initialize xmlLoadExtDtdDefaultValue in some special cases.
Function: xmlClearParserCtxtvoid xmlClearParserCtxt (xmlParserCtxtPtr ctxt)
Clear (release owned resources) and reinitialize a parser context
ctxt: | an XML parser context |
Function: xmlParseExternalEntityint xmlParseExternalEntity (xmlDocPtr doc, xmlSAXHandlerPtr sax, void * user_data, int depth, const xmlChar * URL, const xmlChar * ID, xmlNodePtr * lst)
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 | lst: | 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 |
What to do when a notation declaration has been parsed.
Display and format a warning messages, callback.
Function: xmlSetExternalEntityLoadervoid xmlSetExternalEntityLoader (xmlExternalEntityLoader f)
Changes the defaultexternal entity resolver function for the application
f: | the new entity resolver function |
Daniel Veillard |