Eneboo - Documentación para desarrolladores
|
#include <stdarg.h>
#include <libxml/xmlversion.h>
#include <libxml/tree.h>
#include <libxml/dict.h>
#include <libxml/hash.h>
#include <libxml/valid.h>
#include <libxml/entities.h>
#include <libxml/xmlerror.h>
#include <libxml/xmlstring.h>
#include <libxml/encoding.h>
#include <libxml/xmlIO.h>
#include <libxml/globals.h>
Ir al código fuente de este archivo.
Clases | |
struct | _xmlParserInput |
struct | _xmlParserNodeInfo |
struct | _xmlParserNodeInfoSeq |
struct | _xmlParserCtxt |
struct | _xmlSAXLocator |
struct | _xmlSAXHandler |
struct | _xmlSAXHandlerV1 |
'defines' | |
#define | XML_DEFAULT_VERSION "1.0" |
#define | XML_DETECT_IDS 2 |
#define | XML_COMPLETE_ATTRS 4 |
#define | XML_SKIP_IDS 8 |
'typedefs' | |
typedef void(* | xmlParserInputDeallocate )(xmlChar *str) |
typedef struct _xmlParserNodeInfo | xmlParserNodeInfo |
typedef xmlParserNodeInfo * | xmlParserNodeInfoPtr |
typedef struct _xmlParserNodeInfoSeq | xmlParserNodeInfoSeq |
typedef xmlParserNodeInfoSeq * | xmlParserNodeInfoSeqPtr |
typedef xmlParserInputPtr(* | resolveEntitySAXFunc )(void *ctx, const xmlChar *publicId, const xmlChar *systemId) |
: the root element name | |
externalSubsetSAXFunc: : the user data (XML parser context) : the external ID : the SYSTEM ID (e.g. filename or URL) Callback on external subset declaration. | |
typedef void(* | internalSubsetSAXFunc )(void *ctx, const xmlChar *name, const xmlChar *ExternalID, const xmlChar *SystemID) |
typedef void(* | externalSubsetSAXFunc )(void *ctx, const xmlChar *name, const xmlChar *ExternalID, const xmlChar *SystemID) |
: The entity name | |
getParameterEntitySAXFunc: : the user data (XML parser context) Get a parameter entity by name. Returns the xmlEntityPtr if found. | |
typedef xmlEntityPtr(* | getEntitySAXFunc )(void *ctx, const xmlChar *name) |
typedef xmlEntityPtr(* | getParameterEntitySAXFunc )(void *ctx, const xmlChar *name) |
: The name of the notation | |
notationDeclSAXFunc: : the user data (XML parser context) : The public ID of the entity : The system ID of the entity What to do when a notation declaration has been parsed. | |
typedef void(* | notationDeclSAXFunc )(void *ctx, const xmlChar *name, const xmlChar *publicId, const xmlChar *systemId) |
typedef void(* | attributeDeclSAXFunc )(void *ctx, const xmlChar *elem, const xmlChar *fullname, int type, int def, const xmlChar *defaultValue, xmlEnumerationPtr tree) |
: The element name | |
endElementSAXFunc: : the user data (XML parser context) Called when the end of an element has been detected. | |
typedef void(* | elementDeclSAXFunc )(void *ctx, const xmlChar *name, int type, xmlElementContentPtr content) |
typedef void(* | endElementSAXFunc )(void *ctx, const xmlChar *name) |
: The name of the entity | |
unparsedEntityDeclSAXFunc: : the user data (XML parser context) : The public ID of the entity : The system ID of the entity : the name of the notation What to do when an unparsed entity declaration is parsed. | |
typedef void(* | unparsedEntityDeclSAXFunc )(void *ctx, const xmlChar *name, const xmlChar *publicId, const xmlChar *systemId, const xmlChar *notationName) |
typedef void(* | setDocumentLocatorSAXFunc )(void *ctx, xmlSAXLocatorPtr loc) |
typedef void(* | startDocumentSAXFunc )(void *ctx) |
typedef void(* | endDocumentSAXFunc )(void *ctx) |
: The element name, including namespace prefix | |
startElementSAXFunc: : the user data (XML parser context) : An array of name/value attributes pairs, NULL terminated Called when an opening tag has been processed. | |
typedef void(* | startElementSAXFunc )(void *ctx, const xmlChar *name, const xmlChar **atts) |
: The attribute name, including namespace prefix | |
attributeSAXFunc: : the user data (XML parser context) : The attribute 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. | |
typedef void(* | attributeSAXFunc )(void *ctx, const xmlChar *name, const xmlChar *value) |
Enumeraciones | |
enum | xmlParserInputState { XML_PARSER_EOF = -1, XML_PARSER_START = 0, XML_PARSER_MISC, XML_PARSER_PI, XML_PARSER_DTD, XML_PARSER_PROLOG, XML_PARSER_COMMENT, XML_PARSER_START_TAG, XML_PARSER_CONTENT, XML_PARSER_CDATA_SECTION, XML_PARSER_END_TAG, XML_PARSER_ENTITY_DECL, XML_PARSER_ENTITY_VALUE, XML_PARSER_ATTRIBUTE_VALUE, XML_PARSER_SYSTEM_LITERAL, XML_PARSER_EPILOG, XML_PARSER_IGNORE, XML_PARSER_PUBLIC_LITERAL } |
enum | xmlParserMode { XML_PARSE_UNKNOWN = 0, XML_PARSE_DOM = 1, XML_PARSE_SAX = 2, XML_PARSE_PUSH_DOM = 3, XML_PARSE_PUSH_SAX = 4, XML_PARSE_READER = 5 } |
: The entity name | |
referenceSAXFunc: : the user data (XML parser context) Called when an entity reference is detected. | |
#define | XML_SAX2_MAGIC 0xDEEDBEAF |
enum | xmlParserOption { 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, XML_PARSE_NOXINCNODE = 1<<15, XML_PARSE_COMPACT = 1<<16, XML_PARSE_OLD10 = 1<<17, XML_PARSE_NOBASEFIX = 1<<18, XML_PARSE_HUGE = 1<<19, XML_PARSE_OLDSAX = 1<<20 } |
enum | xmlFeature { XML_WITH_THREAD = 1, XML_WITH_TREE = 2, XML_WITH_OUTPUT = 3, XML_WITH_PUSH = 4, XML_WITH_READER = 5, XML_WITH_PATTERN = 6, XML_WITH_WRITER = 7, XML_WITH_SAX1 = 8, XML_WITH_FTP = 9, XML_WITH_HTTP = 10, XML_WITH_VALID = 11, XML_WITH_HTML = 12, XML_WITH_LEGACY = 13, XML_WITH_C14N = 14, XML_WITH_CATALOG = 15, XML_WITH_XPATH = 16, XML_WITH_XPTR = 17, XML_WITH_XINCLUDE = 18, XML_WITH_ICONV = 19, XML_WITH_ISO8859X = 20, XML_WITH_UNICODE = 21, XML_WITH_REGEXP = 22, XML_WITH_AUTOMATA = 23, XML_WITH_EXPR = 24, XML_WITH_SCHEMAS = 25, XML_WITH_SCHEMATRON = 26, XML_WITH_MODULES = 27, XML_WITH_DEBUG = 28, XML_WITH_DEBUG_MEM = 29, XML_WITH_DEBUG_RUN = 30, XML_WITH_ZLIB = 31, XML_WITH_NONE = 99999 } |
typedef void(* | entityDeclSAXFunc )(void *ctx, const xmlChar *name, int type, const xmlChar *publicId, const xmlChar *systemId, xmlChar *content) |
typedef void(* | referenceSAXFunc )(void *ctx, const xmlChar *name) |
typedef void(* | charactersSAXFunc )(void *ctx, const xmlChar *ch, int len) |
typedef void(* | ignorableWhitespaceSAXFunc )(void *ctx, const xmlChar *ch, int len) |
typedef void(* | processingInstructionSAXFunc )(void *ctx, const xmlChar *target, const xmlChar *data) |
typedef void(* | commentSAXFunc )(void *ctx, const xmlChar *value) |
typedef void(* | cdataBlockSAXFunc )(void *ctx, const xmlChar *value, int len) |
typedef const char * | msg |
typedef const char | LIBXML_ATTR_FORMAT (2, 3) |
typedef int(* | isStandaloneSAXFunc )(void *ctx) |
typedef int(* | hasInternalSubsetSAXFunc )(void *ctx) |
typedef int(* | hasExternalSubsetSAXFunc )(void *ctx) |
typedef 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) |
typedef void(* | endElementNsSAX2Func )(void *ctx, const xmlChar *localname, const xmlChar *prefix, const xmlChar *URI) |
typedef struct _xmlSAXHandlerV1 | xmlSAXHandlerV1 |
typedef xmlSAXHandlerV1 * | xmlSAXHandlerV1Ptr |
typedef xmlParserInputPtr(* | xmlExternalEntityLoader )(const char *URL, const char *ID, xmlParserCtxtPtr context) |
typedef | void (XMLCDECL *warningSAXFunc)(void *ctx |
XMLPUBFUN void XMLCALL | xmlInitParser (void) |
XMLPUBFUN void XMLCALL | xmlCleanupParser (void) |
XMLPUBFUN int XMLCALL | xmlParserInputRead (xmlParserInputPtr in, int len) |
XMLPUBFUN int XMLCALL | xmlParserInputGrow (xmlParserInputPtr in, int len) |
XMLPUBFUN int XMLCALL | xmlSubstituteEntitiesDefault (int val) |
XMLPUBFUN int XMLCALL | xmlKeepBlanksDefault (int val) |
XMLPUBFUN void XMLCALL | xmlStopParser (xmlParserCtxtPtr ctxt) |
XMLPUBFUN int XMLCALL | xmlPedanticParserDefault (int val) |
XMLPUBFUN int XMLCALL | xmlLineNumbersDefault (int val) |
XMLPUBFUN int XMLCALL | xmlParseDocument (xmlParserCtxtPtr ctxt) |
XMLPUBFUN int XMLCALL | xmlParseExtParsedEnt (xmlParserCtxtPtr ctxt) |
XMLPUBFUN xmlParserErrors XMLCALL | xmlParseInNodeContext (xmlNodePtr node, const char *data, int datalen, int options, xmlNodePtr *lst) |
XMLPUBFUN int XMLCALL | xmlParseCtxtExternalEntity (xmlParserCtxtPtr ctx, const xmlChar *URL, const xmlChar *ID, xmlNodePtr *lst) |
XMLPUBFUN xmlParserCtxtPtr XMLCALL | xmlNewParserCtxt (void) |
XMLPUBFUN int XMLCALL | xmlInitParserCtxt (xmlParserCtxtPtr ctxt) |
XMLPUBFUN void XMLCALL | xmlClearParserCtxt (xmlParserCtxtPtr ctxt) |
XMLPUBFUN void XMLCALL | xmlFreeParserCtxt (xmlParserCtxtPtr ctxt) |
XMLPUBFUN xmlParserCtxtPtr XMLCALL | xmlCreateDocParserCtxt (const xmlChar *cur) |
XMLPUBFUN xmlParserCtxtPtr XMLCALL | xmlCreateIOParserCtxt (xmlSAXHandlerPtr sax, void *user_data, xmlInputReadCallback ioread, xmlInputCloseCallback ioclose, void *ioctx, xmlCharEncoding enc) |
XMLPUBFUN xmlParserInputPtr XMLCALL | xmlNewIOInputStream (xmlParserCtxtPtr ctxt, xmlParserInputBufferPtr input, xmlCharEncoding enc) |
XMLPUBFUN const xmlParserNodeInfo *XMLCALL | xmlParserFindNodeInfo (const xmlParserCtxtPtr ctxt, const xmlNodePtr node) |
XMLPUBFUN void XMLCALL | xmlInitNodeInfoSeq (xmlParserNodeInfoSeqPtr seq) |
XMLPUBFUN void XMLCALL | xmlClearNodeInfoSeq (xmlParserNodeInfoSeqPtr seq) |
XMLPUBFUN unsigned long XMLCALL | xmlParserFindNodeInfoIndex (const xmlParserNodeInfoSeqPtr seq, const xmlNodePtr node) |
XMLPUBFUN void XMLCALL | xmlParserAddNodeInfo (xmlParserCtxtPtr ctxt, const xmlParserNodeInfoPtr info) |
XMLPUBFUN void XMLCALL | xmlSetExternalEntityLoader (xmlExternalEntityLoader f) |
XMLPUBFUN xmlExternalEntityLoader XMLCALL | xmlGetExternalEntityLoader (void) |
XMLPUBFUN xmlParserInputPtr XMLCALL | xmlLoadExternalEntity (const char *URL, const char *ID, xmlParserCtxtPtr ctxt) |
XMLPUBFUN long XMLCALL | xmlByteConsumed (xmlParserCtxtPtr ctxt) |
XMLPUBFUN void XMLCALL | xmlCtxtReset (xmlParserCtxtPtr ctxt) |
XMLPUBFUN int XMLCALL | xmlCtxtResetPush (xmlParserCtxtPtr ctxt, const char *chunk, int size, const char *filename, const char *encoding) |
XMLPUBFUN int XMLCALL | xmlCtxtUseOptions (xmlParserCtxtPtr ctxt, int options) |
XMLPUBFUN xmlDocPtr XMLCALL | xmlReadDoc (const xmlChar *cur, const char *URL, const char *encoding, int options) |
XMLPUBFUN xmlDocPtr XMLCALL | xmlReadFile (const char *URL, const char *encoding, int options) |
XMLPUBFUN xmlDocPtr XMLCALL | xmlReadMemory (const char *buffer, int size, const char *URL, const char *encoding, int options) |
XMLPUBFUN xmlDocPtr XMLCALL | xmlReadFd (int fd, const char *URL, const char *encoding, int options) |
XMLPUBFUN xmlDocPtr XMLCALL | xmlReadIO (xmlInputReadCallback ioread, xmlInputCloseCallback ioclose, void *ioctx, const char *URL, const char *encoding, int options) |
XMLPUBFUN xmlDocPtr XMLCALL | xmlCtxtReadDoc (xmlParserCtxtPtr ctxt, const xmlChar *cur, const char *URL, const char *encoding, int options) |
XMLPUBFUN xmlDocPtr XMLCALL | xmlCtxtReadFile (xmlParserCtxtPtr ctxt, const char *filename, const char *encoding, int options) |
XMLPUBFUN xmlDocPtr XMLCALL | xmlCtxtReadMemory (xmlParserCtxtPtr ctxt, const char *buffer, int size, const char *URL, const char *encoding, int options) |
XMLPUBFUN xmlDocPtr XMLCALL | xmlCtxtReadFd (xmlParserCtxtPtr ctxt, int fd, const char *URL, const char *encoding, int options) |
XMLPUBFUN xmlDocPtr XMLCALL | xmlCtxtReadIO (xmlParserCtxtPtr ctxt, xmlInputReadCallback ioread, xmlInputCloseCallback ioclose, void *ioctx, const char *URL, const char *encoding, int options) |
XMLPUBFUN int XMLCALL | xmlHasFeature (xmlFeature feature) |
#define XML_COMPLETE_ATTRS 4 |
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.
#define XML_DEFAULT_VERSION "1.0" |
XML_DEFAULT_VERSION:
The default version of XML used: 1.0
#define XML_DETECT_IDS 2 |
XML_DETECT_IDS:
Bit in the loadsubset context field to tell to do ID/REFs lookups. Use it to initialize xmlLoadExtDtdDefaultValue.
#define XML_SAX2_MAGIC 0xDEEDBEAF |
XML_SAX2_MAGIC:
Special constant found in SAX2 blocks initialized fields
#define XML_SKIP_IDS 8 |
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 void(* attributeDeclSAXFunc)(void *ctx, const xmlChar *elem, const xmlChar *fullname, int type, int def, const xmlChar *defaultValue, xmlEnumerationPtr tree) |
typedef void(* attributeSAXFunc)(void *ctx, const xmlChar *name, const xmlChar *value) |
typedef void(* cdataBlockSAXFunc)(void *ctx, const xmlChar *value, int len) |
cdataBlockSAXFunc: : the user data (XML parser context) : The pcdata content : the block length
Called when a pcdata block has been parsed.
typedef void(* charactersSAXFunc)(void *ctx, const xmlChar *ch, int len) |
charactersSAXFunc: : the user data (XML parser context) : a xmlChar string : the number of xmlChar
Receiving some chars from the parser.
typedef void(* commentSAXFunc)(void *ctx, const xmlChar *value) |
commentSAXFunc: : the user data (XML parser context) : the comment content
A comment has been parsed.
typedef void(* elementDeclSAXFunc)(void *ctx, const xmlChar *name, int type, xmlElementContentPtr content) |
typedef void(* endDocumentSAXFunc)(void *ctx) |
endDocumentSAXFunc: : the user data (XML parser context)
Called when the document end has been detected.
typedef void(* endElementNsSAX2Func)(void *ctx, const xmlChar *localname, const xmlChar *prefix, const xmlChar *URI) |
endElementNsSAX2Func: : the user data (XML parser context) : the local name of the element : the element namespace prefix if available : the element namespace name if available
SAX2 callback when an element end has been detected by the parser. It provides the namespace informations for the element.
typedef void(* endElementSAXFunc)(void *ctx, const xmlChar *name) |
typedef void(* entityDeclSAXFunc)(void *ctx, const xmlChar *name, int type, const xmlChar *publicId, const xmlChar *systemId, xmlChar *content) |
typedef void(* externalSubsetSAXFunc)(void *ctx, const xmlChar *name, const xmlChar *ExternalID, const xmlChar *SystemID) |
typedef xmlEntityPtr(* getEntitySAXFunc)(void *ctx, const xmlChar *name) |
typedef xmlEntityPtr(* getParameterEntitySAXFunc)(void *ctx, const xmlChar *name) |
typedef int(* hasExternalSubsetSAXFunc)(void *ctx) |
hasExternalSubsetSAXFunc: : the user data (XML parser context)
Does this document has an external subset?
Returns 1 if true
typedef int(* hasInternalSubsetSAXFunc)(void *ctx) |
hasInternalSubsetSAXFunc: : the user data (XML parser context)
Does this document has an internal subset.
Returns 1 if true
typedef void(* ignorableWhitespaceSAXFunc)(void *ctx, const xmlChar *ch, int len) |
ignorableWhitespaceSAXFunc: : the user data (XML parser context) : a xmlChar string : the number of xmlChar
Receiving some ignorable whitespaces from the parser. UNUSED: by default the DOM building will use characters.
typedef void(* internalSubsetSAXFunc)(void *ctx, const xmlChar *name, const xmlChar *ExternalID, const xmlChar *SystemID) |
typedef int(* isStandaloneSAXFunc)(void *ctx) |
isStandaloneSAXFunc: : the user data (XML parser context)
Is this document tagged standalone?
Returns 1 if true
typedef const char LIBXML_ATTR_FORMAT(2, 3) |
typedef const char * msg |
typedef void(* notationDeclSAXFunc)(void *ctx, const xmlChar *name, const xmlChar *publicId, const xmlChar *systemId) |
typedef void(* processingInstructionSAXFunc)(void *ctx, const xmlChar *target, const xmlChar *data) |
processingInstructionSAXFunc: : the user data (XML parser context) : the target name : the PI data's
A processing instruction has been parsed.
typedef void(* referenceSAXFunc)(void *ctx, const xmlChar *name) |
typedef xmlParserInputPtr(* resolveEntitySAXFunc)(void *ctx, const xmlChar *publicId, const xmlChar *systemId) |
xmlSAXHandler:
A SAX handler is bunch of callbacks called by the parser when processing of the input generate data or structure informations. resolveEntitySAXFunc: : the user data (XML parser context) : The public ID of the entity : The system ID of the entity
Callback: The entity loader, to control the loading of external entities, the application can either:
Returns the xmlParserInputPtr if inlined or NULL for DOM behaviour.
typedef void(* setDocumentLocatorSAXFunc)(void *ctx, xmlSAXLocatorPtr loc) |
setDocumentLocatorSAXFunc: : the user data (XML parser context) : A SAX Locator
Receive the document locator at startup, actually xmlDefaultSAXLocator. Everything is available on the context, so this is useless in our case.
typedef void(* startDocumentSAXFunc)(void *ctx) |
startDocumentSAXFunc: : the user data (XML parser context)
Called when the document start being processed.
typedef 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) |
startElementNsSAX2Func: : the user data (XML parser context) : the local name of the element : the element namespace prefix if available : the element namespace name if available : number of namespace definitions on that node : pointer to the array of prefix/URI pairs namespace definitions : the number of attributes on that node : the number of defaulted attributes. The defaulted ones are at the end of the array : pointer to the array of (localname/prefix/URI/value/end) attribute values.
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(* startElementSAXFunc)(void *ctx, const xmlChar *name, const xmlChar **atts) |
typedef void(* unparsedEntityDeclSAXFunc)(void *ctx, const xmlChar *name, const xmlChar *publicId, const xmlChar *systemId, const xmlChar *notationName) |
typedef xmlParserInputPtr(* xmlExternalEntityLoader)(const char *URL, const char *ID, xmlParserCtxtPtr context) |
xmlExternalEntityLoader: : The System ID of the resource requested : The Public ID of the resource requested : the XML parser context
External entity loaders types.
Returns the entity input parser.
typedef void(* xmlParserInputDeallocate)(xmlChar *str) |
xmlParserInput:
An xmlParserInput is an input flow for the XML processor. Each entity parsed is associated an xmlParserInput (except the few predefined ones). This is the case both for internal entities
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 struct _xmlSAXHandlerV1 xmlSAXHandlerV1 |
typedef xmlSAXHandlerV1* xmlSAXHandlerV1Ptr |
enum xmlFeature |
xmlFeature:
Used to examine the existance of features that can be enabled or disabled at compile-time. They used to be called XML_FEATURE_xxx but this clashed with Expat
enum xmlParserInputState |
xmlParserInputState:
The parser is now working also as a state based parser. The recursive one use the state info for entities processing.
enum xmlParserMode |
enum xmlParserOption |
xmlParserOption:
This is the set of XML parser options that can be passed down to the xmlReadDoc() and similar calls.
typedef void | ( | XMLCDECL * | xmlValidityWarningFunc | ) |
warningSAXFunc: : an XML parser context : the message to display/transmit @...: extra parameters for the message display
Display and format a warning messages, callback.
errorSAXFunc: : an XML parser context : the message to display/transmit @...: extra parameters for the message display
Display and format an error messages, callback.
fatalErrorSAXFunc: : an XML parser context : the message to display/transmit @...: extra parameters for the message display
Display and format fatal error messages, callback. Note: so far fatalError() SAX callbacks are not used, error() get all the callbacks for errors.
xmlValidityWarningFunc: : usually an xmlValidCtxtPtr to a validity error context, but comes from ctxt->userData (which normally contains such a pointer); ctxt->userData can be changed by the user. : the string to format *printf like vararg @...: remaining arguments to the format
Callback called when a validity warning is found. This is a message oriented function similar to an *printf function.
XMLPUBFUN long XMLCALL xmlByteConsumed | ( | xmlParserCtxtPtr | ctxt | ) |
xmlByteConsumed: : an XML parser context
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.
XMLPUBFUN void XMLCALL xmlCleanupParser | ( | void | ) |
xmlCleanupParser:
This function name is somewhat misleading. It does not clean up parser state, it cleans up memory allocated by the library itself. It is a cleanup function for the XML library. It tries to reclaim all related global memory allocated for the library processing. It doesn't deallocate any document related memory. One should call xmlCleanupParser() only when the process has finished using the library and all XML/HTML documents built with it. See also xmlInitParser() which has the opposite function of preparing the library for operations.
WARNING: if your application is multithreaded or has plugin support calling this may crash the application if another thread or a plugin is still using libxml2. It's sometimes very hard to guess if libxml2 is in use in the application, some libraries or plugins may use it without notice. In case of doubt abstain from calling this function or do it just before calling exit() to avoid leak reports from valgrind !
XMLPUBFUN void XMLCALL xmlClearNodeInfoSeq | ( | xmlParserNodeInfoSeqPtr | seq | ) |
xmlClearNodeInfoSeq: : a node info sequence pointer
-- Clear (release memory and reinitialize) node info sequence
XMLPUBFUN void XMLCALL xmlClearParserCtxt | ( | xmlParserCtxtPtr | ctxt | ) |
xmlClearParserCtxt: : an XML parser context
Clear (release owned resources) and reinitialize a parser context
XMLPUBFUN xmlParserCtxtPtr XMLCALL xmlCreateDocParserCtxt | ( | const xmlChar * | cur | ) |
xmlCreateDocParserCtxt: : a pointer to an array of xmlChar
Creates a parser context for an XML in-memory document.
Returns the new parser context or NULL
XMLPUBFUN xmlParserCtxtPtr XMLCALL xmlCreateIOParserCtxt | ( | xmlSAXHandlerPtr | sax, |
void * | user_data, | ||
xmlInputReadCallback | ioread, | ||
xmlInputCloseCallback | ioclose, | ||
void * | ioctx, | ||
xmlCharEncoding | enc | ||
) |
xmlCreateIOParserCtxt: : a SAX handler : The user data returned on SAX callbacks : an I/O read function : an I/O close function : an I/O handler : the charset encoding if known
Create a parser context for using the XML parser with an existing I/O stream
Returns the new parser context or NULL
XMLPUBFUN xmlDocPtr XMLCALL xmlCtxtReadDoc | ( | xmlParserCtxtPtr | ctxt, |
const xmlChar * | cur, | ||
const char * | URL, | ||
const char * | encoding, | ||
int | options | ||
) |
xmlCtxtReadDoc: : an XML parser context : a pointer to a zero terminated string : the base URL to use for the document : the document encoding, or NULL : a combination of xmlParserOption
parse an XML in-memory document and build a tree. This reuses the existing parser context
Returns the resulting document tree
XMLPUBFUN xmlDocPtr XMLCALL xmlCtxtReadFd | ( | xmlParserCtxtPtr | ctxt, |
int | fd, | ||
const char * | URL, | ||
const char * | encoding, | ||
int | options | ||
) |
xmlCtxtReadFd: : an XML parser context : an open file descriptor : the base URL to use for the document : the document encoding, or NULL : a combination of xmlParserOption
parse an XML from a file descriptor and build a tree. This reuses the existing parser context NOTE that the file descriptor will not be closed when the reader is closed or reset.
Returns the resulting document tree
XMLPUBFUN xmlDocPtr XMLCALL xmlCtxtReadFile | ( | xmlParserCtxtPtr | ctxt, |
const char * | filename, | ||
const char * | encoding, | ||
int | options | ||
) |
xmlCtxtReadFile: : an XML parser context : a file or URL : the document encoding, or NULL : a combination of xmlParserOption
parse an XML file from the filesystem or the network. This reuses the existing parser context
Returns the resulting document tree
XMLPUBFUN xmlDocPtr XMLCALL xmlCtxtReadIO | ( | xmlParserCtxtPtr | ctxt, |
xmlInputReadCallback | ioread, | ||
xmlInputCloseCallback | ioclose, | ||
void * | ioctx, | ||
const char * | URL, | ||
const char * | encoding, | ||
int | options | ||
) |
xmlCtxtReadIO: : an XML parser context : an I/O read function : an I/O close function : an I/O handler : the base URL to use for the document : the document encoding, or NULL : a combination of xmlParserOption
parse an XML document from I/O functions and source and build a tree. This reuses the existing parser context
Returns the resulting document tree
XMLPUBFUN xmlDocPtr XMLCALL xmlCtxtReadMemory | ( | xmlParserCtxtPtr | ctxt, |
const char * | buffer, | ||
int | size, | ||
const char * | URL, | ||
const char * | encoding, | ||
int | options | ||
) |
xmlCtxtReadMemory: : an XML parser context : a pointer to a char array : the size of the array : the base URL to use for the document : the document encoding, or NULL : a combination of xmlParserOption
parse an XML in-memory document and build a tree. This reuses the existing parser context
Returns the resulting document tree
XMLPUBFUN void XMLCALL xmlCtxtReset | ( | xmlParserCtxtPtr | ctxt | ) |
xmlCtxtReset: : an XML parser context
Reset a parser context
XMLPUBFUN int XMLCALL xmlCtxtResetPush | ( | xmlParserCtxtPtr | ctxt, |
const char * | chunk, | ||
int | size, | ||
const char * | filename, | ||
const char * | encoding | ||
) |
xmlCtxtResetPush: : an XML parser context : a pointer to an array of chars : number of chars in the array : an optional file name or URI : the document encoding, or NULL
Reset a push parser context
Returns 0 in case of success and 1 in case of error
XMLPUBFUN int XMLCALL xmlCtxtUseOptions | ( | xmlParserCtxtPtr | ctxt, |
int | options | ||
) |
xmlCtxtUseOptions: : an XML parser context : a combination of xmlParserOption
Applies the options to the parser context
Returns 0 in case of success, the set of unknown or unimplemented options in case of error.
XMLPUBFUN void XMLCALL xmlFreeParserCtxt | ( | xmlParserCtxtPtr | ctxt | ) |
xmlFreeParserCtxt: : an XML parser context
Free all the memory used by a parser context. However the parsed document in ctxt->myDoc is not freed.
XMLPUBFUN xmlExternalEntityLoader XMLCALL xmlGetExternalEntityLoader | ( | void | ) |
XMLPUBFUN int XMLCALL xmlHasFeature | ( | xmlFeature | feature | ) |
xmlHasFeature: : the feature to be examined
Examines if the library has been compiled with a given feature.
Returns a non-zero value if the feature exist, otherwise zero. Returns zero (0) if the feature does not exist or an unknown unknown feature is requested, non-zero otherwise.
XMLPUBFUN void XMLCALL xmlInitNodeInfoSeq | ( | xmlParserNodeInfoSeqPtr | seq | ) |
xmlInitNodeInfoSeq: : a node info sequence pointer
-- Initialize (set to initial state) node info sequence
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.
XMLPUBFUN int XMLCALL xmlInitParserCtxt | ( | xmlParserCtxtPtr | ctxt | ) |
xmlInitParserCtxt: : an XML parser context
Initialize a parser context
Returns 0 in case of success and -1 in case of error
xmlKeepBlanksDefault: : int 0 or 1
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.
xmlLineNumbersDefault: : int 0 or 1
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.
Returns the last value for 0 for no substitution, 1 for substitution.
XMLPUBFUN xmlParserInputPtr XMLCALL xmlLoadExternalEntity | ( | const char * | URL, |
const char * | ID, | ||
xmlParserCtxtPtr | ctxt | ||
) |
XMLPUBFUN xmlParserInputPtr XMLCALL xmlNewIOInputStream | ( | xmlParserCtxtPtr | ctxt, |
xmlParserInputBufferPtr | input, | ||
xmlCharEncoding | enc | ||
) |
xmlNewIOInputStream: : an XML parser context : an I/O Input : the charset encoding if known
Create a new input stream structure encapsulating the into a stream suitable for the parser.
Returns the new input stream or NULL
XMLPUBFUN xmlParserCtxtPtr XMLCALL xmlNewParserCtxt | ( | void | ) |
xmlNewParserCtxt:
Allocate and initialize a new parser context.
Returns the xmlParserCtxtPtr or NULL
XMLPUBFUN int XMLCALL xmlParseCtxtExternalEntity | ( | xmlParserCtxtPtr | ctx, |
const xmlChar * | URL, | ||
const xmlChar * | ID, | ||
xmlNodePtr * | lst | ||
) |
xmlParseCtxtExternalEntity: : the existing parsing context : the URL for the entity to load : the System ID for the entity to load : the return value for the set of parsed nodes
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
XMLPUBFUN int XMLCALL xmlParseDocument | ( | xmlParserCtxtPtr | ctxt | ) |
xmlParseDocument: : an XML parser context
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.
XMLPUBFUN int XMLCALL xmlParseExtParsedEnt | ( | xmlParserCtxtPtr | ctxt | ) |
xmlParseExtParsedEnt: : an XML parser context
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.
XMLPUBFUN xmlParserErrors XMLCALL xmlParseInNodeContext | ( | xmlNodePtr | node, |
const char * | data, | ||
int | datalen, | ||
int | options, | ||
xmlNodePtr * | lst | ||
) |
xmlParseInNodeContext: : the context node : the input string : the input string length in bytes : a combination of xmlParserOption : the return value for the set of parsed nodes
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
XMLPUBFUN void XMLCALL xmlParserAddNodeInfo | ( | xmlParserCtxtPtr | ctxt, |
const xmlParserNodeInfoPtr | info | ||
) |
xmlParserAddNodeInfo: : an XML parser context : a node info sequence pointer
Insert node info record into the sorted sequence
XMLPUBFUN const xmlParserNodeInfo* XMLCALL xmlParserFindNodeInfo | ( | const xmlParserCtxtPtr | ctx, |
const xmlNodePtr | node | ||
) |
xmlParserFindNodeInfo: : an XML parser context : an XML node within the tree
Find the parser node info struct for a given node
Returns an xmlParserNodeInfo block pointer or NULL
XMLPUBFUN unsigned long XMLCALL xmlParserFindNodeInfoIndex | ( | const xmlParserNodeInfoSeqPtr | seq, |
const xmlNodePtr | node | ||
) |
xmlParserFindNodeInfoIndex: : a node info sequence pointer : an XML node pointer
xmlParserFindNodeInfoIndex : Find the index that the info record for the given node is or should be at in a sorted sequence
Returns a long indicating the position of the record
XMLPUBFUN int XMLCALL xmlParserInputGrow | ( | xmlParserInputPtr | in, |
int | len | ||
) |
xmlParserInputGrow: : an XML parser input : an indicative size for the lookahead
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
XMLPUBFUN int XMLCALL xmlParserInputRead | ( | xmlParserInputPtr | in, |
int | len | ||
) |
xmlParserInputRead: : an XML parser input : an indicative size for the lookahead
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
xmlPedanticParserDefault: : int 0 or 1
Set and return the previous value for enabling pedantic warnings.
Returns the last value for 0 for no substitution, 1 for substitution.
XMLPUBFUN xmlDocPtr XMLCALL xmlReadDoc | ( | const xmlChar * | cur, |
const char * | URL, | ||
const char * | encoding, | ||
int | options | ||
) |
xmlReadDoc: : a pointer to a zero terminated string : the base URL to use for the document : the document encoding, or NULL : a combination of xmlParserOption
parse an XML in-memory document and build a tree.
Returns the resulting document tree
XMLPUBFUN xmlDocPtr XMLCALL xmlReadFd | ( | int | fd, |
const char * | URL, | ||
const char * | encoding, | ||
int | options | ||
) |
xmlReadFd: : an open file descriptor : the base URL to use for the document : the document encoding, or NULL : a combination of xmlParserOption
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
XMLPUBFUN xmlDocPtr XMLCALL xmlReadFile | ( | const char * | filename, |
const char * | encoding, | ||
int | options | ||
) |
xmlReadFile: : a file or URL : the document encoding, or NULL : a combination of xmlParserOption
parse an XML file from the filesystem or the network.
Returns the resulting document tree
XMLPUBFUN xmlDocPtr XMLCALL xmlReadIO | ( | xmlInputReadCallback | ioread, |
xmlInputCloseCallback | ioclose, | ||
void * | ioctx, | ||
const char * | URL, | ||
const char * | encoding, | ||
int | options | ||
) |
xmlReadIO: : an I/O read function : an I/O close function : an I/O handler : the base URL to use for the document : the document encoding, or NULL : a combination of xmlParserOption
parse an XML document from I/O functions and source and build a tree.
Returns the resulting document tree
XMLPUBFUN xmlDocPtr XMLCALL xmlReadMemory | ( | const char * | buffer, |
int | size, | ||
const char * | URL, | ||
const char * | encoding, | ||
int | options | ||
) |
xmlReadMemory: : a pointer to a char array : the size of the array : the base URL to use for the document : the document encoding, or NULL : a combination of xmlParserOption
parse an XML in-memory document and build a tree.
Returns the resulting document tree
XMLPUBFUN void XMLCALL xmlSetExternalEntityLoader | ( | xmlExternalEntityLoader | f | ) |
XMLPUBFUN void XMLCALL xmlStopParser | ( | xmlParserCtxtPtr | ctxt | ) |
xmlStopParser: : an XML parser context
Blocks further parser processing
xmlSubstituteEntitiesDefault: : int 0 or 1
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.