Eneboo - Documentación para desarrolladores
Clases | 'defines' | 'typedefs' | Funciones | Variables
Referencia del Archivo src/libdigidoc/libxml2/parser.c
#include "libxml.h"
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#include <libxml/xmlmemory.h>
#include <libxml/threads.h>
#include <libxml/globals.h>
#include <libxml/tree.h>
#include <libxml/parser.h>
#include <libxml/parserInternals.h>
#include <libxml/valid.h>
#include <libxml/entities.h>
#include <libxml/xmlerror.h>
#include <libxml/encoding.h>
#include <libxml/xmlIO.h>
#include <libxml/uri.h>
#include "elfgcchack.h"

Clases

struct  _xmlDefAttrs

'defines'

#define IN_LIBXML
#define XML_DIR_SEP   '/'
#define XML_PARSER_BIG_ENTITY   1000
#define XML_PARSER_LOT_ENTITY   5000
#define XML_PARSER_NON_LINEAR   10
#define SAX2   1
#define XML_PARSER_BIG_BUFFER_SIZE   300
#define XML_PARSER_BUFFER_SIZE   100
#define SAX_COMPAT_MODE   BAD_CAST "SAX compatibility mode document"
#define RAW   (*ctxt->input->cur)
#define CUR   (*ctxt->input->cur)
#define NXT(val)   ctxt->input->cur[(val)]
#define CUR_PTR   ctxt->input->cur
#define CMP4(s, c1, c2, c3, c4)
#define CMP5(s, c1, c2, c3, c4, c5)   ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
#define CMP6(s, c1, c2, c3, c4, c5, c6)   ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
#define CMP7(s, c1, c2, c3, c4, c5, c6, c7)   ( CMP6( s, c1, c2, c3, c4, c5, c6 ) && ((unsigned char *) s)[ 6 ] == c7 )
#define CMP8(s, c1, c2, c3, c4, c5, c6, c7, c8)   ( CMP7( s, c1, c2, c3, c4, c5, c6, c7 ) && ((unsigned char *) s)[ 7 ] == c8 )
#define CMP9(s, c1, c2, c3, c4, c5, c6, c7, c8, c9)
#define CMP10(s, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10)
#define SKIP(val)
#define SKIPL(val)
#define SHRINK
#define GROW
#define SKIP_BLANKS   xmlSkipBlankChars(ctxt)
#define NEXT   xmlNextChar(ctxt)
#define NEXT1
#define NEXTL(l)
#define CUR_CHAR(l)   xmlCurrentChar(ctxt, &l)
#define CUR_SCHAR(s, l)   xmlStringCurrentChar(ctxt, s, &l)
#define COPY_BUF(l, b, i, v)
#define growBuffer(buffer, n)

'typedefs'

typedef struct _xmlDefAttrs xmlDefAttrs
typedef xmlDefAttrsxmlDefAttrsPtr

Funciones

int xmlHasFeature (xmlFeature feature)
int xmlCheckLanguageID (const xmlChar *lang)
int inputPush (xmlParserCtxtPtr ctxt, xmlParserInputPtr value)
xmlParserInputPtr inputPop (xmlParserCtxtPtr ctxt)
int nodePush (xmlParserCtxtPtr ctxt, xmlNodePtr value)
xmlNodePtr nodePop (xmlParserCtxtPtr ctxt)
int namePush (xmlParserCtxtPtr ctxt, const xmlChar *value)
const xmlCharnamePop (xmlParserCtxtPtr ctxt)
int xmlSkipBlankChars (xmlParserCtxtPtr ctxt)
xmlChar xmlPopInput (xmlParserCtxtPtr ctxt)
int xmlPushInput (xmlParserCtxtPtr ctxt, xmlParserInputPtr input)
int xmlParseCharRef (xmlParserCtxtPtr ctxt)
void xmlParserHandlePEReference (xmlParserCtxtPtr ctxt)
xmlCharxmlStringLenDecodeEntities (xmlParserCtxtPtr ctxt, const xmlChar *str, int len, int what, xmlChar end, xmlChar end2, xmlChar end3)
xmlCharxmlStringDecodeEntities (xmlParserCtxtPtr ctxt, const xmlChar *str, int what, xmlChar end, xmlChar end2, xmlChar end3)
: the name of the element being defined.

xmlParseElementContentDecl: : an XML parser context

Devuelve:
: the Element Content pointer will be stored here if any

parse the declaration for an Element content either Mixed or Children, the cases EMPTY and ANY are handled directly in xmlParseElementDecl

[46] contentspec ::= 'EMPTY' | 'ANY' | Mixed | children

returns: the type of element content XML_ELEMENT_TYPE_xxx

int xmlParseElementContentDecl (xmlParserCtxtPtr ctxt, const xmlChar *name, xmlElementContentPtr *result)
int xmlParseElementDecl (xmlParserCtxtPtr ctxt)
void xmlParseMarkupDecl (xmlParserCtxtPtr ctxt)
void xmlParseTextDecl (xmlParserCtxtPtr ctxt)
void xmlParseExternalSubset (xmlParserCtxtPtr ctxt, const xmlChar *ExternalID, const xmlChar *SystemID)
void xmlParseReference (xmlParserCtxtPtr ctxt)
xmlEntityPtr xmlParseEntityRef (xmlParserCtxtPtr ctxt)
void xmlParsePEReference (xmlParserCtxtPtr ctxt)
void xmlParseDocTypeDecl (xmlParserCtxtPtr ctxt)

Variables

unsigned int xmlParserMaxDepth = 256

: an XML parser context

xmlSplitQName: : an XML parser context

: a xmlChar **

parse an UTF8 encoded XML qualified name string

[NS 5] QName ::= (Prefix ':')? LocalPart

[NS 6] Prefix ::= NCName

[NS 7] LocalPart ::= NCName

Returns the local part, and prefix is updated to get the Prefix if any.

xmlCharxmlSplitQName (xmlParserCtxtPtr ctxt, const xmlChar *name, xmlChar **prefix)
const xmlCharxmlParseName (xmlParserCtxtPtr ctxt)
xmlCharxmlParseNmtoken (xmlParserCtxtPtr ctxt)
xmlCharxmlParseEntityValue (xmlParserCtxtPtr ctxt, xmlChar **orig)
xmlCharxmlParseAttValue (xmlParserCtxtPtr ctxt)
xmlCharxmlParseSystemLiteral (xmlParserCtxtPtr ctxt)
xmlCharxmlParsePubidLiteral (xmlParserCtxtPtr ctxt)
void xmlParseCharData (xmlParserCtxtPtr ctxt, int cdata)
xmlCharxmlParseExternalID (xmlParserCtxtPtr ctxt, xmlChar **publicID, int strict)
void xmlParseComment (xmlParserCtxtPtr ctxt)
const xmlCharxmlParsePITarget (xmlParserCtxtPtr ctxt)
void xmlParsePI (xmlParserCtxtPtr ctxt)
void xmlParseNotationDecl (xmlParserCtxtPtr ctxt)
void xmlParseEntityDecl (xmlParserCtxtPtr ctxt)
int xmlParseDefaultDecl (xmlParserCtxtPtr ctxt, xmlChar **value)
xmlEnumerationPtr xmlParseNotationType (xmlParserCtxtPtr ctxt)
xmlEnumerationPtr xmlParseEnumerationType (xmlParserCtxtPtr ctxt)
int xmlParseEnumeratedType (xmlParserCtxtPtr ctxt, xmlEnumerationPtr *tree)
int xmlParseAttributeType (xmlParserCtxtPtr ctxt, xmlEnumerationPtr *tree)
void xmlParseAttributeListDecl (xmlParserCtxtPtr ctxt)
xmlElementContentPtr xmlParseElementMixedContentDecl (xmlParserCtxtPtr ctxt, int inputchk)
xmlElementContentPtr xmlParseElementChildrenContentDecl (xmlParserCtxtPtr ctxt, int inputchk)

: the localname

xmlParseQNameAndCompare: : an XML parser context

: the prefix, if any.

parse an XML name and compares for match (specialized for endtag parsing)

Returns NULL for an illegal name, (xmlChar*) 1 for success and the name for mismatch

#define DICT_FREE(str)
#define bottom_parser
void xmlParseCDSect (xmlParserCtxtPtr ctxt)
void xmlParseContent (xmlParserCtxtPtr ctxt)
void xmlParseElement (xmlParserCtxtPtr ctxt)
xmlCharxmlParseVersionNum (xmlParserCtxtPtr ctxt)
xmlCharxmlParseVersionInfo (xmlParserCtxtPtr ctxt)
xmlCharxmlParseEncName (xmlParserCtxtPtr ctxt)
const xmlCharxmlParseEncodingDecl (xmlParserCtxtPtr ctxt)
int xmlParseSDDecl (xmlParserCtxtPtr ctxt)
void xmlParseXMLDecl (xmlParserCtxtPtr ctxt)
void xmlParseMisc (xmlParserCtxtPtr ctxt)
int xmlParseDocument (xmlParserCtxtPtr ctxt)
int xmlParseExtParsedEnt (xmlParserCtxtPtr ctxt)
void xmlStopParser (xmlParserCtxtPtr ctxt)
xmlParserCtxtPtr xmlCreateIOParserCtxt (xmlSAXHandlerPtr sax, void *user_data, xmlInputReadCallback ioread, xmlInputCloseCallback ioclose, void *ioctx, xmlCharEncoding enc)
int xmlParseCtxtExternalEntity (xmlParserCtxtPtr ctx, const xmlChar *URL, const xmlChar *ID, xmlNodePtr *lst)
xmlParserErrors xmlParseInNodeContext (xmlNodePtr node, const char *data, int datalen, int options, xmlNodePtr *lst)
xmlParserCtxtPtr xmlCreateEntityParserCtxt (const xmlChar *URL, const xmlChar *ID, const xmlChar *base)
xmlParserCtxtPtr xmlCreateURLParserCtxt (const char *filename, int options)
xmlParserCtxtPtr xmlCreateFileParserCtxt (const char *filename)
xmlParserCtxtPtr xmlCreateMemoryParserCtxt (const char *buffer, int size)
xmlParserCtxtPtr xmlCreateDocParserCtxt (const xmlChar *cur)
void XMLCDECL xmlGenericErrorDefaultFunc (void *ctx, const char *msg,...)
void xmlInitParser (void)
void xmlCleanupParser (void)
void xmlCtxtReset (xmlParserCtxtPtr ctxt)
int xmlCtxtResetPush (xmlParserCtxtPtr ctxt, const char *chunk, int size, const char *filename, const char *encoding)
int xmlCtxtUseOptions (xmlParserCtxtPtr ctxt, int options)
xmlDocPtr xmlReadDoc (const xmlChar *cur, const char *URL, const char *encoding, int options)
xmlDocPtr xmlReadFile (const char *filename, const char *encoding, int options)
xmlDocPtr xmlReadMemory (const char *buffer, int size, const char *URL, const char *encoding, int options)
xmlDocPtr xmlReadFd (int fd, const char *URL, const char *encoding, int options)
xmlDocPtr xmlReadIO (xmlInputReadCallback ioread, xmlInputCloseCallback ioclose, void *ioctx, const char *URL, const char *encoding, int options)
xmlDocPtr xmlCtxtReadDoc (xmlParserCtxtPtr ctxt, const xmlChar *cur, const char *URL, const char *encoding, int options)
xmlDocPtr xmlCtxtReadFile (xmlParserCtxtPtr ctxt, const char *filename, const char *encoding, int options)
xmlDocPtr xmlCtxtReadMemory (xmlParserCtxtPtr ctxt, const char *buffer, int size, const char *URL, const char *encoding, int options)
xmlDocPtr xmlCtxtReadFd (xmlParserCtxtPtr ctxt, int fd, const char *URL, const char *encoding, int options)
xmlDocPtr xmlCtxtReadIO (xmlParserCtxtPtr ctxt, xmlInputReadCallback ioread, xmlInputCloseCallback ioclose, void *ioctx, const char *URL, const char *encoding, int options)

Documentación de los 'defines'

#define bottom_parser
#define CMP10 (   s,
  c1,
  c2,
  c3,
  c4,
  c5,
  c6,
  c7,
  c8,
  c9,
  c10 
)
Valor:
( CMP9( s, c1, c2, c3, c4, c5, c6, c7, c8, c9 ) && \
    ((unsigned char *) s)[ 9 ] == c10 )
#define CMP4 (   s,
  c1,
  c2,
  c3,
  c4 
)
Valor:
( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
#define CMP5 (   s,
  c1,
  c2,
  c3,
  c4,
  c5 
)    ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
#define CMP6 (   s,
  c1,
  c2,
  c3,
  c4,
  c5,
  c6 
)    ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
#define CMP7 (   s,
  c1,
  c2,
  c3,
  c4,
  c5,
  c6,
  c7 
)    ( CMP6( s, c1, c2, c3, c4, c5, c6 ) && ((unsigned char *) s)[ 6 ] == c7 )
#define CMP8 (   s,
  c1,
  c2,
  c3,
  c4,
  c5,
  c6,
  c7,
  c8 
)    ( CMP7( s, c1, c2, c3, c4, c5, c6, c7 ) && ((unsigned char *) s)[ 7 ] == c8 )
#define CMP9 (   s,
  c1,
  c2,
  c3,
  c4,
  c5,
  c6,
  c7,
  c8,
  c9 
)
Valor:
( CMP8( s, c1, c2, c3, c4, c5, c6, c7, c8 ) && \
    ((unsigned char *) s)[ 8 ] == c9 )
#define COPY_BUF (   l,
  b,
  i,
 
)
Valor:
if (l == 1) b[i++] = (xmlChar) v;                                       \
    else i += xmlCopyCharMultiByte(&b[i],v)
#define CUR   (*ctxt->input->cur)
#define CUR_CHAR (   l)    xmlCurrentChar(ctxt, &l)
#define CUR_PTR   ctxt->input->cur
#define CUR_SCHAR (   s,
 
)    xmlStringCurrentChar(ctxt, s, &l)
#define DICT_FREE (   str)
Valor:
if ((str) && ((!dict) ||                                \
            (xmlDictOwns(dict, (const xmlChar *)(str)) == 0)))  \
            xmlFree((char *)(str));

DICT_FREE: : a string

Free a string if it is not owned by the "dict" dictionnary in the current scope

#define GROW
Valor:
if ((ctxt->progressive == 0) &&                         \
                 (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK))   \
        xmlGROW (ctxt);
#define growBuffer (   buffer,
 
)
Valor:
{                                               \
    xmlChar *tmp;                                                       \
    buffer##_size *= 2;                                                 \
    buffer##_size += n;                                                 \
    tmp = (xmlChar *)                                                   \
                xmlRealloc(buffer, buffer##_size * sizeof(xmlChar));    \
    if (tmp == NULL) goto mem_error;                                    \
    buffer = tmp;                                                       \
}
#define IN_LIBXML
#define NEXT   xmlNextChar(ctxt)
#define NEXT1
Valor:
{                                                               \
        ctxt->input->col++;                                             \
        ctxt->input->cur++;                                             \
        ctxt->nbChars++;                                                \
        if (*ctxt->input->cur == 0)                                     \
            xmlParserInputGrow(ctxt->input, INPUT_CHUNK);               \
    }
#define NEXTL (   l)
Valor:
do {                                                    \
    if (*(ctxt->input->cur) == '\n') {                                  \
        ctxt->input->line++; ctxt->input->col = 1;                      \
    } else ctxt->input->col++;                                          \
    ctxt->input->cur += l;                              \
    if (*ctxt->input->cur == '%') xmlParserHandlePEReference(ctxt);     \
  } while (0)
#define NXT (   val)    ctxt->input->cur[(val)]
#define RAW   (*ctxt->input->cur)
#define SAX2   1
#define SAX_COMPAT_MODE   BAD_CAST "SAX compatibility mode document"
#define SHRINK
Valor:
if ((ctxt->progressive == 0) &&                         \
                   (ctxt->input->cur - ctxt->input->base > 2 * INPUT_CHUNK) && \
                   (ctxt->input->end - ctxt->input->cur < 2 * INPUT_CHUNK)) \
        xmlSHRINK (ctxt);
#define SKIP (   val)
Valor:
do {                                                    \
    ctxt->nbChars += (val),ctxt->input->cur += (val),ctxt->input->col+=(val);                   \
    if (*ctxt->input->cur == '%') xmlParserHandlePEReference(ctxt);     \
    if ((*ctxt->input->cur == 0) &&                                     \
        (xmlParserInputGrow(ctxt->input, INPUT_CHUNK) <= 0))            \
            xmlPopInput(ctxt);                                          \
  } while (0)
#define SKIP_BLANKS   xmlSkipBlankChars(ctxt)
#define SKIPL (   val)
Valor:
do {                                                    \
    int skipl;                                                          \
    for(skipl=0; skipl<val; skipl++) {                                  \
        if (*(ctxt->input->cur) == '\n') {                              \
        ctxt->input->line++; ctxt->input->col = 1;                      \
        } else ctxt->input->col++;                                      \
        ctxt->nbChars++;                                                \
        ctxt->input->cur++;                                             \
    }                                                                   \
    if (*ctxt->input->cur == '%') xmlParserHandlePEReference(ctxt);     \
    if ((*ctxt->input->cur == 0) &&                                     \
        (xmlParserInputGrow(ctxt->input, INPUT_CHUNK) <= 0))            \
            xmlPopInput(ctxt);                                          \
  } while (0)
#define XML_DIR_SEP   '/'
#define XML_PARSER_BIG_BUFFER_SIZE   300
#define XML_PARSER_BIG_ENTITY   1000
#define XML_PARSER_BUFFER_SIZE   100
#define XML_PARSER_LOT_ENTITY   5000
#define XML_PARSER_NON_LINEAR   10

Documentación de los 'typedefs'

typedef struct _xmlDefAttrs xmlDefAttrs

Documentación de las funciones

xmlParserInputPtr inputPop ( xmlParserCtxtPtr  ctxt)

inputPop: : an XML parser context

Pops the top parser input from the input stack

Returns the input just removed

int inputPush ( xmlParserCtxtPtr  ctxt,
xmlParserInputPtr  value 
)

inputPush: : an XML parser context : the parser input

Pushes a new parser input on top of the input stack

Returns -1 in case of error, the index in the stack otherwise

const xmlChar* namePop ( xmlParserCtxtPtr  ctxt)

namePop: : an XML parser context

Pops the top element name from the name stack

Returns the name just removed

int namePush ( xmlParserCtxtPtr  ctxt,
const xmlChar value 
)

namePush: : an XML parser context : the element name

Pushes a new element name on top of the name stack

Returns -1 in case of error, the index in the stack otherwise

xmlNodePtr nodePop ( xmlParserCtxtPtr  ctxt)

nodePop: : an XML parser context

Pops the top element node from the node stack

Returns the node just removed

int nodePush ( xmlParserCtxtPtr  ctxt,
xmlNodePtr  value 
)

nodePush: : an XML parser context : the element node

Pushes a new element node on top of the node stack

Returns -1 in case of error, the index in the stack otherwise

int xmlCheckLanguageID ( const xmlChar lang)

xmlCheckLanguageID: : pointer to the string value

Checks that the value conforms to the LanguageID production:

NOTE: this is somewhat deprecated, those productions were removed from the XML Second edition.

[33] LanguageID ::= Langcode ('-' Subcode)* [34] Langcode ::= ISO639Code | IanaCode | UserCode [35] ISO639Code ::= ([a-z] | [A-Z]) ([a-z] | [A-Z]) [36] IanaCode ::= ('i' | 'I') '-' ([a-z] | [A-Z])+ [37] UserCode ::= ('x' | 'X') '-' ([a-z] | [A-Z])+ [38] Subcode ::= ([a-z] | [A-Z])+

Returns 1 if correct 0 otherwise

void 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 !

xmlParserCtxtPtr 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

xmlParserCtxtPtr xmlCreateEntityParserCtxt ( const xmlChar URL,
const xmlChar ID,
const xmlChar base 
)

xmlCreateEntityParserCtxt: : the entity URL : the entity PUBLIC ID : a possible base for the target URI

Create a parser context for an external entity Automatic support for ZLIB/Compress compressed document is provided by default if found at compile-time.

Returns the new parser context or NULL

xmlParserCtxtPtr xmlCreateFileParserCtxt ( const char *  filename)

xmlCreateFileParserCtxt: : the filename

Create a parser context for a file content. Automatic support for ZLIB/Compress compressed document is provided by default if found at compile-time.

Returns the new parser context or NULL

xmlParserCtxtPtr 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

xmlParserCtxtPtr xmlCreateMemoryParserCtxt ( const char *  buffer,
int  size 
)

xmlCreateMemoryParserCtxt: : a pointer to a char array : the size of the array

Create a parser context for an XML in-memory document.

Returns the new parser context or NULL

xmlParserCtxtPtr xmlCreateURLParserCtxt ( const char *  filename,
int  options 
)

xmlCreateURLParserCtxt: : the filename or URL : a combination of xmlParserOption

Create a parser context for a file or URL content. Automatic support for ZLIB/Compress compressed document is provided by default if found at compile-time and for file accesses

Returns the new parser context or NULL

xmlDocPtr 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

xmlDocPtr 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

xmlDocPtr 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

xmlDocPtr 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

xmlDocPtr 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

void xmlCtxtReset ( xmlParserCtxtPtr  ctxt)

xmlCtxtReset: : an XML parser context

Reset a parser context

int 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

int 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.

void XMLCDECL xmlGenericErrorDefaultFunc ( void *  ctx,
const char *  msg,
  ... 
)
int 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.

void xmlInitParser ( void  )

xmlInitParser:

Initialization function for the XML parser. This is not reentrant. Call once before processing in case of use in multithreaded programs.

void xmlParseAttributeListDecl ( xmlParserCtxtPtr  ctxt)

xmlParseAttributeListDecl: : an XML parser context

: parse the Attribute list def for an element

[52] AttlistDecl ::= '<!ATTLIST' S Name AttDef* S? '>'

[53] AttDef ::= S Name S AttType S DefaultDecl

int xmlParseAttributeType ( xmlParserCtxtPtr  ctxt,
xmlEnumerationPtr tree 
)

xmlParseAttributeType: : an XML parser context : the enumeration tree built while parsing

parse the Attribute list def for an element

[54] AttType ::= StringType | TokenizedType | EnumeratedType

[55] StringType ::= 'CDATA'

[56] TokenizedType ::= 'ID' | 'IDREF' | 'IDREFS' | 'ENTITY' | 'ENTITIES' | 'NMTOKEN' | 'NMTOKENS'

Validity constraints for attribute values syntax are checked in xmlValidateAttributeValue()

[ VC: ID ] Values of type ID must match the Name production. A name must not appear more than once in an XML document as a value of this type; i.e., ID values must uniquely identify the elements which bear them.

[ VC: One ID per Element Type ] No element type may have more than one ID attribute specified.

[ VC: ID Attribute Default ] An ID attribute must have a declared default of #IMPLIED or #REQUIRED.

[ VC: IDREF ] Values of type IDREF must match the Name production, and values of type IDREFS must match Names; each IDREF Name must match the value of an ID attribute on some element in the XML document; i.e. IDREF values must match the value of some ID attribute.

[ VC: Entity Name ] Values of type ENTITY must match the Name production, values of type ENTITIES must match Names; each Entity Name must match the name of an unparsed entity declared in the DTD.

[ VC: Name Token ] Values of type NMTOKEN must match the Nmtoken production; values of type NMTOKENS must match Nmtokens.

Returns the attribute type

xmlChar* xmlParseAttValue ( xmlParserCtxtPtr  ctxt)

xmlParseAttValue: : an XML parser context

parse a value for an attribute Note: the parser won't do substitution of entities here, this will be handled later in xmlStringGetNodeList

[10] AttValue ::= '"' ([^<&"] | Reference)* '"' | "'" ([^<&'] | Reference)* "'"

3.3.3 Attribute-Value Normalization: Before the value of an attribute is passed to the application or checked for validity, the XML processor must normalize it as follows:

  • a character reference is processed by appending the referenced character to the attribute value
  • an entity reference is processed by recursively processing the replacement text of the entity
  • a whitespace character (#x20, #xD, #xA, #x9) is processed by appending #x20 to the normalized value, except that only a single #x20 is appended for a "#xD#xA" sequence that is part of an external parsed entity or the literal entity value of an internal parsed entity
  • other characters are processed by appending them to the normalized value If the declared value is not CDATA, then the XML processor must further process the normalized attribute value by discarding any leading and trailing space (#x20) characters, and by replacing sequences of space (#x20) characters by a single space (#x20) character. All attributes for which no declaration has been read should be treated by a non-validating parser as if declared CDATA.

Returns the AttValue parsed or NULL. The value has to be freed by the caller.

void xmlParseCDSect ( xmlParserCtxtPtr  ctxt)

xmlParseCDSect: : an XML parser context

Parse escaped pure raw content.

[18] CDSect ::= CDStart CData CDEnd

[19] CDStart ::= '<![CDATA['

[20] Data ::= (Char* - (Char* ']]>' Char*))

[21] CDEnd ::= ']]>'

void xmlParseCharData ( xmlParserCtxtPtr  ctxt,
int  cdata 
)

xmlParseCharData: : an XML parser context : int indicating whether we are within a CDATA section

parse a CharData section. if we are within a CDATA section ']]>' marks an end of section.

The right angle bracket (>) may be represented using the string "&gt;", and must, for compatibility, be escaped using "&gt;" or a character reference when it appears in the string "]]>" in content, when that string is not marking the end of a CDATA section.

[14] CharData ::= [^<&]* - ([^<&]* ']]>' [^<&]*)

int xmlParseCharRef ( xmlParserCtxtPtr  ctxt)

xmlParseCharRef: : an XML parser context

parse Reference declarations

[66] CharRef ::= '&#' [0-9]+ ';' | '&#x' [0-9a-fA-F]+ ';'

[ WFC: Legal Character ] Characters referred to using character references must match the production for Char.

Returns the value parsed (as an int), 0 in case of error

void xmlParseComment ( xmlParserCtxtPtr  ctxt)

xmlParseComment: : an XML parser context

Skip an XML (SGML) comment The spec says that "For compatibility, the string "--" (double-hyphen) must not occur within comments. "

[15] Comment ::= ''

void xmlParseContent ( xmlParserCtxtPtr  ctxt)

xmlParseContent: : an XML parser context

Parse a content:

[43] content ::= (element | CharData | Reference | CDSect | PI | Comment)*

int 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

int xmlParseDefaultDecl ( xmlParserCtxtPtr  ctxt,
xmlChar **  value 
)

xmlParseDefaultDecl: : an XML parser context : Receive a possible fixed default value for the attribute

Parse an attribute default declaration

[60] DefaultDecl ::= '#REQUIRED' | '#IMPLIED' | (('FIXED' S)? AttValue)

[ VC: Required Attribute ] if the default declaration is the keyword #REQUIRED, then the attribute must be specified for all elements of the type in the attribute-list declaration.

[ VC: Attribute Default Legal ] The declared default value must meet the lexical constraints of the declared attribute type c.f. xmlValidateAttributeDecl()

[ VC: Fixed Attribute Default ] if an attribute has a default value declared with the FIXED keyword, instances of that attribute must match the default value.

[ WFC: No < in Attribute Values ] handled in xmlParseAttValue()

returns: XML_ATTRIBUTE_NONE, XML_ATTRIBUTE_REQUIRED, XML_ATTRIBUTE_IMPLIED or XML_ATTRIBUTE_FIXED.

void xmlParseDocTypeDecl ( xmlParserCtxtPtr  ctxt)

xmlParseDocTypeDecl: : an XML parser context

parse a DOCTYPE declaration

[28] doctypedecl ::= '<!DOCTYPE' S Name (S ExternalID)? S? ('[' (markupdecl | PEReference | S)* ']' S?)? '>'

[ VC: Root Element Type ] The Name in the document type declaration must match the element type of the root element.

int 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.

void xmlParseElement ( xmlParserCtxtPtr  ctxt)

xmlParseElement: : an XML parser context

parse an XML element, this is highly recursive

[39] element ::= EmptyElemTag | STag content ETag

[ WFC: Element Type Match ] The Name in an element's end-tag must match the element type in the start-tag.

xmlElementContentPtr xmlParseElementChildrenContentDecl ( xmlParserCtxtPtr  ctxt,
int  inputchk 
)

xmlParseElementChildrenContentDecl: : an XML parser context : the input used for the current entity, needed for boundary checks

parse the declaration for a Mixed Element content The leading '(' and spaces have been skipped in xmlParseElementContentDecl

[47] children ::= (choice | seq) ('?' | '*' | '+')?

[48] cp ::= (Name | choice | seq) ('?' | '*' | '+')?

[49] choice ::= '(' S? cp ( S? '|' S? cp )* S? ')'

[50] seq ::= '(' S? cp ( S? ',' S? cp )* S? ')'

[ VC: Proper Group/PE Nesting ] applies to [49] and [50] TODO Parameter-entity replacement text must be properly nested with parenthesized groups. That is to say, if either of the opening or closing parentheses in a choice, seq, or Mixed construct is contained in the replacement text for a parameter entity, both must be contained in the same replacement text. For interoperability, if a parameter-entity reference appears in a choice, seq, or Mixed construct, its replacement text should not be empty, and neither the first nor last non-blank character of the replacement text should be a connector (| or ,).

Returns the tree of xmlElementContentPtr describing the element hierarchy.

int xmlParseElementContentDecl ( xmlParserCtxtPtr  ctxt,
const xmlChar name,
xmlElementContentPtr result 
)
int xmlParseElementDecl ( xmlParserCtxtPtr  ctxt)

xmlParseElementDecl: : an XML parser context

parse an Element declaration.

[45] elementdecl ::= '<!ELEMENT' S Name S contentspec S? '>'

[ VC: Unique Element Type Declaration ] No element type may be declared more than once

Returns the type of the element, or -1 in case of error

xmlElementContentPtr xmlParseElementMixedContentDecl ( xmlParserCtxtPtr  ctxt,
int  inputchk 
)

xmlParseElementMixedContentDecl: : an XML parser context : the input used for the current entity, needed for boundary checks

parse the declaration for a Mixed Element content The leading '(' and spaces have been skipped in xmlParseElementContentDecl

[51] Mixed ::= '(' S? '#PCDATA' (S? '|' S? Name)* S? ')*' | '(' S? '#PCDATA' S? ')'

[ VC: Proper Group/PE Nesting ] applies to [51] too (see [49])

[ VC: No Duplicate Types ] The same name must not appear more than once in a single mixed-content declaration.

returns: the list of the xmlElementContentPtr describing the element choices

xmlChar* xmlParseEncName ( xmlParserCtxtPtr  ctxt)

xmlParseEncName: : an XML parser context

parse the XML encoding name

[81] EncName ::= [A-Za-z] ([A-Za-z0-9._] | '-')*

Returns the encoding name value or NULL

const xmlChar* xmlParseEncodingDecl ( xmlParserCtxtPtr  ctxt)

xmlParseEncodingDecl: : an XML parser context

parse the XML encoding declaration

[80] EncodingDecl ::= S 'encoding' Eq ('"' EncName '"' | "'" EncName "'")

this setups the conversion filters.

Returns the encoding value or NULL

void xmlParseEntityDecl ( xmlParserCtxtPtr  ctxt)

xmlParseEntityDecl: : an XML parser context

parse <!ENTITY declarations

[70] EntityDecl ::= GEDecl | PEDecl

[71] GEDecl ::= '<!ENTITY' S Name S EntityDef S? '>'

[72] PEDecl ::= '<!ENTITY' S '%' S Name S PEDef S? '>'

[73] EntityDef ::= EntityValue | (ExternalID NDataDecl?)

[74] PEDef ::= EntityValue | ExternalID

[76] NDataDecl ::= S 'NDATA' S Name

[ VC: Notation Declared ] The Name must match the declared name of a notation.

xmlEntityPtr xmlParseEntityRef ( xmlParserCtxtPtr  ctxt)

xmlParseEntityRef: : an XML parser context

parse ENTITY references declarations

[68] EntityRef ::= '&' Name ';'

[ WFC: Entity Declared ] In a document without any DTD, a document with only an internal DTD subset which contains no parameter entity references, or a document with "standalone='yes'", the Name given in the entity reference must match that in an entity declaration, except that well-formed documents need not declare any of the following entities: amp, lt, gt, apos, quot. The declaration of a parameter entity must precede any reference to it. Similarly, the declaration of a general entity must precede any reference to it which appears in a default value in an attribute-list declaration. Note that if entities are declared in the external subset or in external parameter entities, a non-validating processor is not obligated to read and process their declarations; for such documents, the rule that an entity must be declared is a well-formedness constraint only if standalone='yes'.

[ WFC: Parsed Entity ] An entity reference must not contain the name of an unparsed entity

Returns the xmlEntityPtr if found, or NULL otherwise.

xmlChar* xmlParseEntityValue ( xmlParserCtxtPtr  ctxt,
xmlChar **  orig 
)

xmlParseEntityValue: : an XML parser context : if non-NULL store a copy of the original entity value

parse a value for ENTITY declarations

[9] EntityValue ::= '"' ([^%&"] | PEReference | Reference)* '"' | "'" ([^%&'] | PEReference | Reference)* "'"

Returns the EntityValue parsed with reference substituted or NULL

int xmlParseEnumeratedType ( xmlParserCtxtPtr  ctxt,
xmlEnumerationPtr tree 
)

xmlParseEnumeratedType: : an XML parser context : the enumeration tree built while parsing

parse an Enumerated attribute type.

[57] EnumeratedType ::= NotationType | Enumeration

[58] NotationType ::= 'NOTATION' S '(' S? Name (S? '|' S? Name)* S? ')'

Returns: XML_ATTRIBUTE_ENUMERATION or XML_ATTRIBUTE_NOTATION

xmlEnumerationPtr xmlParseEnumerationType ( xmlParserCtxtPtr  ctxt)

xmlParseEnumerationType: : an XML parser context

parse an Enumeration attribute type.

[59] Enumeration ::= '(' S? Nmtoken (S? '|' S? Nmtoken)* S? ')'

[ VC: Enumeration ] Values of this type must match one of the Nmtoken tokens in the declaration

Returns: the enumeration attribute tree built while parsing

xmlChar* xmlParseExternalID ( xmlParserCtxtPtr  ctxt,
xmlChar **  publicID,
int  strict 
)

xmlParseExternalID: : an XML parser context : a xmlChar** receiving PubidLiteral : indicate whether we should restrict parsing to only production [75], see NOTE below

Parse an External ID or a Public ID

NOTE: Productions [75] and [83] interact badly since [75] can generate 'PUBLIC' S PubidLiteral S SystemLiteral

[75] ExternalID ::= 'SYSTEM' S SystemLiteral | 'PUBLIC' S PubidLiteral S SystemLiteral

[83] PublicID ::= 'PUBLIC' S PubidLiteral

Returns the function returns SystemLiteral and in the second case publicID receives PubidLiteral, is strict is off it is possible to return NULL and have publicID set.

void xmlParseExternalSubset ( xmlParserCtxtPtr  ctxt,
const xmlChar ExternalID,
const xmlChar SystemID 
)

xmlParseExternalSubset: : an XML parser context : the external identifier : the system identifier (or URL)

parse Markup declarations from an external subset

[30] extSubset ::= textDecl? extSubsetDecl

[31] extSubsetDecl ::= (markupdecl | conditionalSect | PEReference | S) *

int 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.

xmlParserErrors 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

void xmlParseMarkupDecl ( xmlParserCtxtPtr  ctxt)

xmlParseMarkupDecl: : an XML parser context

parse Markup declarations

[29] markupdecl ::= elementdecl | AttlistDecl | EntityDecl | NotationDecl | PI | Comment

[ VC: Proper Declaration/PE Nesting ] Parameter-entity replacement text must be properly nested with markup declarations. That is to say, if either the first character or the last character of a markup declaration (markupdecl above) is contained in the replacement text for a parameter-entity reference, both must be contained in the same replacement text.

[ WFC: PEs in Internal Subset ] In the internal DTD subset, parameter-entity references can occur only where markup declarations can occur, not within markup declarations. (This does not apply to references that occur in external parameter entities or to the external subset.)

void xmlParseMisc ( xmlParserCtxtPtr  ctxt)

xmlParseMisc: : an XML parser context

parse an XML Misc* optional field.

[27] Misc ::= Comment | PI | S

const xmlChar* xmlParseName ( xmlParserCtxtPtr  ctxt)

xmlParseName: : an XML parser context

parse an XML name.

[4] NameChar ::= Letter | Digit | '.' | '-' | '_' | ':' | CombiningChar | Extender

[5] Name ::= (Letter | '_' | ':') (NameChar)*

[6] Names ::= Name (#x20 Name)*

Returns the Name parsed or NULL

xmlChar* xmlParseNmtoken ( xmlParserCtxtPtr  ctxt)

xmlParseNmtoken: : an XML parser context

parse an XML Nmtoken.

[7] Nmtoken ::= (NameChar)+

[8] Nmtokens ::= Nmtoken (#x20 Nmtoken)*

Returns the Nmtoken parsed or NULL

void xmlParseNotationDecl ( xmlParserCtxtPtr  ctxt)

xmlParseNotationDecl: : an XML parser context

parse a notation declaration

[82] NotationDecl ::= '<!NOTATION' S Name S (ExternalID | PublicID) S? '>'

Hence there is actually 3 choices: 'PUBLIC' S PubidLiteral 'PUBLIC' S PubidLiteral S SystemLiteral and 'SYSTEM' S SystemLiteral

See the NOTE on xmlParseExternalID().

xmlEnumerationPtr xmlParseNotationType ( xmlParserCtxtPtr  ctxt)

xmlParseNotationType: : an XML parser context

parse an Notation attribute type.

Note: the leading 'NOTATION' S part has already being parsed...

[58] NotationType ::= 'NOTATION' S '(' S? Name (S? '|' S? Name)* S? ')'

[ VC: Notation Attributes ] Values of this type must match one of the notation names included in the declaration; all notation names in the declaration must be declared.

Returns: the notation attribute tree built while parsing

void xmlParsePEReference ( xmlParserCtxtPtr  ctxt)

xmlParsePEReference: : an XML parser context

parse PEReference declarations The entity content is handled directly by pushing it's content as a new input stream.

[69] PEReference ::= '%' Name ';'

[ WFC: No Recursion ] A parsed entity must not contain a recursive reference to itself, either directly or indirectly.

[ WFC: Entity Declared ] In a document without any DTD, a document with only an internal DTD subset which contains no parameter entity references, or a document with "standalone='yes'", ... ... The declaration of a parameter entity must precede any reference to it...

[ VC: Entity Declared ] In a document with an external subset or external parameter entities with "standalone='no'", ... ... The declaration of a parameter entity must precede any reference to it...

[ WFC: In DTD ] Parameter-entity references may only appear in the DTD. NOTE: misleading but this is handled.

void xmlParsePI ( xmlParserCtxtPtr  ctxt)

xmlParsePI: : an XML parser context

parse an XML Processing Instruction.

[16] PI ::= '<?' PITarget (S (Char* - (Char* '?>' Char*)))? '?>'

The processing is transfered to SAX once parsed.

const xmlChar* xmlParsePITarget ( xmlParserCtxtPtr  ctxt)

xmlParsePITarget: : an XML parser context

parse the name of a PI

[17] PITarget ::= Name - (('X' | 'x') ('M' | 'm') ('L' | 'l'))

Returns the PITarget name or NULL

xmlChar* xmlParsePubidLiteral ( xmlParserCtxtPtr  ctxt)

xmlParsePubidLiteral: : an XML parser context

parse an XML public literal

[12] PubidLiteral ::= '"' PubidChar* '"' | "'" (PubidChar - "'")* "'"

Returns the PubidLiteral parsed or NULL.

void xmlParseReference ( xmlParserCtxtPtr  ctxt)

xmlParseReference: : an XML parser context

parse and handle entity references in content, depending on the SAX interface, this may end-up in a call to character() if this is a CharRef, a predefined entity, if there is no reference() callback. or if the parser was asked to switch to that mode.

[67] Reference ::= EntityRef | CharRef

void xmlParserHandlePEReference ( xmlParserCtxtPtr  ctxt)

xmlParserHandlePEReference: : the parser context

[69] PEReference ::= '%' Name ';'

[ WFC: No Recursion ] A parsed entity must not contain a recursive reference to itself, either directly or indirectly.

[ WFC: Entity Declared ] In a document without any DTD, a document with only an internal DTD subset which contains no parameter entity references, or a document with "standalone='yes'", ... ... The declaration of a parameter entity must precede any reference to it...

[ VC: Entity Declared ] In a document with an external subset or external parameter entities with "standalone='no'", ... ... The declaration of a parameter entity must precede any reference to it...

[ WFC: In DTD ] Parameter-entity references may only appear in the DTD. NOTE: misleading but this is handled.

A PEReference may have been detected in the current input stream the handling is done accordingly to http://www.w3.org/TR/REC-xml#entproc i.e.

  • Included in literal in entity values
  • Included as Parameter Entity reference within DTDs
int xmlParseSDDecl ( xmlParserCtxtPtr  ctxt)

xmlParseSDDecl: : an XML parser context

parse the XML standalone declaration

[32] SDDecl ::= S 'standalone' Eq (("'" ('yes' | 'no') "'") | ('"' ('yes' | 'no')'"'))

[ VC: Standalone Document Declaration ] TODO The standalone document declaration must have the value "no" if any external markup declarations contain declarations of:

  • attributes with default values, if elements to which these attributes apply appear in the document without specifications of values for these attributes, or
  • entities (other than amp, lt, gt, apos, quot), if references to those entities appear in the document, or
  • attributes with values subject to normalization, where the attribute appears in the document with a value which will change as a result of normalization, or
  • element types with element content, if white space occurs directly within any instance of those types.

Returns: 1 if standalone="yes" 0 if standalone="no" -2 if standalone attribute is missing or invalid (A standalone value of -2 means that the XML declaration was found, but no value was specified for the standalone attribute).

xmlChar* xmlParseSystemLiteral ( xmlParserCtxtPtr  ctxt)

xmlParseSystemLiteral: : an XML parser context

parse an XML Literal

[11] SystemLiteral ::= ('"' [^"]* '"') | ("'" [^']* "'")

Returns the SystemLiteral parsed or NULL

void xmlParseTextDecl ( xmlParserCtxtPtr  ctxt)

xmlParseTextDecl: : an XML parser context

parse an XML declaration header for external entities

[77] TextDecl ::= '<?xml' VersionInfo? EncodingDecl S? '?>'

xmlChar* xmlParseVersionInfo ( xmlParserCtxtPtr  ctxt)

xmlParseVersionInfo: : an XML parser context

parse the XML version.

[24] VersionInfo ::= S 'version' Eq (' VersionNum ' | " VersionNum ")

[25] Eq ::= S? '=' S?

Returns the version string, e.g. "1.0"

xmlChar* xmlParseVersionNum ( xmlParserCtxtPtr  ctxt)

xmlParseVersionNum: : an XML parser context

parse the XML version value.

[26] VersionNum ::= '1.' [0-9]+

In practice allow [0-9].[0-9]+ at that level

Returns the string giving the XML version number, or NULL

void xmlParseXMLDecl ( xmlParserCtxtPtr  ctxt)

xmlParseXMLDecl: : an XML parser context

parse an XML declaration header

[23] XMLDecl ::= '<?xml' VersionInfo EncodingDecl? SDDecl? S? '?>'

xmlChar xmlPopInput ( xmlParserCtxtPtr  ctxt)

xmlPopInput: : an XML parser context

xmlPopInput: the current input pointed by ctxt->input came to an end pop it and return the next char.

Returns the current xmlChar in the parser context

int xmlPushInput ( xmlParserCtxtPtr  ctxt,
xmlParserInputPtr  input 
)

xmlPushInput: : an XML parser context : an XML parser input fragment (entity, XML fragment ...).

xmlPushInput: switch to a new input stream which is stacked on top of the previous one(s). Returns -1 in case of error or the index in the input stack

xmlDocPtr 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

xmlDocPtr 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

xmlDocPtr 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

xmlDocPtr 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

xmlDocPtr 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

int xmlSkipBlankChars ( xmlParserCtxtPtr  ctxt)

xmlSkipBlankChars: : the XML parser context

skip all blanks character found at that point in the input streams. It pops up finished entities in the process if allowable at that point.

Returns the number of space chars skipped

xmlChar* xmlSplitQName ( xmlParserCtxtPtr  ctxt,
const xmlChar name,
xmlChar **  prefix 
)

Namespaces.

void xmlStopParser ( xmlParserCtxtPtr  ctxt)

xmlStopParser: : an XML parser context

Blocks further parser processing

xmlChar* xmlStringDecodeEntities ( xmlParserCtxtPtr  ctxt,
const xmlChar str,
int  what,
xmlChar  end,
xmlChar  end2,
xmlChar  end3 
)

xmlStringDecodeEntities: : the parser context : the input string : combination of XML_SUBSTITUTE_REF and XML_SUBSTITUTE_PEREF : an end marker xmlChar, 0 if none : an end marker xmlChar, 0 if none : an end marker xmlChar, 0 if none

Takes a entity string content and process to do the adequate substitutions.

[67] Reference ::= EntityRef | CharRef

[69] PEReference ::= '%' Name ';'

Returns A newly allocated string with the substitution done. The caller must deallocate it !

xmlChar* xmlStringLenDecodeEntities ( xmlParserCtxtPtr  ctxt,
const xmlChar str,
int  len,
int  what,
xmlChar  end,
xmlChar  end2,
xmlChar  end3 
)

xmlStringLenDecodeEntities: : the parser context : the input string : the string length : combination of XML_SUBSTITUTE_REF and XML_SUBSTITUTE_PEREF : an end marker xmlChar, 0 if none : an end marker xmlChar, 0 if none : an end marker xmlChar, 0 if none

Takes a entity string content and process to do the adequate substitutions.

[67] Reference ::= EntityRef | CharRef

[69] PEReference ::= '%' Name ';'

Returns A newly allocated string with the substitution done. The caller must deallocate it !


Documentación de las variables

unsigned int xmlParserMaxDepth = 256

xmlParserMaxDepth:

arbitrary depth limit for the XML documents that we allow to process. This is not a limitation of the parser but a safety boundary feature. It can be disabled with the XML_PARSE_HUGE parser option.

 Todo Clases Namespaces Archivos Funciones Variables 'typedefs' Enumeraciones Valores de enumeraciones Propiedades Amigas 'defines'