1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/epoc32/include/stdapis/libxml2/libxml2_parser.h Wed Mar 31 12:33:34 2010 +0100
1.3 @@ -0,0 +1,1231 @@
1.4 +/*
1.5 + * Summary: the core parser module
1.6 + * Description: Interfaces, constants and types related to the XML parser
1.7 + *
1.8 + * Copy: See Copyright for the status of this software.
1.9 + *
1.10 + * Author: Daniel Veillard
1.11 + * Portion Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved.
1.12 + */
1.13 +
1.14 +/** @file
1.15 +@publishedAll
1.16 +@released
1.17 +*/
1.18 +
1.19 +#ifndef XML_PARSER_H
1.20 +#define XML_PARSER_H
1.21 +
1.22 +#include <stdapis/libxml2/libxml2_dict.h>
1.23 +#include <stdapis/libxml2/libxml2_hash.h>
1.24 +#include <stdapis/libxml2/libxml2_valid.h>
1.25 +#include <stdapis/libxml2/libxml2_entities.h>
1.26 +#include <stdapis/libxml2/libxml2_encoding.h>
1.27 +
1.28 +//typedef struct _xmlParserInput xmlParserInput;
1.29 +//typedef xmlParserInput *xmlParserInputPtr;
1.30 +
1.31 +#include <stdapis/libxml2/libxml2_xmlio.h>
1.32 +
1.33 +#ifdef __cplusplus
1.34 +extern "C" {
1.35 +#endif
1.36 +
1.37 +/**
1.38 + * XML_DEFAULT_VERSION:
1.39 + *
1.40 + * The default version of XML used: 1.0
1.41 + */
1.42 +#define XML_DEFAULT_VERSION "1.0"
1.43 +
1.44 +/**
1.45 + * xmlParserInput:
1.46 + *
1.47 + * An xmlParserInput is an input flow for the XML processor.
1.48 + * Each entity parsed is associated an xmlParserInput (except the
1.49 + * few predefined ones). This is the case both for internal entities
1.50 + * - in which case the flow is already completely in memory - or
1.51 + * external entities - in which case we use the buf structure for
1.52 + * progressive reading and I18N conversions to the internal UTF-8 format.
1.53 + */
1.54 +
1.55 +/**
1.56 + * xmlParserInputDeallocate:
1.57 + * @param str the string to deallocate
1.58 + *
1.59 + * Callback for freeing some parser input allocations.
1.60 + */
1.61 +typedef void (* xmlParserInputDeallocate)(xmlChar *str);
1.62 +
1.63 +struct _xmlParserInput {
1.64 + /* Input buffer */
1.65 + xmlParserInputBufferPtr buf; /* UTF-8 encoded buffer */
1.66 +
1.67 + const char *filename; /* The file analyzed, if any */
1.68 + const char *directory; /* the directory/base of the file */
1.69 + const xmlChar *base; /* Base of the array to parse */
1.70 + const xmlChar *cur; /* Current char being parsed */
1.71 + const xmlChar *end; /* end of the array to parse */
1.72 + int length; /* length if known */
1.73 + int line; /* Current line */
1.74 + int col; /* Current column */
1.75 + /*
1.76 + * NOTE: consumed is only tested for equality in the parser code,
1.77 + * so even if there is an overflow this should not give troubles
1.78 + * for parsing very large instances.
1.79 + */
1.80 + unsigned long consumed; /* How many xmlChars already consumed */
1.81 + xmlParserInputDeallocate free; /* function to deallocate the base */
1.82 + const xmlChar *encoding; /* the encoding string for entity */
1.83 + const xmlChar *version; /* the version string for entity */
1.84 + int standalone; /* Was that entity marked standalone */
1.85 + int id; /* an unique identifier for the entity */
1.86 +};
1.87 +
1.88 +/**
1.89 + * xmlParserNodeInfo:
1.90 + *
1.91 + * The parser can be asked to collect Node informations, i.e. at what
1.92 + * place in the file they were detected.
1.93 + * NOTE: This is off by default and not very well tested.
1.94 + */
1.95 +typedef struct _xmlParserNodeInfo xmlParserNodeInfo;
1.96 +typedef xmlParserNodeInfo *xmlParserNodeInfoPtr;
1.97 +
1.98 +struct _xmlParserNodeInfo {
1.99 + const struct _xmlNode* node;
1.100 + /* Position & line # that text that created the node begins & ends on */
1.101 + unsigned long begin_pos;
1.102 + unsigned long begin_line;
1.103 + unsigned long end_pos;
1.104 + unsigned long end_line;
1.105 +};
1.106 +
1.107 +typedef struct _xmlParserNodeInfoSeq xmlParserNodeInfoSeq;
1.108 +typedef xmlParserNodeInfoSeq *xmlParserNodeInfoSeqPtr;
1.109 +struct _xmlParserNodeInfoSeq {
1.110 + unsigned long maximum;
1.111 + unsigned long length;
1.112 + xmlParserNodeInfo* buffer;
1.113 +};
1.114 +
1.115 +/**
1.116 + * xmlParserInputState:
1.117 + *
1.118 + * The parser is now working also as a state based parser.
1.119 + * The recursive one use the state info for entities processing.
1.120 + */
1.121 +typedef enum {
1.122 + XML_PARSER_EOF = -1, /* nothing is to be parsed */
1.123 + XML_PARSER_START = 0, /* nothing has been parsed */
1.124 + XML_PARSER_MISC, /* Misc* before int subset */
1.125 + XML_PARSER_PI, /* Within a processing instruction */
1.126 + XML_PARSER_DTD, /* within some DTD content */
1.127 + XML_PARSER_PROLOG, /* Misc* after internal subset */
1.128 + XML_PARSER_COMMENT, /* within a comment */
1.129 + XML_PARSER_START_TAG, /* within a start tag */
1.130 + XML_PARSER_CONTENT, /* within the content */
1.131 + XML_PARSER_CDATA_SECTION, /* within a CDATA section */
1.132 + XML_PARSER_END_TAG, /* within a closing tag */
1.133 + XML_PARSER_ENTITY_DECL, /* within an entity declaration */
1.134 + XML_PARSER_ENTITY_VALUE, /* within an entity value in a decl */
1.135 + XML_PARSER_ATTRIBUTE_VALUE, /* within an attribute value */
1.136 + XML_PARSER_SYSTEM_LITERAL, /* within a SYSTEM value */
1.137 + XML_PARSER_EPILOG, /* the Misc* after the last end tag */
1.138 + XML_PARSER_IGNORE, /* within an IGNORED section */
1.139 + XML_PARSER_PUBLIC_LITERAL /* within a PUBLIC value */
1.140 +} xmlParserInputState;
1.141 +
1.142 +/**
1.143 + * XML_DETECT_IDS:
1.144 + *
1.145 + * Bit in the loadsubset context field to tell to do ID/REFs lookups.
1.146 + * Use it to initialize xmlLoadExtDtdDefaultValue.
1.147 + */
1.148 +#define XML_DETECT_IDS 2
1.149 +
1.150 +/**
1.151 + * XML_COMPLETE_ATTRS:
1.152 + *
1.153 + * Bit in the loadsubset context field to tell to do complete the
1.154 + * elements attributes lists with the ones defaulted from the DTDs.
1.155 + * Use it to initialize xmlLoadExtDtdDefaultValue.
1.156 + */
1.157 +#define XML_COMPLETE_ATTRS 4
1.158 +
1.159 +/**
1.160 + * XML_SKIP_IDS:
1.161 + *
1.162 + * Bit in the loadsubset context field to tell to not do ID/REFs registration.
1.163 + * Used to initialize xmlLoadExtDtdDefaultValue in some special cases.
1.164 + */
1.165 +#define XML_SKIP_IDS 8
1.166 +
1.167 +/**
1.168 + * xmlParserCtxt:
1.169 + *
1.170 + * The parser context.
1.171 + * NOTE This doesn't completely define the parser state, the (current ?)
1.172 + * design of the parser uses recursive function calls since this allow
1.173 + * and easy mapping from the production rules of the specification
1.174 + * to the actual code. The drawback is that the actual function call
1.175 + * also reflect the parser state. However most of the parsing routines
1.176 + * takes as the only argument the parser context pointer, so migrating
1.177 + * to a state based parser for progressive parsing shouldn't be too hard.
1.178 + */
1.179 +struct _xmlParserCtxt {
1.180 + struct _xmlSAXHandler *sax; /* The SAX handler */
1.181 + void* userData; /* For SAX interface only, used by DOM build */
1.182 + xmlDocPtr myDoc; /* the document being built */
1.183 + int wellFormed; /* is the document well formed */
1.184 + int replaceEntities; /* shall we replace entities ? */
1.185 + const xmlChar* encoding; /* the declared encoding, if any */
1.186 + int standalone; /* standalone document */
1.187 + int html; /* an HTML(1)/Docbook(2) document */
1.188 +
1.189 + /* Input stream stack */
1.190 + xmlParserInputPtr input; /* Current input stream */
1.191 + int inputNr; /* Number of current input streams */
1.192 + int inputMax; /* Max number of input streams */
1.193 + xmlParserInputPtr* inputTab; /* stack of inputs */
1.194 +
1.195 +#ifdef LIBXML_ENABLE_GS_CACHING_IN_CTXT
1.196 + // Note: location is chosen trying to get GS pointer into proximity to
1.197 + // the data often referred to (to avoid cache misses)
1.198 + //XMLENGINE: NEW CODE
1.199 + void* cachedGs; /* cached GS pointer */
1.200 +#endif
1.201 + /* Node analysis stack only used for DOM building */
1.202 + xmlNodePtr node; /* Current parsed Node */
1.203 + int nodeNr; /* Depth of the parsing stack */
1.204 + int nodeMax; /* Max depth of the parsing stack */
1.205 + xmlNodePtr* nodeTab; /* array of nodes */
1.206 +
1.207 + int errNo; /* error code */
1.208 +
1.209 + int hasExternalSubset; /* reference and external subset */
1.210 + int hasPErefs; /* the internal subset has PE refs */
1.211 + int external; /* are we parsing an external entity */
1.212 +
1.213 + int valid; /* is the document valid */
1.214 + int validate; /* shall we try to validate ? */
1.215 +
1.216 + xmlParserInputState instate; /* current type of input */
1.217 + int token; /* next char look-ahead */
1.218 +
1.219 + char* directory; /* the data directory */
1.220 +
1.221 + /* Node name stack */
1.222 + const xmlChar* name; /* Current parsed Node */
1.223 + int nameNr; /* Depth of the parsing stack */
1.224 + int nameMax; /* Max depth of the parsing stack */
1.225 + const xmlChar** nameTab; /* array of nodes */
1.226 +
1.227 + long nbChars; /* number of xmlChar processed */
1.228 + long checkIndex; /* used by progressive parsing lookup */
1.229 + int keepBlanks; /* ugly but ... */
1.230 + int disableSAX; /* SAX callbacks are disabled */
1.231 + int inSubset; /* Parsing is in int 1/ext 2 subset */
1.232 + int stackLowThreshold; /* minimum amount of thread's stack left */
1.233 +
1.234 + /* xml:space values */
1.235 + int* space; /* Should the parser preserve spaces */
1.236 + int spaceNr; /* Depth of the parsing stack */
1.237 + int spaceMax; /* Max depth of the parsing stack */
1.238 + int* spaceTab; /* array of space infos */
1.239 +
1.240 + int depth; /* to prevent entity substitution loops */
1.241 + int charset; /* encoding of the in-memory content
1.242 + actually an xmlCharEncoding */
1.243 + int nodelen; /* Those two fields are there to */
1.244 + int nodemem; /* Speed up large node parsing */
1.245 + int pedantic; /* signal pedantic warnings */
1.246 + void* _private; /* For user data, libxml won't touch it */
1.247 +
1.248 + int loadsubset; /* should the external subset be loaded */
1.249 +
1.250 + void* catalogs; /* document's own catalog */
1.251 + int progressive; /* is this a progressive parsing */
1.252 + xmlDictPtr dict; /* dictionnary for the parser */
1.253 + const xmlChar** atts; /* array for the attributes callbacks */
1.254 + int maxatts; /* the size of the array */
1.255 +
1.256 + /*
1.257 + * pre-interned strings
1.258 + */
1.259 + const xmlChar* str_xml;
1.260 + const xmlChar* str_xmlns;
1.261 + const xmlChar* str_xml_ns;
1.262 +
1.263 + /*
1.264 + * Everything below is used only by the new SAX mode
1.265 + */
1.266 + int sax2; /* operating in the new SAX mode */
1.267 + int nsNr; /* the number of inherited namespaces */
1.268 + int nsMax; /* the size of the arrays */
1.269 + const xmlChar** nsTab; /* the array of prefix/namespace name */
1.270 + int* attallocs; /* which attribute were allocated */
1.271 + void** pushTab; /* array of data for push */
1.272 + xmlHashTablePtr attsDefault; /* defaulted attributes if any */
1.273 + xmlHashTablePtr attsSpecial; /* non-CDATA attributes if any */
1.274 + int nsWellFormed; /* is the document XML Nanespace okay */
1.275 + int options; /* Extra options */
1.276 +
1.277 + /*
1.278 + * Those fields are needed only for streaming parsing so far
1.279 + */
1.280 + int dictNames; /* Use dictionary names for the tree */
1.281 + int freeElemsNr; /* number of freed element nodes */
1.282 + xmlNodePtr freeElems; /* List of freed element nodes */
1.283 + int freeAttrsNr; /* number of freed attributes nodes */
1.284 + xmlAttrPtr freeAttrs; /* List of freed attributes nodes */
1.285 +
1.286 + /*
1.287 + * the complete error informations for the last error.
1.288 + */
1.289 + xmlError lastError;
1.290 +
1.291 +// XMLENGINE: BEGIN NEW CODE - lastNsNr attribute in parser context
1.292 + int lastNsNr; /* temporarily contains number of new namespaces in element*/
1.293 +// XMLENGINE: END NEW CODE
1.294 +
1.295 +//== Fields less used in libxml2, so put in the end of the structure (offset is > 255)
1.296 +//
1.297 +// Note: these fields were move from their original place in the structure
1.298 +//
1.299 + const xmlChar* version; /* the XML version string */
1.300 + const xmlChar* intSubName; /* name of subset */
1.301 + xmlChar* extSubURI; /* URI of external subset */
1.302 + xmlChar* extSubSystem; /* SYSTEM ID of external subset */
1.303 + int recovery; /* run in recovery mode */
1.304 + int docdict; /* use strings from dict to build tree */
1.305 + xmlParserInputPtr entity; /* used to check entities boundaries */
1.306 +
1.307 + xmlValidCtxt vctxt; /* The validity context */
1.308 +
1.309 +//== Fields below are likely to stay disabled forever in XML ENGINE
1.310 +
1.311 +#ifdef LIBXML_ENABLE_NODE_LINEINFO
1.312 + int linenumbers; /* set line number in element content */
1.313 +#endif
1.314 +
1.315 +#ifdef XMLENGINE_ENABLE_PARSER_RECORD_INFO
1.316 + int record_info; /* Whether node info should be kept */
1.317 + xmlParserNodeInfoSeq node_seq; /* info about each node parsed */
1.318 +#endif
1.319 +
1.320 +
1.321 +}; // struct _xmlParserCtxt
1.322 +
1.323 +
1.324 +
1.325 +/**
1.326 + * xmlSAXLocator:
1.327 + *
1.328 + * A SAX Locator.
1.329 + */
1.330 +struct _xmlSAXLocator {
1.331 + const xmlChar* (*getPublicId)(void* ctx);
1.332 + const xmlChar* (*getSystemId)(void* ctx);
1.333 + int (*getLineNumber)(void* ctx);
1.334 + int (*getColumnNumber)(void* ctx);
1.335 +};
1.336 +
1.337 +/**
1.338 + * xmlSAXHandler:
1.339 + *
1.340 + * A SAX handler is bunch of callbacks called by the parser when processing
1.341 + * of the input generate data or structure informations.
1.342 + */
1.343 +
1.344 +/**
1.345 + * resolveEntitySAXFunc:
1.346 + * @param ctx the user data (XML parser context)
1.347 + * @param publicId The public ID of the entity
1.348 + * @param systemId The system ID of the entity
1.349 + *
1.350 + * Callback:
1.351 + * The entity loader, to control the loading of external entities,
1.352 + * the application can either:
1.353 + * - override this resolveEntity() callback in the SAX block
1.354 + * - or better use the xmlSetExternalEntityLoader() function to
1.355 + * set up it's own entity resolution routine
1.356 + *
1.357 + * Returns the xmlParserInputPtr if inlined or NULL for DOM behaviour.
1.358 + */
1.359 +typedef xmlParserInputPtr (*resolveEntitySAXFunc) (
1.360 + void* ctx,
1.361 + const xmlChar* publicId,
1.362 + const xmlChar* systemId);
1.363 +/**
1.364 + * internalSubsetSAXFunc:
1.365 + * @param ctx the user data (XML parser context)
1.366 + * @param name the root element name
1.367 + * @param ExternalID the external ID
1.368 + * @param SystemID the SYSTEM ID (e.g. filename or URL)
1.369 + *
1.370 + * Callback on internal subset declaration.
1.371 + */
1.372 +typedef void (*internalSubsetSAXFunc) (
1.373 + void* ctx,
1.374 + const xmlChar* name,
1.375 + const xmlChar* ExternalID,
1.376 + const xmlChar* SystemID);
1.377 +/**
1.378 + * externalSubsetSAXFunc:
1.379 + * @param ctx the user data (XML parser context)
1.380 + * @param name the root element name
1.381 + * @param ExternalID the external ID
1.382 + * @param SystemID the SYSTEM ID (e.g. filename or URL)
1.383 + *
1.384 + * Callback on external subset declaration.
1.385 + */
1.386 +typedef void (*externalSubsetSAXFunc) (
1.387 + void* ctx,
1.388 + const xmlChar* name,
1.389 + const xmlChar* ExternalID,
1.390 + const xmlChar* SystemID);
1.391 +/**
1.392 + * getEntitySAXFunc:
1.393 + * @param ctx the user data (XML parser context)
1.394 + * @param name The entity name
1.395 + *
1.396 + * Get an entity by name.
1.397 + *
1.398 + * Returns the xmlEntityPtr if found.
1.399 + */
1.400 +typedef xmlEntityPtr (*getEntitySAXFunc) (
1.401 + void* ctx,
1.402 + const xmlChar* name);
1.403 +/**
1.404 + * getParameterEntitySAXFunc:
1.405 + * @param ctx the user data (XML parser context)
1.406 + * @param name The entity name
1.407 + *
1.408 + * Get a parameter entity by name.
1.409 + *
1.410 + * Returns the xmlEntityPtr if found.
1.411 + */
1.412 +typedef xmlEntityPtr (*getParameterEntitySAXFunc) (
1.413 + void* ctx,
1.414 + const xmlChar* name);
1.415 +/**
1.416 + * entityDeclSAXFunc:
1.417 + * @param ctx the user data (XML parser context)
1.418 + * @param name the entity name
1.419 + * @param type the entity type
1.420 + * @param publicId The public ID of the entity
1.421 + * @param systemId The system ID of the entity
1.422 + * @param content the entity value (without processing).
1.423 + *
1.424 + * An entity definition has been parsed.
1.425 + */
1.426 +typedef void (*entityDeclSAXFunc) (
1.427 + void* ctx,
1.428 + const xmlChar* name,
1.429 + int type,
1.430 + const xmlChar* publicId,
1.431 + const xmlChar* systemId,
1.432 + xmlChar* content);
1.433 +/**
1.434 + * notationDeclSAXFunc:
1.435 + * @param ctx the user data (XML parser context)
1.436 + * @param name The name of the notation
1.437 + * @param publicId The public ID of the entity
1.438 + * @param systemId The system ID of the entity
1.439 + *
1.440 + * What to do when a notation declaration has been parsed.
1.441 + */
1.442 +typedef void (*notationDeclSAXFunc)(
1.443 + void* ctx,
1.444 + const xmlChar* name,
1.445 + const xmlChar* publicId,
1.446 + const xmlChar* systemId);
1.447 +/**
1.448 + * attributeDeclSAXFunc:
1.449 + * @param ctx the user data (XML parser context)
1.450 + * @param elem the name of the element
1.451 + * @param fullname the attribute name
1.452 + * @param type the attribute type
1.453 + * @param def the type of default value
1.454 + * @param defaultValue the attribute default value
1.455 + * @param tree the tree of enumerated value set
1.456 + *
1.457 + * An attribute definition has been parsed.
1.458 + */
1.459 +typedef void (*attributeDeclSAXFunc)(
1.460 + void* ctx,
1.461 + const xmlChar* elem,
1.462 + const xmlChar* fullname,
1.463 + int type,
1.464 + int def,
1.465 + const xmlChar* defaultValue,
1.466 + xmlEnumerationPtr tree);
1.467 +/**
1.468 + * elementDeclSAXFunc:
1.469 + * @param ctx the user data (XML parser context)
1.470 + * @param name the element name
1.471 + * @param type the element type
1.472 + * @param content the element value tree
1.473 + *
1.474 + * An element definition has been parsed.
1.475 + */
1.476 +typedef void (*elementDeclSAXFunc)(
1.477 + void* ctx,
1.478 + const xmlChar* name,
1.479 + int type,
1.480 + xmlElementContentPtr content);
1.481 +/**
1.482 + * unparsedEntityDeclSAXFunc:
1.483 + * @param ctx the user data (XML parser context)
1.484 + * @param name The name of the entity
1.485 + * @param publicId The public ID of the entity
1.486 + * @param systemId The system ID of the entity
1.487 + * @param notationName the name of the notation
1.488 + *
1.489 + * What to do when an unparsed entity declaration is parsed.
1.490 + */
1.491 +typedef void (*unparsedEntityDeclSAXFunc)(void *ctx,
1.492 + const xmlChar *name,
1.493 + const xmlChar *publicId,
1.494 + const xmlChar *systemId,
1.495 + const xmlChar *notationName);
1.496 +/**
1.497 + * setDocumentLocatorSAXFunc:
1.498 + * @param ctx the user data (XML parser context)
1.499 + * @param loc A SAX Locator
1.500 + *
1.501 + * Receive the document locator at startup, actually xmlDefaultSAXLocator.
1.502 + * Everything is available on the context, so this is useless in our case.
1.503 + */
1.504 +typedef void (*setDocumentLocatorSAXFunc) (void *ctx,
1.505 + xmlSAXLocatorPtr loc);
1.506 +/**
1.507 + * startDocumentSAXFunc:
1.508 + * @param ctx the user data (XML parser context)
1.509 + *
1.510 + * Called when the document start being processed.
1.511 + */
1.512 +typedef void (*startDocumentSAXFunc) (void *ctx);
1.513 +/**
1.514 + * endDocumentSAXFunc:
1.515 + * @param ctx the user data (XML parser context)
1.516 + *
1.517 + * Called when the document end has been detected.
1.518 + */
1.519 +typedef void (*endDocumentSAXFunc) (void *ctx);
1.520 +/**
1.521 + * startElementSAXFunc:
1.522 + * @param ctx the user data (XML parser context)
1.523 + * @param name The element name, including namespace prefix
1.524 + * @param atts An array of name/value attributes pairs, NULL terminated
1.525 + *
1.526 + * Called when an opening tag has been processed.
1.527 + */
1.528 +typedef void (*startElementSAXFunc) (void *ctx,
1.529 + const xmlChar *name,
1.530 + const xmlChar **atts);
1.531 +/**
1.532 + * endElementSAXFunc:
1.533 + * @param ctx the user data (XML parser context)
1.534 + * @param name The element name
1.535 + *
1.536 + * Called when the end of an element has been detected.
1.537 + */
1.538 +typedef void (*endElementSAXFunc) (void *ctx,
1.539 + const xmlChar *name);
1.540 +/**
1.541 + * attributeSAXFunc:
1.542 + * @param ctx the user data (XML parser context)
1.543 + * @param name The attribute name, including namespace prefix
1.544 + * @param value The attribute value
1.545 + *
1.546 + * Handle an attribute that has been read by the parser.
1.547 + * The default handling is to convert the attribute into an
1.548 + * DOM subtree and past it in a new xmlAttr element added to
1.549 + * the element.
1.550 + */
1.551 +typedef void (*attributeSAXFunc) (void *ctx,
1.552 + const xmlChar *name,
1.553 + const xmlChar *value);
1.554 +/**
1.555 + * referenceSAXFunc:
1.556 + * @param ctx the user data (XML parser context)
1.557 + * @param name The entity name
1.558 + *
1.559 + * Called when an entity reference is detected.
1.560 + */
1.561 +typedef void (*referenceSAXFunc) (void *ctx,
1.562 + const xmlChar *name);
1.563 +/**
1.564 + * charactersSAXFunc:
1.565 + * @param ctx the user data (XML parser context)
1.566 + * @param ch a xmlChar string
1.567 + * @param len the number of xmlChar
1.568 + *
1.569 + * Receiving some chars from the parser.
1.570 + */
1.571 +typedef void (*charactersSAXFunc) (void *ctx,
1.572 + const xmlChar *ch,
1.573 + int len);
1.574 +/**
1.575 + * ignorableWhitespaceSAXFunc:
1.576 + * @param ctx the user data (XML parser context)
1.577 + * @param ch a xmlChar string
1.578 + * @param len the number of xmlChar
1.579 + *
1.580 + * Receiving some ignorable whitespaces from the parser.
1.581 + * UNUSED: by default the DOM building will use characters.
1.582 + */
1.583 +typedef void (*ignorableWhitespaceSAXFunc) (void *ctx,
1.584 + const xmlChar *ch,
1.585 + int len);
1.586 +/**
1.587 + * processingInstructionSAXFunc:
1.588 + * @param ctx the user data (XML parser context)
1.589 + * @param target the target name
1.590 + * @param data the PI data's
1.591 + *
1.592 + * A processing instruction has been parsed.
1.593 + */
1.594 +typedef void (*processingInstructionSAXFunc) (void *ctx,
1.595 + const xmlChar *target,
1.596 + const xmlChar *data);
1.597 +/**
1.598 + * commentSAXFunc:
1.599 + * @param ctx the user data (XML parser context)
1.600 + * @param value the comment content
1.601 + *
1.602 + * A comment has been parsed.
1.603 + */
1.604 +typedef void (*commentSAXFunc) (void *ctx,
1.605 + const xmlChar *value);
1.606 +/**
1.607 + * cdataBlockSAXFunc:
1.608 + * @param ctx the user data (XML parser context)
1.609 + * @param value The pcdata content
1.610 + * @param len the block length
1.611 + *
1.612 + * Called when a pcdata block has been parsed.
1.613 + */
1.614 +typedef void (*cdataBlockSAXFunc) (
1.615 + void *ctx,
1.616 + const xmlChar *value,
1.617 + int len);
1.618 +/**
1.619 + * warningSAXFunc:
1.620 + * @param ctx an XML parser context
1.621 + * @param msg the message to display/transmit
1.622 + * @param # extra parameters for the message display
1.623 + *
1.624 + * Display and format a warning messages, callback.
1.625 + */
1.626 +typedef void (*warningSAXFunc) (void *ctx,
1.627 + const char *msg, ...);
1.628 +/**
1.629 + * errorSAXFunc:
1.630 + * @param ctx an XML parser context
1.631 + * @param msg the message to display/transmit
1.632 + * @param # extra parameters for the message display
1.633 + *
1.634 + * Display and format an error messages, callback.
1.635 + */
1.636 +typedef void (*errorSAXFunc) (void *ctx,
1.637 + const char *msg, ...);
1.638 +/**
1.639 + * fatalErrorSAXFunc:
1.640 + * @param ctx an XML parser context
1.641 + * @param msg the message to display/transmit
1.642 + * @param # extra parameters for the message display
1.643 + *
1.644 + * Display and format fatal error messages, callback.
1.645 + * Note: so far fatalError() SAX callbacks are not used, error()
1.646 + * get all the callbacks for errors.
1.647 + */
1.648 +typedef void (*fatalErrorSAXFunc) (void *ctx,
1.649 + const char *msg, ...);
1.650 +/**
1.651 + * isStandaloneSAXFunc:
1.652 + * @param ctx the user data (XML parser context)
1.653 + *
1.654 + * Is this document tagged standalone?
1.655 + *
1.656 + * Returns 1 if true
1.657 + */
1.658 +typedef int (*isStandaloneSAXFunc) (void *ctx);
1.659 +/**
1.660 + * hasInternalSubsetSAXFunc:
1.661 + * @param ctx the user data (XML parser context)
1.662 + *
1.663 + * Does this document has an internal subset.
1.664 + *
1.665 + * Returns 1 if true
1.666 + */
1.667 +typedef int (*hasInternalSubsetSAXFunc) (void *ctx);
1.668 +
1.669 +/**
1.670 + * hasExternalSubsetSAXFunc:
1.671 + * @param ctx the user data (XML parser context)
1.672 + *
1.673 + * Does this document has an external subset?
1.674 + *
1.675 + * Returns 1 if true
1.676 + */
1.677 +typedef int (*hasExternalSubsetSAXFunc) (void *ctx);
1.678 +
1.679 +/************************************************************************
1.680 + * *
1.681 + * The SAX version 2 API extensions *
1.682 + * *
1.683 + ************************************************************************/
1.684 +/**
1.685 + * XML_SAX2_MAGIC:
1.686 + *
1.687 + * Special constant found in SAX2 blocks initialized fields
1.688 + */
1.689 +#define XML_SAX2_MAGIC 0xDEEDBEAF
1.690 +
1.691 +/**
1.692 + * startElementNsSAX2Func:
1.693 + * @param ctx the user data (XML parser context)
1.694 + * @param localname the local name of the element
1.695 + * @param prefix the element namespace prefix if available
1.696 + * @param URI the element namespace name if available
1.697 + * @param nb_namespaces number of namespace definitions on that node
1.698 + * @param namespaces pointer to the array of prefix/URI pairs namespace definitions
1.699 + * @param nb_attributes the number of attributes on that node
1.700 + * @param nb_defaulted the number of defaulted attributes. The defaulted
1.701 + * ones are at the end of the array
1.702 + * @param attributes pointer to the array of (localname/prefix/URI/value/end)
1.703 + * attribute values.
1.704 + *
1.705 + * SAX2 callback when an element start has been detected by the parser.
1.706 + * It provides the namespace informations for the element, as well as
1.707 + * the new namespace declarations on the element.
1.708 + */
1.709 +
1.710 +typedef void (*startElementNsSAX2Func) (void *ctx,
1.711 + const xmlChar *localname,
1.712 + const xmlChar *prefix,
1.713 + const xmlChar *URI,
1.714 + int nb_namespaces,
1.715 + const xmlChar **namespaces,
1.716 + int nb_attributes,
1.717 + int nb_defaulted,
1.718 + const xmlChar **attributes);
1.719 +
1.720 +/**
1.721 + * endElementNsSAX2Func:
1.722 + * @param ctx the user data (XML parser context)
1.723 + * @param localname the local name of the element
1.724 + * @param prefix the element namespace prefix if available
1.725 + * @param URI the element namespace name if available
1.726 + *
1.727 + * SAX2 callback when an element end has been detected by the parser.
1.728 + * It provides the namespace informations for the element.
1.729 + */
1.730 +
1.731 +typedef void (*endElementNsSAX2Func) (void *ctx,
1.732 + const xmlChar *localname,
1.733 + const xmlChar *prefix,
1.734 + const xmlChar *URI);
1.735 +
1.736 +// XE: BEGIN new code
1.737 +/**
1.738 + * startPrefixMappingSAX2Func:
1.739 + * @param ctx the user data (XML parser context)
1.740 + * @param prefix the element namespace prefix if available, NULL if default namespace
1.741 + * @param URI the element namespace name if available
1.742 + *
1.743 + * SAX2 callback when namespace prefix mapping is done.
1.744 + */
1.745 +
1.746 +typedef void (*startPrefixMappingSAX2Func) (void *ctx,
1.747 + const xmlChar *prefix,
1.748 + const xmlChar *URI);
1.749 +
1.750 +
1.751 +/**
1.752 + * endPrefixMappingSAX2Func:
1.753 + * @param ctx the user data (XML parser context)
1.754 + * @param prefix the element namespace prefix if available, NULL otherwise
1.755 + *
1.756 + * SAX2 callback when namespace prefix mapping is getting out of scope.
1.757 + */
1.758 +
1.759 +typedef void (*endPrefixMappingSAX2Func) (void *ctx,
1.760 + const xmlChar *prefix);
1.761 +
1.762 +// XE: END new code
1.763 +
1.764 +struct _xmlSAXHandler {
1.765 + internalSubsetSAXFunc internalSubset;
1.766 + isStandaloneSAXFunc isStandalone;
1.767 + hasInternalSubsetSAXFunc hasInternalSubset;
1.768 + hasExternalSubsetSAXFunc hasExternalSubset;
1.769 + resolveEntitySAXFunc resolveEntity;
1.770 + getEntitySAXFunc getEntity;
1.771 + entityDeclSAXFunc entityDecl;
1.772 + notationDeclSAXFunc notationDecl;
1.773 + attributeDeclSAXFunc attributeDecl;
1.774 + elementDeclSAXFunc elementDecl;
1.775 + unparsedEntityDeclSAXFunc unparsedEntityDecl;
1.776 + setDocumentLocatorSAXFunc setDocumentLocator;
1.777 + startDocumentSAXFunc startDocument;
1.778 + endDocumentSAXFunc endDocument;
1.779 + startElementSAXFunc startElement;
1.780 + endElementSAXFunc endElement;
1.781 + referenceSAXFunc reference;
1.782 + charactersSAXFunc characters;
1.783 + ignorableWhitespaceSAXFunc ignorableWhitespace;
1.784 + processingInstructionSAXFunc processingInstruction;
1.785 + commentSAXFunc comment;
1.786 + warningSAXFunc warning;
1.787 + errorSAXFunc error;
1.788 + fatalErrorSAXFunc fatalError; /* unused - error() get all the errors */
1.789 + getParameterEntitySAXFunc getParameterEntity;
1.790 + cdataBlockSAXFunc cdataBlock;
1.791 + externalSubsetSAXFunc externalSubset;
1.792 + unsigned int initialized;
1.793 + /* The following fields are extensions available only on version 2 */
1.794 + void *_private;
1.795 + startElementNsSAX2Func startElementNs;
1.796 + endElementNsSAX2Func endElementNs;
1.797 + xmlStructuredErrorFunc serror;
1.798 + startPrefixMappingSAX2Func startPrefixMapping;
1.799 + endPrefixMappingSAX2Func endPrefixMapping;
1.800 +};
1.801 +
1.802 +/*
1.803 + * SAX Version 1
1.804 + */
1.805 +typedef struct _xmlSAXHandlerV1 xmlSAXHandlerV1;
1.806 +typedef xmlSAXHandlerV1 *xmlSAXHandlerV1Ptr;
1.807 +struct _xmlSAXHandlerV1 {
1.808 + internalSubsetSAXFunc internalSubset;
1.809 + isStandaloneSAXFunc isStandalone;
1.810 + hasInternalSubsetSAXFunc hasInternalSubset;
1.811 + hasExternalSubsetSAXFunc hasExternalSubset;
1.812 + resolveEntitySAXFunc resolveEntity;
1.813 + getEntitySAXFunc getEntity;
1.814 + entityDeclSAXFunc entityDecl;
1.815 + notationDeclSAXFunc notationDecl;
1.816 + attributeDeclSAXFunc attributeDecl;
1.817 + elementDeclSAXFunc elementDecl;
1.818 + unparsedEntityDeclSAXFunc unparsedEntityDecl;
1.819 + setDocumentLocatorSAXFunc setDocumentLocator;
1.820 + startDocumentSAXFunc startDocument;
1.821 + endDocumentSAXFunc endDocument;
1.822 + startElementSAXFunc startElement;
1.823 + endElementSAXFunc endElement;
1.824 + referenceSAXFunc reference;
1.825 + charactersSAXFunc characters;
1.826 + ignorableWhitespaceSAXFunc ignorableWhitespace;
1.827 + processingInstructionSAXFunc processingInstruction;
1.828 + commentSAXFunc comment;
1.829 + warningSAXFunc warning;
1.830 + errorSAXFunc error;
1.831 + fatalErrorSAXFunc fatalError; /* unused error() get all the errors */
1.832 + getParameterEntitySAXFunc getParameterEntity;
1.833 + cdataBlockSAXFunc cdataBlock;
1.834 + externalSubsetSAXFunc externalSubset;
1.835 + unsigned int initialized;
1.836 +};
1.837 +
1.838 +
1.839 +/**
1.840 + * xmlExternalEntityLoader:
1.841 + * @param URL The System ID of the resource requested
1.842 + * @param ID The Public ID of the resource requested
1.843 + * @param context the XML parser context
1.844 + *
1.845 + * External entity loaders types.
1.846 + *
1.847 + * Returns the entity input parser.
1.848 + */
1.849 +typedef xmlParserInputPtr (*xmlExternalEntityLoader) (const char *URL,
1.850 + const char *ID,
1.851 + xmlParserCtxtPtr context);
1.852 +
1.853 +#ifdef __cplusplus
1.854 +}
1.855 +#endif
1.856 +
1.857 +#ifdef __cplusplus
1.858 +extern "C" {
1.859 +#endif
1.860 +
1.861 +
1.862 +/*
1.863 + * Init/Cleanup
1.864 + */
1.865 +XMLPUBFUN void XMLCALL
1.866 + xmlInitParser (void);
1.867 +XMLPUBFUN void XMLCALL
1.868 + xmlCleanupParser (void);
1.869 +
1.870 +/*
1.871 + * Input functions
1.872 + */
1.873 +XMLPUBFUN int XMLCALL
1.874 + xmlParserInputRead (xmlParserInputPtr in,
1.875 + int len);
1.876 +XMLPUBFUN int XMLCALL
1.877 + xmlParserInputGrow (xmlParserInputPtr in,
1.878 + int len);
1.879 +
1.880 +/*
1.881 + * Basic parsing Interfaces
1.882 + */
1.883 +XMLPUBFUN xmlDocPtr XMLCALL
1.884 + xmlParseDoc (xmlChar *cur);
1.885 +XMLPUBFUN xmlDocPtr XMLCALL
1.886 + xmlParseMemory (const char *buffer,
1.887 + int size);
1.888 +XMLPUBFUN xmlDocPtr XMLCALL
1.889 + xmlParseFile (const char *filename);
1.890 +XMLPUBFUN int XMLCALL
1.891 + xmlSubstituteEntitiesDefault(int val);
1.892 +
1.893 +#ifndef XMLENGINE_EXCLUDE_UNUSED
1.894 +XMLPUBFUN int XMLCALL xmlKeepBlanksDefault (int val);
1.895 +XMLPUBFUN int XMLCALL xmlLineNumbersDefault (int val);
1.896 +#endif /* ifndef XMLENGINE_EXCLUDE_UNUSED */
1.897 +
1.898 +XMLPUBFUN void XMLCALL
1.899 + xmlStopParser (xmlParserCtxtPtr ctxt);
1.900 +XMLPUBFUN int XMLCALL
1.901 + xmlPedanticParserDefault(int val);
1.902 +
1.903 +/*
1.904 + * Recovery mode
1.905 + */
1.906 +XMLPUBFUN xmlDocPtr XMLCALL
1.907 + xmlRecoverDoc (xmlChar *cur);
1.908 +XMLPUBFUN xmlDocPtr XMLCALL
1.909 + xmlRecoverMemory (const char *buffer, int size);
1.910 +XMLPUBFUN xmlDocPtr XMLCALL
1.911 + xmlRecoverFile (const char *filename);
1.912 +
1.913 +/*
1.914 + * Less common routines and SAX interfaces
1.915 + */
1.916 +XMLPUBFUN int XMLCALL
1.917 + xmlParseDocument (xmlParserCtxtPtr ctxt);
1.918 +XMLPUBFUN int XMLCALL
1.919 + xmlParseExtParsedEnt(xmlParserCtxtPtr ctxt);
1.920 +XMLPUBFUN xmlDocPtr XMLCALL
1.921 + xmlSAXParseDoc (xmlSAXHandlerPtr sax,
1.922 + xmlChar *cur,
1.923 + int length,
1.924 + int recovery,
1.925 + int* /* out if !NULL */ errorCode);
1.926 +XMLPUBFUN int XMLCALL
1.927 + xmlSAXUserParseFile (xmlSAXHandlerPtr sax,
1.928 + void *user_data,
1.929 + const char *filename);
1.930 +XMLPUBFUN int XMLCALL
1.931 + xmlSAXUserParseMemory (xmlSAXHandlerPtr sax,
1.932 + void *user_data,
1.933 + const char *buffer,
1.934 + int size);
1.935 +XMLPUBFUN xmlDocPtr XMLCALL
1.936 + xmlSAXParseMemory (xmlSAXHandlerPtr sax,
1.937 + const char *buffer,
1.938 + int size,
1.939 + int recovery);
1.940 +XMLPUBFUN xmlDocPtr XMLCALL
1.941 + xmlSAXParseMemoryWithData (xmlSAXHandlerPtr sax,
1.942 + const char *buffer,
1.943 + int size,
1.944 + int recovery,
1.945 + void *data);
1.946 +XMLPUBFUN xmlDocPtr XMLCALL
1.947 + xmlSAXParseFile (xmlSAXHandlerPtr sax,
1.948 + const char *filename,
1.949 + int recovery);
1.950 +XMLPUBFUN xmlDocPtr XMLCALL
1.951 + xmlSAXParseFileWithData (xmlSAXHandlerPtr sax,
1.952 + const char *filename,
1.953 + int recovery,
1.954 + void *data);
1.955 +XMLPUBFUN xmlDocPtr XMLCALL
1.956 + xmlSAXParseEntity (xmlSAXHandlerPtr sax,
1.957 + const char *filename);
1.958 +XMLPUBFUN xmlDocPtr XMLCALL
1.959 + xmlParseEntity (const char *filename);
1.960 +XMLPUBFUN xmlDtdPtr XMLCALL
1.961 + xmlParseDTD (const xmlChar *ExternalID,
1.962 + const xmlChar *SystemID);
1.963 +XMLPUBFUN xmlDtdPtr XMLCALL
1.964 + xmlSAXParseDTD (xmlSAXHandlerPtr sax,
1.965 + const xmlChar *ExternalID,
1.966 + const xmlChar *SystemID);
1.967 +XMLPUBFUN xmlDtdPtr XMLCALL
1.968 + xmlIOParseDTD (xmlSAXHandlerPtr sax,
1.969 + xmlParserInputBufferPtr input,
1.970 + xmlCharEncoding enc);
1.971 +XMLPUBFUN int XMLCALL
1.972 + xmlParseBalancedChunkMemory(xmlDocPtr doc,
1.973 + xmlSAXHandlerPtr sax,
1.974 + void *user_data,
1.975 + int depth,
1.976 + const xmlChar *string,
1.977 + xmlNodePtr *lst);
1.978 +// XMLENGINE: added from v2.6.21
1.979 +XMLPUBFUN xmlParserErrors XMLCALL
1.980 + xmlParseInNodeContext (xmlNodePtr node,
1.981 + const char *data,
1.982 + int datalen,
1.983 + int options,
1.984 + xmlNodePtr *lst);
1.985 +//--
1.986 +XMLPUBFUN int XMLCALL
1.987 + xmlParseBalancedChunkMemoryRecover(xmlDocPtr doc,
1.988 + xmlSAXHandlerPtr sax,
1.989 + void *user_data,
1.990 + int depth,
1.991 + const xmlChar *string,
1.992 + xmlNodePtr *lst,
1.993 + int recover);
1.994 +XMLPUBFUN int XMLCALL
1.995 + xmlParseExternalEntity (xmlDocPtr doc,
1.996 + xmlSAXHandlerPtr sax,
1.997 + void *user_data,
1.998 + int depth,
1.999 + const xmlChar *URL,
1.1000 + const xmlChar *ID,
1.1001 + xmlNodePtr *lst);
1.1002 +XMLPUBFUN int XMLCALL
1.1003 + xmlParseCtxtExternalEntity(xmlParserCtxtPtr ctx,
1.1004 + const xmlChar *URL,
1.1005 + const xmlChar *ID,
1.1006 + xmlNodePtr *lst);
1.1007 +
1.1008 +/*
1.1009 + * Parser contexts handling.
1.1010 + */
1.1011 +XMLPUBFUN xmlParserCtxtPtr XMLCALL
1.1012 + xmlNewParserCtxt (void);
1.1013 +XMLPUBFUN int XMLCALL
1.1014 + xmlInitParserCtxt (xmlParserCtxtPtr ctxt);
1.1015 +XMLPUBFUN void XMLCALL
1.1016 + xmlClearParserCtxt (xmlParserCtxtPtr ctxt);
1.1017 +XMLPUBFUN void XMLCALL
1.1018 + xmlFreeParserCtxt (xmlParserCtxtPtr ctxt);
1.1019 +XMLPUBFUN void XMLCALL
1.1020 + xmlSetupParserForBuffer (xmlParserCtxtPtr ctxt,
1.1021 + const xmlChar* buffer,
1.1022 + const char *filename);
1.1023 +XMLPUBFUN xmlParserCtxtPtr XMLCALL
1.1024 + xmlCreateDocParserCtxt (const xmlChar *cur, int length);
1.1025 +
1.1026 +/*
1.1027 + * Reading/setting optional parsing features.
1.1028 + */
1.1029 +
1.1030 +XMLPUBFUN int XMLCALL
1.1031 + xmlGetFeaturesList (int *len,
1.1032 + const char **result);
1.1033 +XMLPUBFUN int XMLCALL
1.1034 + xmlGetFeature (xmlParserCtxtPtr ctxt,
1.1035 + const char *name,
1.1036 + void *result);
1.1037 +XMLPUBFUN int XMLCALL
1.1038 + xmlSetFeature (xmlParserCtxtPtr ctxt,
1.1039 + const char *name,
1.1040 + void *value);
1.1041 +
1.1042 +#ifdef LIBXML_PUSH_ENABLED
1.1043 +/*
1.1044 + * Interfaces for the Push mode.
1.1045 + */
1.1046 +XMLPUBFUN xmlParserCtxtPtr XMLCALL
1.1047 + xmlCreatePushParserCtxt(xmlSAXHandlerPtr sax,
1.1048 + void *user_data,
1.1049 + const char *chunk,
1.1050 + int size,
1.1051 + const char *filename);
1.1052 +XMLPUBFUN int XMLCALL
1.1053 + xmlParseChunk (xmlParserCtxtPtr ctxt,
1.1054 + const char *chunk,
1.1055 + int size,
1.1056 + int terminate);
1.1057 +#endif /* LIBXML_PUSH_ENABLED */
1.1058 +
1.1059 +/*
1.1060 + * Special I/O mode.
1.1061 + */
1.1062 +#ifndef XMLENGINE_EXCLUDE_UNUSED
1.1063 +XMLPUBFUN xmlParserCtxtPtr XMLCALL
1.1064 + xmlCreateIOParserCtxt (xmlSAXHandlerPtr sax,
1.1065 + void *user_data,
1.1066 + xmlInputReadCallback ioread,
1.1067 + xmlInputCloseCallback ioclose,
1.1068 + void *ioctx,
1.1069 + xmlCharEncoding enc);
1.1070 +#endif /* ifndef XMLENGINE_EXCLUDE_UNUSED */
1.1071 +
1.1072 +
1.1073 +XMLPUBFUN xmlParserInputPtr XMLCALL
1.1074 + xmlNewIOInputStream (xmlParserCtxtPtr ctxt,
1.1075 + xmlParserInputBufferPtr input,
1.1076 + xmlCharEncoding enc);
1.1077 +
1.1078 +#ifdef XMLENGINE_ENABLE_PARSER_RECORD_INFO
1.1079 +/*
1.1080 + * Node infos.
1.1081 + */
1.1082 +XMLPUBFUN const xmlParserNodeInfo* XMLCALL
1.1083 + xmlParserFindNodeInfo (const xmlParserCtxtPtr ctxt,
1.1084 + const xmlNodePtr node);
1.1085 +XMLPUBFUN void XMLCALL
1.1086 + xmlInitNodeInfoSeq (xmlParserNodeInfoSeqPtr seq);
1.1087 +XMLPUBFUN void XMLCALL
1.1088 + xmlClearNodeInfoSeq (xmlParserNodeInfoSeqPtr seq);
1.1089 +XMLPUBFUN unsigned long XMLCALL
1.1090 + xmlParserFindNodeInfoIndex(const xmlParserNodeInfoSeqPtr seq,
1.1091 + const xmlNodePtr node);
1.1092 +XMLPUBFUN void XMLCALL
1.1093 + xmlParserAddNodeInfo (xmlParserCtxtPtr ctxt,
1.1094 + const xmlParserNodeInfoPtr info);
1.1095 +#endif /* XMLENGINE_ENABLE_PARSER_RECORD_INFO */
1.1096 +
1.1097 +/*
1.1098 + * External entities handling actually implemented in xmlIO.
1.1099 + */
1.1100 +
1.1101 +#ifndef XMLENGINE_EXCLUDE_UNUSED
1.1102 +XMLPUBFUN void XMLCALL xmlSetExternalEntityLoader(xmlExternalEntityLoader f);
1.1103 +XMLPUBFUN xmlExternalEntityLoader XMLCALL xmlGetExternalEntityLoader(void);
1.1104 +#endif /* ifndef XMLENGINE_EXCLUDE_UNUSED */
1.1105 +
1.1106 +XMLPUBFUN xmlParserInputPtr XMLCALL
1.1107 + xmlLoadExternalEntity (const char *URL,
1.1108 + const char *ID,
1.1109 + xmlParserCtxtPtr ctxt);
1.1110 +
1.1111 +/*
1.1112 + * Index lookup, actually implemented in the encoding module
1.1113 + */
1.1114 +
1.1115 +#ifndef XMLENGINE_EXCLUDE_UNUSED
1.1116 +XMLPUBFUN long XMLCALL xmlByteConsumed (xmlParserCtxtPtr ctxt);
1.1117 +#endif /* ifndef XMLENGINE_EXCLUDE_UNUSED */
1.1118 +
1.1119 +/*
1.1120 + * New set of simpler/more flexible APIs
1.1121 + */
1.1122 +/**
1.1123 + * xmlParserOption:
1.1124 + *
1.1125 + * This is the set of XML parser options that can be passed down
1.1126 + * to the xmlReadDoc() and similar calls.
1.1127 + */
1.1128 +typedef enum {
1.1129 + XML_PARSE_RECOVER = 1<<0, /* recover on errors */
1.1130 + XML_PARSE_NOENT = 1<<1, /* substitute entities */
1.1131 + XML_PARSE_DTDLOAD = 1<<2, /* load the external subset */
1.1132 + XML_PARSE_DTDATTR = 1<<3, /* default DTD attributes */
1.1133 + XML_PARSE_DTDVALID = 1<<4, /* validate with the DTD */
1.1134 + XML_PARSE_NOERROR = 1<<5, /* suppress error reports */
1.1135 + XML_PARSE_NOWARNING = 1<<6, /* suppress warning reports */
1.1136 + XML_PARSE_PEDANTIC = 1<<7, /* pedantic error reporting */
1.1137 + XML_PARSE_NOBLANKS = 1<<8, /* remove blank nodes */
1.1138 + XML_PARSE_SAX1 = 1<<9, /* use the SAX1 interface internally */
1.1139 + XML_PARSE_XINCLUDE = 1<<10,/* Implement XInclude substitition */
1.1140 + XML_PARSE_NONET = 1<<11,/* Forbid network access */
1.1141 + XML_PARSE_NODICT = 1<<12,/* Do not reuse the context dictionnary */
1.1142 + XML_PARSE_NSCLEAN = 1<<13,/* remove redundant namespaces declarations */
1.1143 + XML_PARSE_NOCDATA = 1<<14 /* merge CDATA as text nodes */
1.1144 +} xmlParserOption;
1.1145 +
1.1146 +XMLPUBFUN void XMLCALL
1.1147 + xmlCtxtReset (xmlParserCtxtPtr ctxt);
1.1148 +
1.1149 +#ifndef XMLENGINE_EXCLUDE_UNUSED
1.1150 +XMLPUBFUN int XMLCALL
1.1151 + xmlCtxtResetPush (xmlParserCtxtPtr ctxt,
1.1152 + const char *chunk,
1.1153 + int size,
1.1154 + const char *filename,
1.1155 + const char *encoding);
1.1156 +#endif /* ifndef XMLENGINE_EXCLUDE_UNUSED */
1.1157 +
1.1158 +XMLPUBFUN int XMLCALL
1.1159 + xmlCtxtUseOptions (xmlParserCtxtPtr ctxt,
1.1160 + int options);
1.1161 +XMLPUBFUN xmlDocPtr XMLCALL
1.1162 + xmlReadDoc (const xmlChar *cur,
1.1163 + const char *URL,
1.1164 + const char *encoding,
1.1165 + int options);
1.1166 +
1.1167 +#ifndef XMLENGINE_EXCLUDE_UNUSED
1.1168 +XMLPUBFUN xmlDocPtr XMLCALL
1.1169 + xmlReadFile (const char *URL,
1.1170 + const char *encoding,
1.1171 + int options);
1.1172 +#endif
1.1173 +
1.1174 +XMLPUBFUN xmlDocPtr XMLCALL
1.1175 + xmlReadMemory (const char *buffer,
1.1176 + int size,
1.1177 + const char *URL,
1.1178 + const char *encoding,
1.1179 + int options);
1.1180 +XMLPUBFUN xmlDocPtr XMLCALL
1.1181 + xmlReadFd (int fd,
1.1182 + const char *URL,
1.1183 + const char *encoding,
1.1184 + int options);
1.1185 +XMLPUBFUN xmlDocPtr XMLCALL
1.1186 + xmlReadIO (xmlInputReadCallback ioread,
1.1187 + xmlInputCloseCallback ioclose,
1.1188 + void *ioctx,
1.1189 + const char *URL,
1.1190 + const char *encoding,
1.1191 + int options);
1.1192 +
1.1193 +#ifndef XMLENGINE_EXCLUDE_UNUSED
1.1194 +
1.1195 +XMLPUBFUN xmlDocPtr XMLCALL
1.1196 + xmlCtxtReadDoc (xmlParserCtxtPtr ctxt,
1.1197 + const xmlChar *cur,
1.1198 + const char *URL,
1.1199 + const char *encoding,
1.1200 + int options);
1.1201 +XMLPUBFUN xmlDocPtr XMLCALL
1.1202 + xmlCtxtReadFd (xmlParserCtxtPtr ctxt,
1.1203 + int fd,
1.1204 + const char *URL,
1.1205 + const char *encoding,
1.1206 + int options);
1.1207 +XMLPUBFUN xmlDocPtr XMLCALL
1.1208 + xmlCtxtReadFile (xmlParserCtxtPtr ctxt,
1.1209 + const char *filename,
1.1210 + const char *encoding,
1.1211 + int options);
1.1212 +XMLPUBFUN xmlDocPtr XMLCALL
1.1213 + xmlCtxtReadMemory (xmlParserCtxtPtr ctxt,
1.1214 + const char *buffer,
1.1215 + int size,
1.1216 + const char *URL,
1.1217 + const char *encoding,
1.1218 + int options);
1.1219 +XMLPUBFUN xmlDocPtr XMLCALL
1.1220 + xmlCtxtReadIO (xmlParserCtxtPtr ctxt,
1.1221 + xmlInputReadCallback ioread,
1.1222 + xmlInputCloseCallback ioclose,
1.1223 + void *ioctx,
1.1224 + const char *URL,
1.1225 + const char *encoding,
1.1226 + int options);
1.1227 +#endif /* ifndef XMLENGINE_EXCLUDE_UNUSED */
1.1228 +
1.1229 +#ifdef __cplusplus
1.1230 +}
1.1231 +#endif
1.1232 +#endif /* XML_PARSER_H */
1.1233 +
1.1234 +