typedef void(* | xmlParserInputDeallocate |
xmlParserInput:
in which case the flow is already completely in memory - or external entities - in which case we use the buf structure for progressive reading and I18N conversions to the internal UTF-8 format. xmlParserInputDeallocate: Callback for freeing some parser input allocations.
typedef struct _xmlParserNodeInfo | xmlParserNodeInfo |
xmlParserNodeInfo:
The parser can be asked to collect Node informations, i.e. at what place in the file they were detected. NOTE: This is off by default and not very well tested.
typedef xmlParserNodeInfo * | xmlParserNodeInfoPtr |
typedef struct _xmlParserNodeInfoSeq | xmlParserNodeInfoSeq |
typedef xmlParserNodeInfoSeq * | xmlParserNodeInfoSeqPtr |
xmlParserInputState:
The parser is now working also as a state based parser. The recursive one use the state info for entities processing.
XML_DETECT_IDS:
Bit in the loadsubset context field to tell to do ID/REFs lookups. Use it to initialize xmlLoadExtDtdDefaultValue.
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.
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.
typedef xmlParserInputPtr(* | resolveEntitySAXFunc |
xmlSAXHandler:
override this resolveEntity() callback in the SAX block
or better use the xmlSetExternalEntityLoader() function to set up it's own entity resolution routine
Returns the xmlParserInputPtr if inlined or NULL for DOM behaviour.
typedef void(* | internalSubsetSAXFunc |
internalSubsetSAXFunc: Callback on internal subset declaration.
typedef void(* | externalSubsetSAXFunc |
externalSubsetSAXFunc: Callback on external subset declaration.
typedef xmlEntityPtr(* | getEntitySAXFunc |
getEntitySAXFunc: Get an entity by name.
Returns the xmlEntityPtr if found.
typedef xmlEntityPtr(* | getParameterEntitySAXFunc |
getParameterEntitySAXFunc: Get a parameter entity by name.
Returns the xmlEntityPtr if found.
typedef void(* | entityDeclSAXFunc |
entityDeclSAXFunc: An entity definition has been parsed.
typedef void(* | notationDeclSAXFunc |
notationDeclSAXFunc: What to do when a notation declaration has been parsed.
typedef void(* | attributeDeclSAXFunc |
attributeDeclSAXFunc: An attribute definition has been parsed.
typedef void(* | elementDeclSAXFunc |
elementDeclSAXFunc: An element definition has been parsed.
typedef void(* | unparsedEntityDeclSAXFunc |
unparsedEntityDeclSAXFunc: What to do when an unparsed entity declaration is parsed.
typedef void(* | setDocumentLocatorSAXFunc |
setDocumentLocatorSAXFunc: Receive the document locator at startup, actually xmlDefaultSAXLocator. Everything is available on the context, so this is useless in our case.
typedef void(* | startDocumentSAXFunc |
startDocumentSAXFunc: Called when the document start being processed.
typedef void(* | endDocumentSAXFunc |
endDocumentSAXFunc: Called when the document end has been detected.
typedef void(* | startElementSAXFunc |
startElementSAXFunc: Called when an opening tag has been processed.
typedef void(* | endElementSAXFunc |
endElementSAXFunc: Called when the end of an element has been detected.
typedef void(* | attributeSAXFunc |
attributeSAXFunc: 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.
typedef void(* | referenceSAXFunc |
referenceSAXFunc: Called when an entity reference is detected.
typedef void(* | charactersSAXFunc |
charactersSAXFunc: Receiving some chars from the parser.
typedef void(* | ignorableWhitespaceSAXFunc |
ignorableWhitespaceSAXFunc: Receiving some ignorable whitespaces from the parser. UNUSED: by default the DOM building will use characters.
typedef void(* | processingInstructionSAXFunc |
processingInstructionSAXFunc: A processing instruction has been parsed.
typedef void(* | cdataBlockSAXFunc |
cdataBlockSAXFunc: Called when a pcdata block has been parsed.
typedef void(* | warningSAXFunc |
warningSAXFunc: Display and format a warning messages, callback.
typedef void(* | errorSAXFunc |
errorSAXFunc: Display and format an error messages, callback.
typedef void(* | fatalErrorSAXFunc |
fatalErrorSAXFunc: Display and format fatal error messages, callback. Note: so far fatalError() SAX callbacks are not used, error() get all the callbacks for errors.
typedef int(* | isStandaloneSAXFunc |
isStandaloneSAXFunc: Is this document tagged standalone?
Returns 1 if true
typedef int(* | hasInternalSubsetSAXFunc |
hasInternalSubsetSAXFunc: Does this document has an internal subset.
Returns 1 if true
typedef int(* | hasExternalSubsetSAXFunc |
hasExternalSubsetSAXFunc: Does this document has an external subset?
Returns 1 if true
typedef void(* | startElementNsSAX2Func |
startElementNsSAX2Func: 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.
typedef void(* | endElementNsSAX2Func |
endElementNsSAX2Func: SAX2 callback when an element end has been detected by the parser. It provides the namespace informations for the element.
typedef void(* | startPrefixMappingSAX2Func |
startPrefixMappingSAX2Func: SAX2 callback when namespace prefix mapping is done.
typedef void(* | endPrefixMappingSAX2Func |
endPrefixMappingSAX2Func: SAX2 callback when namespace prefix mapping is getting out of scope.
typedef struct _xmlSAXHandlerV1 | xmlSAXHandlerV1 |
typedef xmlSAXHandlerV1 * | xmlSAXHandlerV1Ptr |
typedef xmlParserInputPtr(* | xmlExternalEntityLoader |
xmlExternalEntityLoader: External entity loaders types.
Returns the entity input parser.
XMLPUBFUN void XMLCALL | xmlInitParser | ( | void | ) |
xmlInitParser:
Initialization function for the XML parser. This is not reentrant. Call once before processing in case of use in multithreaded programs.
OOM: possible --> OOM flag is set
XMLPUBFUN void XMLCALL | xmlCleanupParser | ( | void | ) |
xmlCleanupParser:
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.
OOM: never
XMLPUBFUN int XMLCALL | xmlParserInputRead | ( | xmlParserInputPtr | in, |
int | len | |||
) |
xmlParserInputRead: This function refresh the input for the parser. It doesn't try to preserve pointers to the input buffer, and discard already read data
Returns the number of xmlChars read, or -1 in case of error, 0 indicate the end of this entity
Parameters | |
---|---|
in | an XML parser input |
len | an indicative size for the lookahead |
XMLPUBFUN int XMLCALL | xmlParserInputGrow | ( | xmlParserInputPtr | in, |
int | len | |||
) |
xmlParserInputGrow: This function increase the input for the parser. It tries to preserve pointers to the input buffer, and keep already read data
Returns the number of xmlChars read, or -1 in case of error, 0 indicate the end of this entity
OOM: possible --> OOM flag is set when returns -1
Parameters | |
---|---|
in | an XML parser input |
len | an indicative size for the lookahead |
XMLPUBFUN xmlDocPtr XMLCALL | xmlParseMemory | ( | const char * | buffer, |
int | size | |||
) |
xmlParseMemory: parse an XML in-memory block and build a tree.
Returns the resulting document tree
Parameters | |
---|---|
buffer | an pointer to a char array |
size | the size of the array |
XMLPUBFUN xmlDocPtr XMLCALL | xmlParseFile | ( | const char * | filename | ) |
xmlParseFile: parse an XML file and build a tree. Automatic support for ZLIB/Compress compressed document is provided by default if found at compile-time.
Returns the resulting document tree if the file was wellformed, NULL otherwise.
Parameters | |
---|---|
filename | the filename |
XMLPUBFUN int XMLCALL | xmlSubstituteEntitiesDefault | ( | int | val | ) |
xmlSubstituteEntitiesDefault: 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.
Returns the last value for 0 for no substitution, 1 for substitution.
Parameters | |
---|---|
val | int 0 or 1 |
XMLPUBFUN int XMLCALL | xmlKeepBlanksDefault | ( | int | val | ) |
xmlKeepBlanksDefault: 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.
Returns the last value for 0 for no substitution, 1 for substitution.
Parameters | |
---|---|
val | int 0 or 1 |
XMLPUBFUN int XMLCALL | xmlLineNumbersDefault | ( | int | val | ) |
XMLPUBFUN void XMLCALL | xmlStopParser | ( | xmlParserCtxtPtr | ctxt | ) |
XMLPUBFUN int XMLCALL | xmlPedanticParserDefault | ( | int | val | ) |
xmlPedanticParserDefault: Set and return the previous value for enabling pedantic warnings.
Returns the last value for 0 for no substitution, 1 for substitution.
Parameters | |
---|---|
val | int 0 or 1 |
XMLPUBFUN xmlDocPtr XMLCALL | xmlRecoverMemory | ( | const char * | buffer, |
int | size | |||
) |
xmlRecoverMemory: parse an XML in-memory block and build a tree. In the case the document is not Well Formed, a tree is built anyway
Returns the resulting document tree
Parameters | |
---|---|
buffer | an pointer to a char array |
size | the size of the array |
XMLPUBFUN xmlDocPtr XMLCALL | xmlRecoverFile | ( | const char * | filename | ) |
xmlRecoverFile: 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
Returns the resulting document tree
Parameters | |
---|---|
filename | the filename |
XMLPUBFUN int XMLCALL | xmlParseDocument | ( | xmlParserCtxtPtr | ctxt | ) |
xmlParseDocument: 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*)?
Returns 0, -1 in case of error. the parser context is augmented as a result of the parsing.
OOM: possible, of course --> check OOM flag [REVIEW NOT FINISHED]
Parameters | |
---|---|
ctxt | an XML parser context |
XMLPUBFUN int XMLCALL | xmlParseExtParsedEnt | ( | xmlParserCtxtPtr | ctxt | ) |
xmlParseExtParsedEnt: parse a general parsed entity An external general parsed entity is well-formed if it matches the production labeled extParsedEnt.
[78] extParsedEnt ::= TextDecl? content
Returns 0, -1 in case of error. the parser context is augmented as a result of the parsing.
Parameters | |
---|---|
ctxt | an XML parser context |
XMLPUBFUN xmlDocPtr XMLCALL | xmlSAXParseDoc | ( | xmlSAXHandlerPtr | sax, |
xmlChar * | cur, | |||
int | length, | |||
int | recovery, | |||
int * | errorCode | |||
) |
xmlSAXParseDoc: 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.
Returns the resulting document tree
OOM: possible --> OOM flag is set (and NULL is returned too)
Parameters | |
---|---|
sax | the SAX handler block |
cur | a pointer to an array of xmlChar |
length | size (bytes) of the array (0 if it should be calculated) |
recovery | work in recovery mode, i.e. tries to read no Well Formed documents |
errorCode | last error code is recorded, 0 is no errors |
XMLPUBFUN int XMLCALL | xmlSAXUserParseFile | ( | xmlSAXHandlerPtr | sax, |
void * | user_data, | |||
const char * | filename | |||
) |
xmlSAXUserParseFile: parse an XML file and call the given SAX handler routines. Automatic support for ZLIB/Compress compressed document is provided
Returns 0 in case of success or a error number otherwise
Parameters | |
---|---|
sax | a SAX handler |
user_data | The user data returned on SAX callbacks |
filename | a file name |
XMLPUBFUN int XMLCALL | xmlSAXUserParseMemory | ( | xmlSAXHandlerPtr | sax, |
void * | user_data, | |||
const char * | buffer, | |||
int | size | |||
) |
xmlSAXUserParseMemory: A better SAX parsing routine. parse an XML in-memory buffer and call the given SAX handler routines.
Returns 0 in case of success or a error number otherwise
Parameters | |
---|---|
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 |
XMLPUBFUN xmlDocPtr XMLCALL | xmlSAXParseMemory | ( | xmlSAXHandlerPtr | sax, |
const char * | buffer, | |||
int | size, | |||
int | recovery | |||
) |
xmlSAXParseMemory: 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.
Returns the resulting document tree
Parameters | |
---|---|
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 |
XMLPUBFUN xmlDocPtr XMLCALL | xmlSAXParseMemoryWithData | ( | xmlSAXHandlerPtr | sax, |
const char * | buffer, | |||
int | size, | |||
int | recovery, | |||
void * | data | |||
) |
xmlSAXParseMemoryWithData: 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
Returns the resulting document tree
Parameters | |
---|---|
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 |
XMLPUBFUN xmlDocPtr XMLCALL | xmlSAXParseFile | ( | xmlSAXHandlerPtr | sax, |
const char * | filename, | |||
int | recovery | |||
) |
xmlSAXParseFile: 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.
Returns the resulting document tree
Parameters | |
---|---|
sax | the SAX handler block |
filename | the filename |
recovery | work in recovery mode, i.e. tries to read no Well Formed documents |
XMLPUBFUN xmlDocPtr XMLCALL | xmlSAXParseFileWithData | ( | xmlSAXHandlerPtr | sax, |
const char * | filename, | |||
int | recovery, | |||
void * | data | |||
) |
xmlSAXParseFileWithData: 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
Returns the resulting document tree
Parameters | |
---|---|
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 |
XMLPUBFUN xmlDocPtr XMLCALL | xmlSAXParseEntity | ( | xmlSAXHandlerPtr | sax, |
const char * | filename | |||
) |
XMLPUBFUN xmlDocPtr XMLCALL | xmlParseEntity | ( | const char * | filename | ) |
XMLPUBFUN xmlDtdPtr XMLCALL | xmlSAXParseDTD | ( | xmlSAXHandlerPtr | sax, |
const xmlChar * | ExternalID, | |||
const xmlChar * | SystemID | |||
) |
XMLPUBFUN xmlDtdPtr XMLCALL | xmlIOParseDTD | ( | xmlSAXHandlerPtr | sax, |
xmlParserInputBufferPtr | input, | |||
xmlCharEncoding | enc | |||
) |
XMLPUBFUN int XMLCALL | xmlParseBalancedChunkMemory | ( | xmlDocPtr | doc, |
xmlSAXHandlerPtr | sax, | |||
void * | user_data, | |||
int | depth, | |||
const xmlChar * | string, | |||
xmlNodePtr * | lst | |||
) |
XMLPUBFUN xmlParserErrors XMLCALL | xmlParseInNodeContext | ( | xmlNodePtr | node, |
const char * | data, | |||
int | datalen, | |||
int | options, | |||
xmlNodePtr * | lst | |||
) |
xmlParseInNodeContext: Parse a well-balanced chunk of an XML document within the context (DTD, namespaces, etc ...) of the given node.
The allowed sequence for the data is a Well Balanced Chunk defined by the content production in the XML grammar:
[43] content ::= (element | CharData | Reference | CDSect | PI | Comment)*
Returns XML_ERR_OK if the chunk is well balanced, and the parser error code otherwise
Parameters | |
---|---|
node | the context node |
data | the input string |
datalen | the input string length in bytes |
options | a combination of xmlParserOption |
lst | the return value for the set of parsed nodes |
XMLPUBFUN int XMLCALL | xmlParseBalancedChunkMemoryRecover | ( | xmlDocPtr | doc, |
xmlSAXHandlerPtr | sax, | |||
void * | user_data, | |||
int | depth, | |||
const xmlChar * | string, | |||
xmlNodePtr * | lst, | |||
int | recover | |||
) |
XMLPUBFUN int XMLCALL | xmlParseExternalEntity | ( | xmlDocPtr | doc, |
xmlSAXHandlerPtr | sax, | |||
void * | user_data, | |||
int | depth, | |||
const xmlChar * | URL, | |||
const xmlChar * | ID, | |||
xmlNodePtr * | lst | |||
) |
XMLPUBFUN int XMLCALL | xmlParseCtxtExternalEntity | ( | xmlParserCtxtPtr | ctx, |
const xmlChar * | URL, | |||
const xmlChar * | ID, | |||
xmlNodePtr * | lst | |||
) |
xmlParseCtxtExternalEntity: 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
Returns 0 if the entity is well formed, -1 in case of args problem and the parser error code otherwise
Parameters | |
---|---|
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 |
XMLPUBFUN xmlParserCtxtPtr XMLCALL | xmlNewParserCtxt | ( | void | ) |
xmlNewParserCtxt:
Allocate and initialize a new parser context.
Returns the xmlParserCtxtPtr or NULL
OOM: possible --> returns NULL, OOM flag is set
XMLPUBFUN int XMLCALL | xmlInitParserCtxt | ( | xmlParserCtxtPtr | ctxt | ) |
xmlInitParserCtxt: Initialize a parser context
Returns 0 in case of success and -1 in case of error
OOM: possible --> returns -1; OOM flag is set
Parameters | |
---|---|
ctxt | an XML parser context |
XMLPUBFUN void XMLCALL | xmlClearParserCtxt | ( | xmlParserCtxtPtr | ctxt | ) |
xmlClearParserCtxt: Clear (release owned resources) and reinitialize a parser context
Parameters | |
---|---|
ctxt | an XML parser context |
XMLPUBFUN void XMLCALL | xmlFreeParserCtxt | ( | xmlParserCtxtPtr | ctxt | ) |
xmlFreeParserCtxt: Free all the memory used by a parser context. However the parsed document in ctxt->myDoc is not freed.
OOM: never
Parameters | |
---|---|
ctxt | an XML parser context |
XMLPUBFUN void XMLCALL | xmlSetupParserForBuffer | ( | xmlParserCtxtPtr | ctxt, |
const xmlChar * | buffer, | |||
const char * | filename | |||
) |
xmlSetupParserForBuffer: 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
Parameters | |
---|---|
ctxt | an XML parser context |
buffer | a xmlChar * buffer |
filename | a file name |
XMLPUBFUN xmlParserCtxtPtr XMLCALL | xmlCreateDocParserCtxt | ( | const xmlChar * | cur, |
int | length | |||
) |
xmlCreateDocParserCtxt: Creates a parser context for an XML in-memory document.
Returns the new parser context or NULL
OOM: possible --> returns NULL for cur!=NULL && length>0; OOM flag is set
Parameters | |
---|---|
cur | a pointer to an array of xmlChar |
length | size (bytes) of the array (0 if it should be calculated) |
XMLPUBFUN int XMLCALL | xmlGetFeaturesList | ( | int * | len, |
const char ** | result | |||
) |
XMLPUBFUN int XMLCALL | xmlGetFeature | ( | xmlParserCtxtPtr | ctxt, |
const char * | name, | |||
void * | result | |||
) |
XMLPUBFUN int XMLCALL | xmlSetFeature | ( | xmlParserCtxtPtr | ctxt, |
const char * | name, | |||
void * | value | |||
) |
XMLPUBFUN xmlParserCtxtPtr XMLCALL | xmlCreateIOParserCtxt | ( | xmlSAXHandlerPtr | sax, |
void * | user_data, | |||
xmlInputReadCallback | ioread, | |||
xmlInputCloseCallback | ioclose, | |||
void * | ioctx, | |||
xmlCharEncoding | enc | |||
) |
xmlCreateIOParserCtxt: Create a parser context for using the XML parser with an existing I/O stream
Returns the new parser context or NULL
Parameters | |
---|---|
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 |
XMLPUBFUN xmlParserInputPtr XMLCALL | xmlNewIOInputStream | ( | xmlParserCtxtPtr | ctxt, |
xmlParserInputBufferPtr | input, | |||
xmlCharEncoding | enc | |||
) |
xmlNewIOInputStream: Create a new input stream structure encapsulating the input into a stream suitable for the parser.
Returns the new input stream or NULL
Parameters | |
---|---|
ctxt | an XML parser context |
input | an I/O Input |
enc | the charset encoding if known |
XMLPUBFUN void XMLCALL | xmlSetExternalEntityLoader | ( | xmlExternalEntityLoader | f | ) |
xmlSetExternalEntityLoader: Changes the defaultexternal entity resolver function for the application
Parameters | |
---|---|
f | the new entity resolver function |
XMLPUBFUN xmlExternalEntityLoader XMLCALL | xmlGetExternalEntityLoader | ( | void | ) |
xmlGetExternalEntityLoader:
Get the default external entity resolver function for the application
Returns the xmlExternalEntityLoader function pointer
XMLPUBFUN xmlParserInputPtr XMLCALL | xmlLoadExternalEntity | ( | const char * | URL, |
const char * | ID, | |||
xmlParserCtxtPtr | ctxt | |||
) |
xmlLoadExternalEntity: Load an external entity, note that the use of this function for unparsed entities may generate problems
Returns the xmlParserInputPtr or NULL
OOM:
Parameters | |
---|---|
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 |
XMLPUBFUN long XMLCALL | xmlByteConsumed | ( | xmlParserCtxtPtr | ctxt | ) |
xmlByteConsumed: This function provides the current index of the parser relative to the start of the current entity. This function is computed in bytes from the beginning starting at zero and finishing at the size in byte of the file if parsing a file. The function is of constant cost if the input is UTF-8 but can be costly if run on non-UTF-8 input.
Returns the index in bytes from the beginning of the entity or -1 in case the index could not be computed.
Parameters | |
---|---|
ctxt | an XML parser context |
xmlParserOption:
This is the set of XML parser options that can be passed down to the xmlReadDoc() and similar calls.
Enumerator | Value | Description |
---|---|---|
XML_PARSE_RECOVER | 1<<0 | |
XML_PARSE_NOENT | 1<<1 | |
XML_PARSE_DTDLOAD | 1<<2 | |
XML_PARSE_DTDATTR | 1<<3 | |
XML_PARSE_DTDVALID | 1<<4 | |
XML_PARSE_NOERROR | 1<<5 | |
XML_PARSE_NOWARNING | 1<<6 | |
XML_PARSE_PEDANTIC | 1<<7 | |
XML_PARSE_NOBLANKS | 1<<8 | |
XML_PARSE_SAX1 | 1<<9 | |
XML_PARSE_XINCLUDE | 1<<10 | |
XML_PARSE_NONET | 1<<11 | |
XML_PARSE_NODICT | 1<<12 | |
XML_PARSE_NSCLEAN | 1<<13 | |
XML_PARSE_NOCDATA | 1<<14 |
XMLPUBFUN void XMLCALL | xmlCtxtReset | ( | xmlParserCtxtPtr | ctxt | ) |
xmlCtxtReset: Reset a parser context
Parameters | |
---|---|
ctxt | an XML parser context |
XMLPUBFUN int XMLCALL | xmlCtxtResetPush | ( | xmlParserCtxtPtr | ctxt, |
const char * | chunk, | |||
int | size, | |||
const char * | filename, | |||
const char * | encoding | |||
) |
xmlCtxtResetPush: Reset a push parser context
Returns 0 in case of success and 1 in case of error
Parameters | |
---|---|
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 |
XMLPUBFUN int XMLCALL | xmlCtxtUseOptions | ( | xmlParserCtxtPtr | ctxt, |
int | options | |||
) |
xmlCtxtUseOptions: Applies the options to the parser context
Returns 0 in case of success, the set of unknown or unimplemented options in case of error.
Parameters | |
---|---|
ctxt | an XML parser context |
options | a combination of xmlParserOption |
XMLPUBFUN xmlDocPtr XMLCALL | xmlReadDoc | ( | const xmlChar * | cur, |
const char * | URL, | |||
const char * | encoding, | |||
int | options | |||
) |
xmlReadDoc: parse an XML in-memory document and build a tree.
Returns the resulting document tree
Parameters | |
---|---|
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 |
XMLPUBFUN xmlDocPtr XMLCALL | xmlReadFile | ( | const char * | URL, |
const char * | encoding, | |||
int | options | |||
) |
xmlReadFile: parse an XML file from the filesystem or the network.
Returns the resulting document tree
Parameters | |
---|---|
URL | a file or URL |
encoding | the document encoding, or NULL |
options | a combination of xmlParserOption |
XMLPUBFUN xmlDocPtr XMLCALL | xmlReadMemory | ( | const char * | buffer, |
int | size, | |||
const char * | URL, | |||
const char * | encoding, | |||
int | options | |||
) |
xmlReadMemory: parse an XML in-memory document and build a tree.
Returns the resulting document tree
Parameters | |
---|---|
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 |
XMLPUBFUN xmlDocPtr XMLCALL | xmlReadFd | ( | int | fd, |
const char * | URL, | |||
const char * | encoding, | |||
int | options | |||
) |
xmlReadFd: parse an XML from a file descriptor and build a tree. NOTE that the file descriptor will not be closed when the reader is closed or reset.
Returns the resulting document tree
Parameters | |
---|---|
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 |
XMLPUBFUN xmlDocPtr XMLCALL | xmlReadIO | ( | xmlInputReadCallback | ioread, |
xmlInputCloseCallback | ioclose, | |||
void * | ioctx, | |||
const char * | URL, | |||
const char * | encoding, | |||
int | options | |||
) |
xmlReadIO: parse an XML document from I/O functions and source and build a tree.
Returns the resulting document tree
Parameters | |
---|---|
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 |
XMLPUBFUN xmlDocPtr XMLCALL | xmlCtxtReadDoc | ( | xmlParserCtxtPtr | ctxt, |
const xmlChar * | cur, | |||
const char * | URL, | |||
const char * | encoding, | |||
int | options | |||
) |
xmlCtxtReadDoc: parse an XML in-memory document and build a tree. This reuses the existing ctxt parser context
Returns the resulting document tree
Parameters | |
---|---|
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 |
XMLPUBFUN xmlDocPtr XMLCALL | xmlCtxtReadFd | ( | xmlParserCtxtPtr | ctxt, |
int | fd, | |||
const char * | URL, | |||
const char * | encoding, | |||
int | options | |||
) |
xmlCtxtReadFd: parse an XML from a file descriptor and build a tree. This reuses the existing ctxt parser context NOTE that the file descriptor will not be closed when the reader is closed or reset.
Returns the resulting document tree
Parameters | |
---|---|
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 |
XMLPUBFUN xmlDocPtr XMLCALL | xmlCtxtReadFile | ( | xmlParserCtxtPtr | ctxt, |
const char * | filename, | |||
const char * | encoding, | |||
int | options | |||
) |
xmlCtxtReadFile: parse an XML file from the filesystem or the network. This reuses the existing ctxt parser context
Returns the resulting document tree
Parameters | |
---|---|
ctxt | an XML parser context |
filename | a file or URL |
encoding | the document encoding, or NULL |
options | a combination of xmlParserOption |
XMLPUBFUN xmlDocPtr XMLCALL | xmlCtxtReadMemory | ( | xmlParserCtxtPtr | ctxt, |
const char * | buffer, | |||
int | size, | |||
const char * | URL, | |||
const char * | encoding, | |||
int | options | |||
) |
xmlCtxtReadMemory: parse an XML in-memory document and build a tree. This reuses the existing ctxt parser context
Returns the resulting document tree
Parameters | |
---|---|
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 |
XMLPUBFUN xmlDocPtr XMLCALL | xmlCtxtReadIO | ( | xmlParserCtxtPtr | ctxt, |
xmlInputReadCallback | ioread, | |||
xmlInputCloseCallback | ioclose, | |||
void * | ioctx, | |||
const char * | URL, | |||
const char * | encoding, | |||
int | options | |||
) |
xmlCtxtReadIO: parse an XML document from I/O functions and source and build a tree. This reuses the existing ctxt parser context
Returns the resulting document tree
Parameters | |
---|---|
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 |