|
ReactOS 0.4.16-dev-2232-gc2aaa52
|
#include "libxml.h"#include <stdlib.h>#include <limits.h>#include <string.h>#include <stdarg.h>#include <stddef.h>#include <ctype.h>#include <libxml/parser.h>#include <libxml/xmlmemory.h>#include <libxml/tree.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 <libxml/SAX2.h>#include "private/buf.h"#include "private/dict.h"#include "private/entities.h"#include "private/error.h"#include "private/html.h"#include "private/io.h"#include "private/parser.h"
Go to the source code of this file.
Classes | |
| struct | _xmlStartTag |
| struct | xmlParserNsExtra |
| struct | xmlParserNsBucket |
| struct | _xmlParserNsData |
| struct | _xmlAttrHashBucket |
| struct | xmlDefAttr |
| struct | _xmlDefAttrs |
Typedefs | |
| typedef struct _xmlDefAttrs | xmlDefAttrs |
| typedef xmlDefAttrs * | xmlDefAttrsPtr |
Functions | |
| static void | xmlErrAttributeDup (xmlParserCtxtPtr ctxt, const xmlChar *prefix, const xmlChar *localname) |
| static void | LIBXML_ATTR_FORMAT (3, 0) |
| static void | xmlSaturatedAdd (unsigned long *dst, unsigned long val) |
| static void | xmlSaturatedAddSizeT (unsigned long *dst, unsigned long val) |
| static int | xmlParserEntityCheck (xmlParserCtxtPtr ctxt, unsigned long extra) |
| int | xmlHasFeature (xmlFeature feature) |
| static void | xmlDetectSAX2 (xmlParserCtxtPtr ctxt) |
| static xmlChar * | xmlAttrNormalizeSpace (const xmlChar *src, xmlChar *dst) |
| static const xmlChar * | xmlAttrNormalizeSpace2 (xmlParserCtxtPtr ctxt, xmlChar *src, int *len) |
| static void | xmlAddDefAttrs (xmlParserCtxtPtr ctxt, const xmlChar *fullname, const xmlChar *fullattr, const xmlChar *value) |
| static void | xmlAddSpecialAttr (xmlParserCtxtPtr ctxt, const xmlChar *fullname, const xmlChar *fullattr, int type) |
| static void | xmlCleanSpecialAttrCallback (void *payload, void *data, const xmlChar *fullname, const xmlChar *fullattr, const xmlChar *unused ATTRIBUTE_UNUSED) |
| static void | xmlCleanSpecialAttr (xmlParserCtxtPtr ctxt) |
| int | xmlCheckLanguageID (const xmlChar *lang) |
| xmlParserNsData * | xmlParserNsCreate (void) |
| void | xmlParserNsFree (xmlParserNsData *nsdb) |
| static void | xmlParserNsReset (xmlParserNsData *nsdb) |
| static int | xmlParserNsStartElement (xmlParserNsData *nsdb) |
| static int | xmlParserNsLookup (xmlParserCtxtPtr ctxt, const xmlHashedString *prefix, xmlParserNsBucket **bucketPtr) |
| static const xmlChar * | xmlParserNsLookupUri (xmlParserCtxtPtr ctxt, const xmlHashedString *prefix) |
| void * | xmlParserNsLookupSax (xmlParserCtxtPtr ctxt, const xmlChar *prefix) |
| int | xmlParserNsUpdateSax (xmlParserCtxtPtr ctxt, const xmlChar *prefix, void *saxData) |
| static int | xmlParserNsGrow (xmlParserCtxtPtr ctxt) |
| static int | xmlParserNsPush (xmlParserCtxtPtr ctxt, const xmlHashedString *prefix, const xmlHashedString *uri, void *saxData, int defAttr) |
| static int | xmlParserNsPop (xmlParserCtxtPtr ctxt, int nr) |
| static int | xmlCtxtGrowAttrs (xmlParserCtxtPtr ctxt, int nr) |
| int | inputPush (xmlParserCtxtPtr ctxt, xmlParserInputPtr value) |
| xmlParserInputPtr | inputPop (xmlParserCtxtPtr ctxt) |
| int | nodePush (xmlParserCtxtPtr ctxt, xmlNodePtr value) |
| xmlNodePtr | nodePop (xmlParserCtxtPtr ctxt) |
| static int | nameNsPush (xmlParserCtxtPtr ctxt, const xmlChar *value, const xmlChar *prefix, const xmlChar *URI, int line, int nsNr) |
| int | namePush (xmlParserCtxtPtr ctxt, const xmlChar *value) |
| const xmlChar * | namePop (xmlParserCtxtPtr ctxt) |
| static int | spacePush (xmlParserCtxtPtr ctxt, int val) |
| static int | spacePop (xmlParserCtxtPtr ctxt) |
| int | xmlSkipBlankChars (xmlParserCtxtPtr ctxt) |
| xmlChar | xmlPopInput (xmlParserCtxtPtr ctxt) |
| int | xmlPushInput (xmlParserCtxtPtr ctxt, xmlParserInputPtr input) |
| int | xmlParseCharRef (xmlParserCtxtPtr ctxt) |
| static int | xmlParseStringCharRef (xmlParserCtxtPtr ctxt, const xmlChar **str) |
| void | xmlParserHandlePEReference (xmlParserCtxtPtr ctxt) |
| static xmlChar * | xmlStringDecodeEntitiesInt (xmlParserCtxtPtr ctxt, const xmlChar *str, int len, int what, xmlChar end, xmlChar end2, xmlChar end3, int check) |
| xmlChar * | xmlStringLenDecodeEntities (xmlParserCtxtPtr ctxt, const xmlChar *str, int len, int what, xmlChar end, xmlChar end2, xmlChar end3) |
| xmlChar * | xmlStringDecodeEntities (xmlParserCtxtPtr ctxt, const xmlChar *str, int what, xmlChar end, xmlChar end2, xmlChar end3) |
| static int | areBlanks (xmlParserCtxtPtr ctxt, const xmlChar *str, int len, int blank_chars) |
: the name of the element being defined. | |
xmlParseElementContentDecl: @ctxt: an XML parser context
DEPRECATED: Internal function, don't use. 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 | |
| static xmlEntityPtr | xmlParseStringPEReference (xmlParserCtxtPtr ctxt, const xmlChar **str) |
| static int | xmlLoadEntityContent (xmlParserCtxtPtr ctxt, xmlEntityPtr entity) |
| static xmlEntityPtr | xmlParseStringEntityRef (xmlParserCtxtPtr ctxt, const xmlChar **str) |
| int | xmlParseElementContentDecl (xmlParserCtxtPtr ctxt, const xmlChar *name, xmlElementContentPtr *result) |
| int | xmlParseElementDecl (xmlParserCtxtPtr ctxt) |
| static void | xmlParseConditionalSections (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) |
| static void | xmlParseInternalSubset (xmlParserCtxtPtr ctxt) |
| static xmlHashedString | xmlParseQNameHashed (xmlParserCtxtPtr ctxt, xmlHashedString *prefix) |
| static const xmlChar * | xmlParseQName (xmlParserCtxtPtr ctxt, const xmlChar **prefix) |
Variables | |
| unsigned int | xmlParserMaxDepth = 256 |
| const char *const | xmlParserVersion = LIBXML_VERSION_STRING LIBXML_VERSION_EXTRA |
| static const char *const | xmlW3CPIs [] |
: the localname | |
xmlParseQNameAndCompare: @ctxt: an XML parser context @prefix: 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 | GROW_PARSE_ATT_VALUE_INTERNAL(ctxt, in, start, end) |
| static const xmlChar * | xmlParseQNameAndCompare (xmlParserCtxtPtr ctxt, xmlChar const *name, xmlChar const *prefix) |
| static xmlHashedString | xmlParseAttribute2 (xmlParserCtxtPtr ctxt, const xmlChar *pref, const xmlChar *elem, xmlHashedString *hprefix, xmlChar **value, int *len, int *alloc) |
: attribute name | |
xmlAttrHashInsert: @ctxt: parser context @size: size of the hash table @uri: namespace uri @hashValue: combined hash value of name and uri @aindex: attribute index (this is a multiple of 5) Inserts a new attribute into the hash table. Returns INT_MAX if no existing attribute was found, the attribute index if an attribute was found, -1 if a memory allocation failed. | |
| #define | DICT_FREE(str) |
| static xmlParserCtxtPtr | xmlCreateEntityParserCtxtInternal (xmlSAXHandlerPtr sax, void *userData, const xmlChar *URL, const xmlChar *ID, const xmlChar *base, xmlParserCtxtPtr pctx) |
| static int | xmlParseElementStart (xmlParserCtxtPtr ctxt) |
| static void | xmlParseElementEnd (xmlParserCtxtPtr ctxt) |
| static xmlParserErrors | xmlParseExternalEntityPrivate (xmlDocPtr doc, xmlParserCtxtPtr oldctxt, xmlSAXHandlerPtr sax, void *user_data, int depth, const xmlChar *URL, const xmlChar *ID, xmlNodePtr *list) |
| static int | xmlCtxtUseOptionsInternal (xmlParserCtxtPtr ctxt, int options) |
| static xmlParserErrors | xmlParseBalancedChunkMemoryInternal (xmlParserCtxtPtr oldctxt, const xmlChar *string, void *user_data, xmlNodePtr *lst) |
| static int | xmlAttrHashInsert (xmlParserCtxtPtr ctxt, unsigned size, const xmlChar *name, const xmlChar *uri, unsigned hashValue, int aindex) |
| static const xmlChar * | xmlParseStartTag2 (xmlParserCtxtPtr ctxt, const xmlChar **pref, const xmlChar **URI, int *nbNsPtr) |
| static void | xmlParseEndTag2 (xmlParserCtxtPtr ctxt, const xmlStartTag *tag) |
| void | xmlParseCDSect (xmlParserCtxtPtr ctxt) |
| static void | xmlParseContentInternal (xmlParserCtxtPtr ctxt) |
| void | xmlParseContent (xmlParserCtxtPtr ctxt) |
| void | xmlParseElement (xmlParserCtxtPtr ctxt) |
| xmlChar * | xmlParseVersionNum (xmlParserCtxtPtr ctxt) |
| xmlChar * | xmlParseVersionInfo (xmlParserCtxtPtr ctxt) |
| xmlChar * | xmlParseEncName (xmlParserCtxtPtr ctxt) |
| const xmlChar * | xmlParseEncodingDecl (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 *str) |
| 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) |
| void | xmlCtxtSetMaxAmplification (xmlParserCtxtPtr ctxt, unsigned maxAmpl) |
| static xmlDocPtr | xmlDoRead (xmlParserCtxtPtr ctxt, const char *URL, const char *encoding, int options, int reuse) |
| 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 *str, 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) |
: an XML parser context | |
xmlSplitQName: @ctxt: an XML parser context @prefix: 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. | |
| static const unsigned char | test_char_data [256] |
| xmlChar * | xmlSplitQName (xmlParserCtxtPtr ctxt, const xmlChar *name, xmlChar **prefix) |
| static int | xmlIsNameStartChar (xmlParserCtxtPtr ctxt, int c) |
| static int | xmlIsNameChar (xmlParserCtxtPtr ctxt, int c) |
| static xmlChar * | xmlParseAttValueInternal (xmlParserCtxtPtr ctxt, int *len, int *alloc, int normalize) |
| static const xmlChar * | xmlParseNameComplex (xmlParserCtxtPtr ctxt) |
| const xmlChar * | xmlParseName (xmlParserCtxtPtr ctxt) |
| static xmlHashedString | xmlParseNCNameComplex (xmlParserCtxtPtr ctxt) |
| static xmlHashedString | xmlParseNCName (xmlParserCtxtPtr ctxt) |
| static const xmlChar * | xmlParseNameAndCompare (xmlParserCtxtPtr ctxt, xmlChar const *other) |
| static xmlChar * | xmlParseStringName (xmlParserCtxtPtr ctxt, const xmlChar **str) |
| xmlChar * | xmlParseNmtoken (xmlParserCtxtPtr ctxt) |
| xmlChar * | xmlParseEntityValue (xmlParserCtxtPtr ctxt, xmlChar **orig) |
| static xmlChar * | xmlParseAttValueComplex (xmlParserCtxtPtr ctxt, int *attlen, int normalize) |
| xmlChar * | xmlParseAttValue (xmlParserCtxtPtr ctxt) |
| xmlChar * | xmlParseSystemLiteral (xmlParserCtxtPtr ctxt) |
| xmlChar * | xmlParsePubidLiteral (xmlParserCtxtPtr ctxt) |
| static void | xmlParseCharDataComplex (xmlParserCtxtPtr ctxt, int partial) |
| static void | xmlParseCharDataInternal (xmlParserCtxtPtr ctxt, int partial) |
| void | xmlParseCharData (xmlParserCtxtPtr ctxt, ATTRIBUTE_UNUSED int cdata) |
| xmlChar * | xmlParseExternalID (xmlParserCtxtPtr ctxt, xmlChar **publicID, int strict) |
| static void | xmlParseCommentComplex (xmlParserCtxtPtr ctxt, xmlChar *buf, size_t len, size_t size) |
| void | xmlParseComment (xmlParserCtxtPtr ctxt) |
| const xmlChar * | xmlParsePITarget (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) |
| static xmlElementContentPtr | xmlParseElementChildrenContentDeclPriv (xmlParserCtxtPtr ctxt, int inputchk, int depth) |
| xmlElementContentPtr | xmlParseElementChildrenContentDecl (xmlParserCtxtPtr ctxt, int inputchk) |
| #define GROW |
xmlParseAttValueInternal: @ctxt: an XML parser context @len: attribute len result @alloc: whether the attribute was reallocated as a new string @normalize: if 1 then further non-CDATA normalization must be done
parse a value for an attribute. NOTE: if no normalization is needed, the routine will return pointers directly from the data buffer.
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:
Returns the AttValue parsed or NULL. The value has to be freed by the caller if it was copied, this can be detected by val[*len] == 0.
| #define NEXT xmlNextChar(ctxt) |
| #define NEXT1 |
| #define SHRINK |
| #define SKIP_BLANKS xmlSkipBlankChars(ctxt) |
| #define XML_PARSER_CHUNK_SIZE 100 |
XML_PARSER_CHUNK_SIZE
When calling GROW that's the minimal amount of data the parser expected to have received. It is not a hard limit but an optimization when reading strings like Names It is not strictly needed as long as inputs available characters are followed by 0, which should be provided by the I/O level
| typedef struct _xmlDefAttrs xmlDefAttrs |
| typedef xmlDefAttrs* xmlDefAttrsPtr |
|
static |
areBlanks: @ctxt: an XML parser context @str: a xmlChar * @len: the size of @str @blank_chars: we know the chars are blanks
Is this a sequence of blank chars that one can ignore ?
Returns 1 if ignorable 0 otherwise.
Definition at line 3075 of file parser.c.
Referenced by xmlParseCharDataComplex(), and xmlParseCharDataInternal().
| xmlParserInputPtr inputPop | ( | xmlParserCtxtPtr | ctxt | ) |
inputPop: @ctxt: an XML parser context
Pops the top parser input from the input stack
Returns the input just removed
Definition at line 1927 of file parser.c.
Referenced by xmlCtxtReset(), xmlFreeParserCtxt(), xmlHaltParser(), xmlInitSAXParserCtxt(), xmlLoadEntityContent(), xmlPopInput(), and xmlPushInput().
| int inputPush | ( | xmlParserCtxtPtr | ctxt, |
| xmlParserInputPtr | value | ||
| ) |
inputPush: @ctxt: an XML parser context @value: 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
Definition at line 1897 of file parser.c.
Referenced by xmlCreateDocParserCtxt(), xmlCreateEntityParserCtxtInternal(), xmlCreateIOParserCtxt(), xmlCreateMemoryParserCtxt(), xmlCreateURLParserCtxt(), xmlCtxtReadDoc(), xmlCtxtReadFd(), xmlCtxtReadFile(), xmlCtxtReadIO(), xmlCtxtReadMemory(), xmlCtxtResetPush(), xmlLoadEntityContent(), xmlPushInput(), xmlReadFd(), xmlReadIO(), xslt_doc_default_loader(), and xsltDocDefaultLoaderFunc().
|
static |
xmlFatalErrMsg: @ctxt: an XML parser context @error: the error number @msg: the error message
Handle a fatal parser error, i.e. violating Well-Formedness constraints
xmlWarningMsg: @ctxt: an XML parser context @error: the error number @msg: the error message @str1: extra data @str2: extra data
Handle a warning.
xmlValidityError: @ctxt: an XML parser context @error: the error number @msg: the error message @str1: extra data
Handle a validity error.
xmlFatalErrMsgInt: @ctxt: an XML parser context @error: the error number @msg: the error message @val: an integer value
Handle a fatal parser error, i.e. violating Well-Formedness constraints
xmlFatalErrMsgStrIntStr: @ctxt: an XML parser context @error: the error number @msg: the error message @str1: an string info @val: an integer value @str2: an string info
Handle a fatal parser error, i.e. violating Well-Formedness constraints
xmlFatalErrMsgStr: @ctxt: an XML parser context @error: the error number @msg: the error message @val: a string value
Handle a fatal parser error, i.e. violating Well-Formedness constraints
xmlErrMsgStr: @ctxt: an XML parser context @error: the error number @msg: the error message @val: a string value
Handle a non fatal parser error
xmlNsErr: @ctxt: an XML parser context @error: the error number @msg: the message @info1: extra information string @info2: extra information string
Handle a fatal parser error, i.e. violating Well-Formedness constraints
xmlNsWarn @ctxt: an XML parser context @error: the error number @msg: the message @info1: extra information string @info2: extra information string
Handle a namespace warning error
Definition at line 275 of file parser.c.
|
static |
nameNsPush: @ctxt: an XML parser context @value: the element name @prefix: the element prefix @URI: the element namespace name the current line number for error messages @nsNr: the number of namespaces pushed on the namespace table
Pushes a new element name/prefix/URL on top of the name stack
Returns -1 in case of error, the index in the stack otherwise
Definition at line 2027 of file parser.c.
Referenced by xmlParseElementStart().
namePop: @ctxt: an XML parser context
DEPRECATED: Internal function, do not use.
Pops the top element name from the name stack
Returns the name just removed
Definition at line 2143 of file parser.c.
Referenced by xmlParseElementEnd(), and xmlParseElementStart().
namePush: @ctxt: an XML parser context @value: the element name
DEPRECATED: Internal function, do not use.
Pushes a new element name on top of the name stack
Returns -1 in case of error, the index in the stack otherwise
Definition at line 2109 of file parser.c.
| xmlNodePtr nodePop | ( | xmlParserCtxtPtr | ctxt | ) |
nodePop: @ctxt: an XML parser context
DEPRECATED: Internal function, do not use.
Pops the top element node from the node stack
Returns the node just removed
Definition at line 1996 of file parser.c.
Referenced by xmlParseElementStart(), and xmlSAX2EndElementNs().
| int nodePush | ( | xmlParserCtxtPtr | ctxt, |
| xmlNodePtr | value | ||
| ) |
nodePush: @ctxt: an XML parser context @value: the element node
DEPRECATED: Internal function, do not use.
Pushes a new element node on top of the node stack
Returns -1 in case of error, the index in the stack otherwise
Definition at line 1956 of file parser.c.
Referenced by xmlParseBalancedChunkMemoryInternal(), xmlParseExternalEntityPrivate(), xmlParseInNodeContext(), and xmlSAX2StartElementNs().
|
static |
Definition at line 2178 of file parser.c.
Referenced by xmlParseElementStart(), and xmlParseEndTag2().
Definition at line 2159 of file parser.c.
Referenced by xmlParseElementStart().
|
static |
xmlAddDefAttrs: @ctxt: an XML parser context @fullname: the element fullname @fullattr: the attribute fullname @value: the attribute value
Add a defaulted attribute for an element
Definition at line 1017 of file parser.c.
Referenced by xmlParseAttributeListDecl().
|
static |
xmlAddSpecialAttr: @ctxt: an XML parser context @fullname: the element fullname @fullattr: the attribute fullname @type: the attribute type
Register this attribute type
Definition at line 1138 of file parser.c.
Referenced by xmlParseAttributeListDecl().
|
static |
Definition at line 9414 of file parser.c.
Referenced by xmlParseStartTag2().
xmlAttrNormalizeSpace: @src: the source string @dst: the target string
Normalize the space in non CDATA attribute values: If the attribute type 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. Note that the size of dst need to be at least src, and if one doesn't need to preserve dst (and it doesn't come from a dictionary or read-only) then passing src as dst is just fine.
Returns a pointer to the normalized value (dst) or NULL if no conversion is needed.
Definition at line 927 of file parser.c.
Referenced by xmlAttrNormalizeSpace2(), and xmlParseAttributeListDecl().
|
static |
xmlAttrNormalizeSpace2: @src: the source string
Normalize the space in non CDATA attribute values, a slightly more complex front end to avoid allocation problems when running on attribute values coming from the input.
Returns a pointer to the normalized value (dst) or NULL if no conversion is needed.
Definition at line 960 of file parser.c.
Referenced by xmlParseAttribute2().
xmlCheckLanguageID: @lang: pointer to the string value
DEPRECATED: Internal function, do not use.
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])+
The current REC reference the successors of RFC 1766, currently 5646
http://www.rfc-editor.org/rfc/rfc5646.txt langtag = language ["-" script] ["-" region] *("-" variant) *("-" extension) ["-" privateuse] language = 2*3ALPHA ; shortest ISO 639 code ["-" extlang] ; sometimes followed by ; extended language subtags / 4ALPHA ; or reserved for future use / 5*8ALPHA ; or registered language subtag
extlang = 3ALPHA ; selected ISO 639 codes *2("-" 3ALPHA) ; permanently reserved
script = 4ALPHA ; ISO 15924 code
region = 2ALPHA ; ISO 3166-1 code / 3DIGIT ; UN M.49 code
variant = 5*8alphanum ; registered variants / (DIGIT 3alphanum)
extension = singleton 1*("-" (2*8alphanum))
; Single alphanumerics
; "x" reserved for private use
singleton = DIGIT ; 0 - 9 / x41-57 ; A - W / x59-5A ; Y - Z / x61-77 ; a - w / x79-7A ; y - z
it sounds right to still allow Irregular i-xxx IANA and user codes too The parser below doesn't try to cope with extension or privateuse that could be added but that's not interoperable anyway
Returns 1 if correct 0 otherwise
Definition at line 1261 of file parser.c.
Referenced by xmlParseAttribute2().
|
static |
xmlCleanSpecialAttr: @ctxt: an XML parser context
Trim the list of attributes defined to remove all those of type CDATA as they are not special. This call should be done when finishing to parse the DTD and before starting to parse the document root.
Definition at line 1186 of file parser.c.
Referenced by xmlParseDocument().
|
static |
xmlCleanSpecialAttrCallback:
Removes CDATA attributes from the special attribute table
Definition at line 1167 of file parser.c.
Referenced by xmlCleanSpecialAttr().
xmlCreateDocParserCtxt: @str: a pointer to an array of xmlChar
Creates a parser context for an XML in-memory document.
Returns the new parser context or NULL
Definition at line 14207 of file parser.c.
Referenced by xmlParseBalancedChunkMemoryInternal(), and xmlReadDoc().
| xmlParserCtxtPtr xmlCreateEntityParserCtxt | ( | const xmlChar * | URL, |
| const xmlChar * | ID, | ||
| const xmlChar * | base | ||
| ) |
xmlCreateEntityParserCtxt: @URL: the entity URL @ID: the entity PUBLIC ID @base: 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
Definition at line 13670 of file parser.c.
|
static |
xmlCreateEntityParserCtxtInternal: @URL: the entity URL @ID: the entity PUBLIC ID @base: a possible base for the target URI @pctx: parser context used to set options on new context
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
Definition at line 13600 of file parser.c.
Referenced by xmlCreateEntityParserCtxt(), and xmlParseExternalEntityPrivate().
xmlCreateFileParserCtxt: @filename: 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
Definition at line 13736 of file parser.c.
| xmlParserCtxtPtr xmlCreateIOParserCtxt | ( | xmlSAXHandlerPtr | sax, |
| void * | user_data, | ||
| xmlInputReadCallback | ioread, | ||
| xmlInputCloseCallback | ioclose, | ||
| void * | ioctx, | ||
| xmlCharEncoding | enc | ||
| ) |
xmlCreateIOParserCtxt: @sax: a SAX handler @user_data: The user data returned on SAX callbacks @ioread: an I/O read function @ioclose: an I/O close function @ioctx: an I/O handler @enc: the charset encoding if known
Create a parser context for using the XML parser with an existing I/O stream
Returns the new parser context or NULL
Definition at line 12333 of file parser.c.
xmlCreateMemoryParserCtxt: @buffer: a pointer to a char array @size: the size of the array
Create a parser context for an XML in-memory document.
Returns the new parser context or NULL
Definition at line 13996 of file parser.c.
Referenced by doparse(), internal_parseBuffer(), xmlParseInNodeContext(), and xmlReadMemory().
xmlCreateURLParserCtxt: @filename: the filename or URL @options: 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
Definition at line 13694 of file parser.c.
Referenced by xmlCreateFileParserCtxt(), and xmlReadFile().
Definition at line 1858 of file parser.c.
Referenced by xmlParseStartTag2().
| xmlDocPtr xmlCtxtReadDoc | ( | xmlParserCtxtPtr | ctxt, |
| const xmlChar * | str, | ||
| const char * | URL, | ||
| const char * | encoding, | ||
| int | options | ||
| ) |
xmlCtxtReadDoc: @ctxt: an XML parser context @str: a pointer to a zero terminated string @URL: the base URL to use for the document @encoding: the document encoding, or NULL @options: a combination of xmlParserOption
parse an XML in-memory document and build a tree. This reuses the existing @ctxt parser context
Returns the resulting document tree
Definition at line 14950 of file parser.c.
| xmlDocPtr xmlCtxtReadFd | ( | xmlParserCtxtPtr | ctxt, |
| int | fd, | ||
| const char * | URL, | ||
| const char * | encoding, | ||
| int | options | ||
| ) |
xmlCtxtReadFd: @ctxt: an XML parser context @fd: an open file descriptor @URL: the base URL to use for the document @encoding: the document encoding, or NULL @options: a combination of xmlParserOption
parse an XML from a file descriptor and build a tree. This reuses the existing @ctxt parser context NOTE that the file descriptor will not be closed when the reader is closed or reset.
Returns the resulting document tree
Definition at line 15074 of file parser.c.
| xmlDocPtr xmlCtxtReadFile | ( | xmlParserCtxtPtr | ctxt, |
| const char * | filename, | ||
| const char * | encoding, | ||
| int | options | ||
| ) |
xmlCtxtReadFile: @ctxt: an XML parser context @filename: a file or URL @encoding: the document encoding, or NULL @options: a combination of xmlParserOption
parse an XML file from the filesystem or the network. This reuses the existing @ctxt parser context
Returns the resulting document tree
Definition at line 14992 of file parser.c.
| xmlDocPtr xmlCtxtReadIO | ( | xmlParserCtxtPtr | ctxt, |
| xmlInputReadCallback | ioread, | ||
| xmlInputCloseCallback | ioclose, | ||
| void * | ioctx, | ||
| const char * | URL, | ||
| const char * | encoding, | ||
| int | options | ||
| ) |
xmlCtxtReadIO: @ctxt: an XML parser context @ioread: an I/O read function @ioclose: an I/O close function @ioctx: an I/O handler @URL: the base URL to use for the document @encoding: the document encoding, or NULL @options: a combination of xmlParserOption
parse an XML document from I/O functions and source and build a tree. This reuses the existing @ctxt parser context
Returns the resulting document tree
Definition at line 15118 of file parser.c.
| xmlDocPtr xmlCtxtReadMemory | ( | xmlParserCtxtPtr | ctxt, |
| const char * | buffer, | ||
| int | size, | ||
| const char * | URL, | ||
| const char * | encoding, | ||
| int | options | ||
| ) |
xmlCtxtReadMemory: @ctxt: an XML parser context @buffer: a pointer to a char array @size: the size of the array @URL: the base URL to use for the document @encoding: the document encoding, or NULL @options: a combination of xmlParserOption
parse an XML in-memory document and build a tree. This reuses the existing @ctxt parser context
Returns the resulting document tree
Definition at line 15028 of file parser.c.
| void xmlCtxtReset | ( | xmlParserCtxtPtr | ctxt | ) |
xmlCtxtReset: @ctxt: an XML parser context
Reset a parser context
Definition at line 14372 of file parser.c.
Referenced by xmlClearParserCtxt(), xmlCtxtReadDoc(), xmlCtxtReadFd(), xmlCtxtReadFile(), xmlCtxtReadIO(), xmlCtxtReadMemory(), and xmlCtxtResetPush().
| int xmlCtxtResetPush | ( | xmlParserCtxtPtr | ctxt, |
| const char * | chunk, | ||
| int | size, | ||
| const char * | filename, | ||
| const char * | encoding | ||
| ) |
xmlCtxtResetPush: @ctxt: an XML parser context @chunk: a pointer to an array of chars @size: number of chars in the array @filename: an optional file name or URI @encoding: the document encoding, or NULL
Reset a push parser context
Returns 0 in case of success and 1 in case of error
Definition at line 14480 of file parser.c.
xmlCtxtSetMaxAmplification: @ctxt: an XML parser context @maxAmpl: maximum amplification factor
To protect against exponential entity expansion ("billion laughs"), the size of serialized output is (roughly) limited to the input size multiplied by this factor. The default value is 5.
When working with documents making heavy use of entity expansion, it can be necessary to increase the value. For security reasons, this should only be considered when processing trusted input.
Definition at line 14717 of file parser.c.
xmlCtxtUseOptions: @ctxt: an XML parser context @options: 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.
Definition at line 14698 of file parser.c.
Referenced by xslt_doc_default_loader(), and xsltDocDefaultLoaderFunc().
xmlCtxtUseOptionsInternal: @ctxt: an XML parser context @options: a combination of xmlParserOption @encoding: the user provided encoding to use
Applies the options to the parser context
Returns 0 in case of success, the set of unknown or unimplemented options in case of error.
Definition at line 14564 of file parser.c.
Referenced by xmlCreateURLParserCtxt(), xmlCtxtUseOptions(), xmlDoRead(), and xmlParseInNodeContext().
|
static |
xmlDetectSAX2: @ctxt: an XML parser context
Do the SAX2 detection and specific initialization
Definition at line 856 of file parser.c.
Referenced by xmlParseBalancedChunkMemoryInternal(), xmlParseDocument(), xmlParseExternalEntityPrivate(), xmlParseExternalSubset(), xmlParseExtParsedEnt(), and xmlParseInNodeContext().
|
static |
xmlDoRead: @ctxt: an XML parser context @URL: the base URL to use for the document @encoding: the document encoding, or NULL @options: a combination of xmlParserOption @reuse: keep the context for reuse
Common front-end for the xmlRead functions
Returns the resulting document tree or NULL
Definition at line 14735 of file parser.c.
Referenced by xmlCtxtReadDoc(), xmlCtxtReadFd(), xmlCtxtReadFile(), xmlCtxtReadIO(), xmlCtxtReadMemory(), xmlReadDoc(), xmlReadFd(), xmlReadFile(), xmlReadIO(), and xmlReadMemory().
|
static |
xmlErrAttributeDup: @ctxt: an XML parser context @prefix: the attribute prefix @localname: the attribute localname
Handle a redefinition of attribute error
Definition at line 240 of file parser.c.
Referenced by xmlParserNsPush(), and xmlParseStartTag2().
| int xmlHasFeature | ( | xmlFeature | feature | ) |
xmlHasFeature: @feature: 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.
Definition at line 640 of file parser.c.
Definition at line 3362 of file parser.c.
Referenced by xmlParseNCNameComplex(), xmlParseNmtoken(), and xmlParseStringName().
Definition at line 3331 of file parser.c.
Referenced by xmlParseNCNameComplex(), and xmlParseStringName().
|
static |
xmlLoadEntityContent: @ctxt: an XML parser context @entity: an unloaded system entity
Load the original content of the given system entity from the ExternalID/SystemID given. This is to be used for Included in Literal http://www.w3.org/TR/REC-xml/#inliteral processing of entities references
Returns 0 in case of success and -1 in case of failure
Definition at line 8202 of file parser.c.
Referenced by xmlStringDecodeEntitiesInt().
|
static |
xmlParseAttribute2: @ctxt: an XML parser context @pref: the element prefix @elem: the element name @prefix: a xmlChar ** used to store the value of the attribute prefix @value: a xmlChar ** used to store the value of the attribute @len: an int * to save the length of the attribute @alloc: an int * to indicate if the attribute was allocated
parse an attribute in the new SAX2 framework.
Returns the attribute name, and the value in *value, .
Definition at line 9286 of file parser.c.
Referenced by xmlParseStartTag2().
| void xmlParseAttributeListDecl | ( | xmlParserCtxtPtr | ctxt | ) |
xmlParseAttributeListDecl: @ctxt: an XML parser context
DEPRECATED: Internal function, don't use.
Parse an attribute list declaration for an element. Always consumes '<!'.
[52] AttlistDecl ::= '<!ATTLIST' S Name AttDef* S? '>'
[53] AttDef ::= S Name S AttType S DefaultDecl
Definition at line 6130 of file parser.c.
Referenced by xmlParseMarkupDecl().
| int xmlParseAttributeType | ( | xmlParserCtxtPtr | ctxt, |
| xmlEnumerationPtr * | tree | ||
| ) |
xmlParseAttributeType: @ctxt: an XML parser context @tree: the enumeration tree built while parsing
DEPRECATED: Internal function, don't use.
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
Definition at line 6087 of file parser.c.
Referenced by xmlParseAttributeListDecl().
| xmlChar * xmlParseAttValue | ( | xmlParserCtxtPtr | ctxt | ) |
xmlParseAttValue: @ctxt: an XML parser context
DEPRECATED: Internal function, don't use.
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:
Returns the AttValue parsed or NULL. The value has to be freed by the caller.
Definition at line 4342 of file parser.c.
Referenced by xmlParseDefaultDecl().
|
static |
xmlParseAttValueComplex: @ctxt: an XML parser context @len: the resulting attribute len @normalize: whether to apply the inner normalization
parse a value for an attribute, this is the fallback function of xmlParseAttValue() when the attribute parsing requires handling of non-ASCII characters, or normalization compaction.
Returns the AttValue parsed or NULL. The value has to be freed by the caller.
Definition at line 4061 of file parser.c.
Referenced by xmlParseAttValueInternal().
|
static |
Definition at line 9121 of file parser.c.
Referenced by xmlParseAttribute2(), and xmlParseAttValue().
|
static |
xmlParseBalancedChunkMemoryInternal: @oldctxt: the existing parsing context @string: the input string in UTF8 or ISO-Latin (zero terminated) @user_data: the user data field for the parser context @lst: the return value for the set of parsed nodes
Parse a well-balanced chunk of an XML document called by the parser The allowed sequence for the Well Balanced Chunk is the one defined by the content production in the XML grammar:
[43] content ::= (element | CharData | Reference | CDSect | PI | Comment)*
Returns XML_ERR_OK if the chunk is well balanced, and the parser error code otherwise
In case recover is set to 1, the nodelist will not be empty even if the parsed chunk is not well balanced.
Definition at line 12935 of file parser.c.
Referenced by xmlParseReference().
| void xmlParseCDSect | ( | xmlParserCtxtPtr | ctxt | ) |
xmlParseCDSect: @ctxt: an XML parser context
DEPRECATED: Internal function, don't use.
Parse escaped pure raw content. Always consumes '<!['.
[18] CDSect ::= CDStart CData CDEnd
[19] CDStart ::= ''
[20] Data ::= (Char* - (Char* '' Char*))
[21] CDEnd ::= ']]>'
Definition at line 10117 of file parser.c.
Referenced by xmlParseContentInternal().
| void xmlParseCharData | ( | xmlParserCtxtPtr | ctxt, |
| ATTRIBUTE_UNUSED int | cdata | ||
| ) |
xmlParseCharData: @ctxt: an XML parser context @cdata: unused
DEPRECATED: Internal function, don't use.
Definition at line 4811 of file parser.c.
xmlParseCharDataComplex: @ctxt: an XML parser context @cdata: int indicating whether we are within a CDATA section
Always makes progress if the first char isn't '<' or '&'.
parse a CharData section.this is the fallback function of xmlParseCharData() when the parsing requires handling of non-ASCII characters.
Definition at line 4716 of file parser.c.
Referenced by xmlParseCharDataInternal().
xmlParseCharDataInternal: @ctxt: an XML parser context @partial: buffer may contain partial UTF-8 sequences
Parse character data. Always makes progress if the first char isn't '<' or '&'.
The right angle bracket (>) may be represented using the string ">", and must, for compatibility, be escaped using ">" 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 ::= [^<&]* - ([^<&]* ']]>' [^<&]*)
Definition at line 4562 of file parser.c.
Referenced by xmlParseCharData(), and xmlParseContentInternal().
| int xmlParseCharRef | ( | xmlParserCtxtPtr | ctxt | ) |
xmlParseCharRef: @ctxt: an XML parser context
DEPRECATED: Internal function, don't use.
Parse a numeric character reference. Always consumes '&'.
[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
Definition at line 2493 of file parser.c.
Referenced by xmlParseAttValueComplex(), and xmlParseReference().
| void xmlParseComment | ( | xmlParserCtxtPtr | ctxt | ) |
xmlParseComment: @ctxt: an XML parser context
DEPRECATED: Internal function, don't use.
Parse an XML (SGML) comment. Always consumes '<!'.
The spec says that "For compatibility, the string "–" (double-hyphen) must not occur within comments. "
[15] Comment ::= ''
Definition at line 5034 of file parser.c.
Referenced by xmlParseContentInternal(), xmlParseMarkupDecl(), and xmlParseMisc().
|
static |
xmlParseCommentComplex: @ctxt: an XML parser context @buf: the already parsed part of the buffer @len: number of bytes in the buffer @size: allocated size of the buffer
Skip an XML (SGML) comment The spec says that "For compatibility, the string "–" (double-hyphen) must not occur within comments. " This is the slow routine in case the accelerator for ascii didn't work
[15] Comment ::= ''
Definition at line 4905 of file parser.c.
Referenced by xmlParseComment().
|
static |
xmlParseConditionalSections @ctxt: an XML parser context
Parse a conditional section. Always consumes '<!['.
[61] conditionalSect ::= includeSect | ignoreSect [62] includeSect ::= '<![' S? 'INCLUDE' S? '[' extSubsetDecl ']]>' [63] ignoreSect ::= '<![' S? 'IGNORE' S? '[' ignoreSectContents* ']]>' [64] ignoreSectContents ::= Ignore ('<![' ignoreSectContents ']]>' Ignore)* [65] Ignore ::= Char* - (Char* ('<![' | ']]>') Char*)
Definition at line 6873 of file parser.c.
Referenced by xmlParseExternalSubset(), and xmlParseInternalSubset().
| void xmlParseContent | ( | xmlParserCtxtPtr | ctxt | ) |
xmlParseContent: @ctxt: an XML parser context
Parse a content sequence. Stops at EOF or '</'.
[43] content ::= (element | CharData | Reference | CDSect | PI | Comment)*
Definition at line 10294 of file parser.c.
Referenced by xmlParseBalancedChunkMemoryInternal(), xmlParseExternalEntityPrivate(), xmlParseExtParsedEnt(), and xmlParseInNodeContext().
|
static |
xmlParseContentInternal: @ctxt: an XML parser context
Parse a content sequence. Stops at EOF or '</'. Leaves checking of unexpected EOF to the caller.
Definition at line 10218 of file parser.c.
Referenced by xmlParseContent(), and xmlParseElement().
| int xmlParseCtxtExternalEntity | ( | xmlParserCtxtPtr | ctx, |
| const xmlChar * | URL, | ||
| const xmlChar * | ID, | ||
| xmlNodePtr * | lst | ||
| ) |
xmlParseCtxtExternalEntity: @ctx: the existing parsing context @URL: the URL for the entity to load @ID: the System ID for the entity to load @lst: the return value for the set of parsed nodes
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
Definition at line 12621 of file parser.c.
xmlParseDefaultDecl: @ctxt: an XML parser context @value: Receive a possible fixed default value for the attribute
DEPRECATED: Internal function, don't use.
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.
Definition at line 5829 of file parser.c.
Referenced by xmlParseAttributeListDecl().
| void xmlParseDocTypeDecl | ( | xmlParserCtxtPtr | ctxt | ) |
xmlParseDocTypeDecl: @ctxt: an XML parser context
DEPRECATED: Internal function, don't use.
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.
Definition at line 8466 of file parser.c.
Referenced by xmlParseDocument().
| int xmlParseDocument | ( | xmlParserCtxtPtr | ctxt | ) |
xmlParseDocument: @ctxt: 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.
Definition at line 11009 of file parser.c.
Referenced by doparse(), internal_parseBuffer(), xmlDoRead(), xslt_doc_default_loader(), and xsltDocDefaultLoaderFunc().
| void xmlParseElement | ( | xmlParserCtxtPtr | ctxt | ) |
xmlParseElement: @ctxt: an XML parser context
DEPRECATED: Internal function, don't use.
parse an XML element
[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.
Definition at line 10327 of file parser.c.
Referenced by xmlParseDocument().
| xmlElementContentPtr xmlParseElementChildrenContentDecl | ( | xmlParserCtxtPtr | ctxt, |
| int | inputchk | ||
| ) |
xmlParseElementChildrenContentDecl: @ctxt: an XML parser context @inputchk: the input used for the current entity, needed for boundary checks
DEPRECATED: Internal function, don't use.
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.
Definition at line 6693 of file parser.c.
|
static |
xmlParseElementChildrenContentDeclPriv: @ctxt: an XML parser context @inputchk: the input used for the current entity, needed for boundary checks @depth: the level of recursion
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.
Definition at line 6389 of file parser.c.
Referenced by xmlParseElementChildrenContentDecl(), xmlParseElementChildrenContentDeclPriv(), and xmlParseElementContentDecl().
| int xmlParseElementContentDecl | ( | xmlParserCtxtPtr | ctxt, |
| const xmlChar * | name, | ||
| xmlElementContentPtr * | result | ||
| ) |
Definition at line 6715 of file parser.c.
Referenced by xmlParseElementDecl().
| int xmlParseElementDecl | ( | xmlParserCtxtPtr | ctxt | ) |
xmlParseElementDecl: @ctxt: an XML parser context
DEPRECATED: Internal function, don't use.
Parse an element declaration. Always consumes '<!'.
[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
Definition at line 6762 of file parser.c.
Referenced by xmlParseMarkupDecl().
|
static |
xmlParseElementEnd: @ctxt: an XML parser context
Parse the end of an XML element. Always consumes '</'.
Definition at line 10483 of file parser.c.
Referenced by xmlParseContentInternal(), and xmlParseElement().
| xmlElementContentPtr xmlParseElementMixedContentDecl | ( | xmlParserCtxtPtr | ctxt, |
| int | inputchk | ||
| ) |
xmlParseElementMixedContentDecl: @ctxt: an XML parser context @inputchk: the input used for the current entity, needed for boundary checks
DEPRECATED: Internal function, don't use.
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
Definition at line 6264 of file parser.c.
Referenced by xmlParseElementContentDecl().
|
static |
xmlParseElementStart: @ctxt: an XML parser context
Parse the start of an XML element. Returns -1 in case of error, 0 if an opening tag was parsed, 1 if an empty element was parsed.
Always consumes '<'.
Definition at line 10359 of file parser.c.
Referenced by xmlParseContentInternal(), and xmlParseElement().
| xmlChar * xmlParseEncName | ( | xmlParserCtxtPtr | ctxt | ) |
xmlParseEncName: @ctxt: an XML parser context
DEPRECATED: Internal function, don't use.
parse the XML encoding name
[81] EncName ::= [A-Za-z] ([A-Za-z0-9._] | '-')*
Returns the encoding name value or NULL
Definition at line 10643 of file parser.c.
Referenced by xmlParseEncodingDecl().
xmlParseEncodingDecl: @ctxt: an XML parser context
DEPRECATED: Internal function, don't use.
parse the XML encoding declaration
[80] EncodingDecl ::= S 'encoding' Eq ('"' EncName '"' | "'" EncName "'")
this setups the conversion filters.
Returns the encoding value or NULL
Definition at line 10713 of file parser.c.
Referenced by xmlParseTextDecl(), and xmlParseXMLDecl().
|
static |
xmlParseEndTag2: @ctxt: an XML parser context line of the start tag @nsNr: number of namespaces on the start tag
Parse an end tag. Always consumes '</'.
[42] ETag ::= '</' Name S? '>'
With namespace
[NS 9] ETag ::= '</' QName S? '>'
Definition at line 10047 of file parser.c.
Referenced by xmlParseElementEnd().
| void xmlParseEntityDecl | ( | xmlParserCtxtPtr | ctxt | ) |
xmlParseEntityDecl: @ctxt: an XML parser context
DEPRECATED: Internal function, don't use.
Parse an entity declaration. Always consumes '<!'.
[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.
Definition at line 5551 of file parser.c.
Referenced by xmlParseMarkupDecl().
| xmlEntityPtr xmlParseEntityRef | ( | xmlParserCtxtPtr | ctxt | ) |
xmlParseEntityRef: @ctxt: an XML parser context
DEPRECATED: Internal function, don't use.
Parse an entitiy reference. Always consumes '&'.
[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.
Definition at line 7683 of file parser.c.
Referenced by xmlParseAttValueComplex(), and xmlParseReference().
xmlParseEntityValue: @ctxt: an XML parser context @orig: if non-NULL store a copy of the original entity value
DEPRECATED: Internal function, don't use.
parse a value for ENTITY declarations
[9] EntityValue ::= '"' ([^%&"] | PEReference | Reference)* '"' | "'" ([^%&'] | PEReference | Reference)* "'"
Returns the EntityValue parsed with reference substituted or NULL
Definition at line 3906 of file parser.c.
Referenced by xmlParseEntityDecl().
| int xmlParseEnumeratedType | ( | xmlParserCtxtPtr | ctxt, |
| xmlEnumerationPtr * | tree | ||
| ) |
xmlParseEnumeratedType: @ctxt: an XML parser context @tree: the enumeration tree built while parsing
DEPRECATED: Internal function, don't use.
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
Definition at line 6022 of file parser.c.
Referenced by xmlParseAttributeType().
| xmlEnumerationPtr xmlParseEnumerationType | ( | xmlParserCtxtPtr | ctxt | ) |
xmlParseEnumerationType: @ctxt: an XML parser context
DEPRECATED: Internal function, don't use.
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
Definition at line 5952 of file parser.c.
Referenced by xmlParseEnumeratedType().
|
static |
xmlParseExternalEntityPrivate: @doc: the document the chunk pertains to @oldctxt: the previous parser context if available @sax: the SAX handler block (possibly NULL) @user_data: The user data returned on SAX callbacks (possibly NULL) @depth: Used for loop detection, use 0 @URL: the URL for the entity to load @ID: the System ID for the entity to load @list: the return value for the set of parsed nodes
Private version of xmlParseExternalEntity()
Returns 0 if the entity is well formed, -1 in case of args problem and the parser error code otherwise
Definition at line 12658 of file parser.c.
Referenced by xmlParseCtxtExternalEntity(), and xmlParseReference().
xmlParseExternalID: @ctxt: an XML parser context @publicID: a xmlChar** receiving PubidLiteral @strict: indicate whether we should restrict parsing to only production [75], see NOTE below
DEPRECATED: Internal function, don't use.
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.
Definition at line 4840 of file parser.c.
Referenced by xmlParseDocTypeDecl(), xmlParseEntityDecl(), and xmlParseNotationDecl().
| void xmlParseExternalSubset | ( | xmlParserCtxtPtr | ctxt, |
| const xmlChar * | ExternalID, | ||
| const xmlChar * | SystemID | ||
| ) |
xmlParseExternalSubset: @ctxt: an XML parser context @ExternalID: the external identifier @SystemID: the system identifier (or URL)
parse Markup declarations from an external subset
[30] extSubset ::= textDecl? extSubsetDecl
[31] extSubsetDecl ::= (markupdecl | conditionalSect | PEReference | S) *
Definition at line 7160 of file parser.c.
Referenced by xmlSAX2ExternalSubset().
| int xmlParseExtParsedEnt | ( | xmlParserCtxtPtr | ctxt | ) |
xmlParseExtParsedEnt: @ctxt: 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.
Definition at line 11179 of file parser.c.
| xmlParserErrors xmlParseInNodeContext | ( | xmlNodePtr | node, |
| const char * | data, | ||
| int | datalen, | ||
| int | options, | ||
| xmlNodePtr * | lst | ||
| ) |
xmlParseInNodeContext: @node: the context node @data: the input string @datalen: the input string length in bytes @options: a combination of xmlParserOption @lst: the return value for the set of parsed nodes
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
Definition at line 13156 of file parser.c.
|
static |
xmlParseInternalSubset: @ctxt: an XML parser context
parse the internal subset declaration
[28 end] ('[' (markupdecl | PEReference | S)* ']' S?)? '>'
Definition at line 8538 of file parser.c.
Referenced by xmlParseDocument().
| void xmlParseMarkupDecl | ( | xmlParserCtxtPtr | ctxt | ) |
xmlParseMarkupDecl: @ctxt: an XML parser context
DEPRECATED: Internal function, don't use.
Parse markup declarations. Always consumes '<!' or '<?'.
[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.)
Definition at line 7020 of file parser.c.
Referenced by xmlParseConditionalSections(), xmlParseExternalSubset(), and xmlParseInternalSubset().
| void xmlParseMisc | ( | xmlParserCtxtPtr | ctxt | ) |
xmlParseMisc: @ctxt: an XML parser context
DEPRECATED: Internal function, don't use.
parse an XML Misc* optional field.
[27] Misc ::= Comment | PI | S
Definition at line 10979 of file parser.c.
Referenced by xmlParseDocument().
xmlParseName: @ctxt: an XML parser context
DEPRECATED: Internal function, don't use.
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
Definition at line 3529 of file parser.c.
Referenced by xmlParseAttributeListDecl(), xmlParseDocTypeDecl(), xmlParseElementChildrenContentDeclPriv(), xmlParseElementDecl(), xmlParseElementMixedContentDecl(), xmlParseEntityDecl(), xmlParseEntityRef(), xmlParseNameAndCompare(), xmlParseNotationDecl(), xmlParseNotationType(), xmlParsePEReference(), and xmlParsePITarget().
|
static |
xmlParseNameAndCompare: @ctxt: an XML parser context
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
Definition at line 3687 of file parser.c.
Referenced by xmlParseEndTag2(), and xmlParseQNameAndCompare().
Definition at line 3404 of file parser.c.
Referenced by xmlParseName().
|
static |
xmlParseNCName: @ctxt: an XML parser context @len: length of the string parsed
parse an XML name.
[4NS] NCNameChar ::= Letter | Digit | '.' | '-' | '_' | CombiningChar | Extender
[5NS] NCName ::= (Letter | '_') (NCNameChar)*
Returns the Name parsed or NULL
Definition at line 3629 of file parser.c.
Referenced by xmlParseQNameHashed().
|
static |
Definition at line 3574 of file parser.c.
Referenced by xmlParseNCName().
| xmlChar * xmlParseNmtoken | ( | xmlParserCtxtPtr | ctxt | ) |
xmlParseNmtoken: @ctxt: an XML parser context
DEPRECATED: Internal function, don't use.
parse an XML Nmtoken.
[7] Nmtoken ::= (NameChar)+
[8] Nmtokens ::= Nmtoken (#x20 Nmtoken)*
Returns the Nmtoken parsed or NULL
Definition at line 3821 of file parser.c.
Referenced by xmlParseEnumerationType(), and xmlParseQNameHashed().
| void xmlParseNotationDecl | ( | xmlParserCtxtPtr | ctxt | ) |
xmlParseNotationDecl: @ctxt: an XML parser context
DEPRECATED: Internal function, don't use.
Parse a notation declaration. Always consumes '<!'.
[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().
Definition at line 5468 of file parser.c.
Referenced by xmlParseMarkupDecl().
| xmlEnumerationPtr xmlParseNotationType | ( | xmlParserCtxtPtr | ctxt | ) |
xmlParseNotationType: @ctxt: an XML parser context
DEPRECATED: Internal function, don't use.
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
Definition at line 5881 of file parser.c.
Referenced by xmlParseEnumeratedType().
| void xmlParsePEReference | ( | xmlParserCtxtPtr | ctxt | ) |
xmlParsePEReference: @ctxt: an XML parser context
DEPRECATED: Internal function, don't use.
Parse a parameter entity reference. Always consumes ''.
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.
Definition at line 8063 of file parser.c.
Referenced by xmlParseInternalSubset(), xmlParserHandlePEReference(), and xmlSkipBlankChars().
| void xmlParsePI | ( | xmlParserCtxtPtr | ctxt | ) |
xmlParsePI: @ctxt: an XML parser context
DEPRECATED: Internal function, don't use.
parse an XML Processing Instruction.
[16] PI ::= '<?' PITarget (S (Char* - (Char* '?>' Char*)))? '?>'
The processing is transferred to SAX once parsed.
Definition at line 5322 of file parser.c.
Referenced by xmlParseContentInternal(), xmlParseMarkupDecl(), and xmlParseMisc().
xmlParsePITarget: @ctxt: an XML parser context
DEPRECATED: Internal function, don't use.
parse the name of a PI
[17] PITarget ::= Name - (('X' | 'x') ('M' | 'm') ('L' | 'l'))
Returns the PITarget name or NULL
Definition at line 5212 of file parser.c.
Referenced by xmlParsePI().
| xmlChar * xmlParsePubidLiteral | ( | xmlParserCtxtPtr | ctxt | ) |
xmlParsePubidLiteral: @ctxt: an XML parser context
DEPRECATED: Internal function, don't use.
parse an XML public literal
[12] PubidLiteral ::= '"' PubidChar* '"' | "'" (PubidChar - "'")* "'"
Returns the PubidLiteral parsed or NULL.
Definition at line 4442 of file parser.c.
Referenced by xmlParseExternalID().
xmlParseQName: @ctxt: an XML parser context @prefix: pointer to store the prefix part
parse an XML Namespace QName
[6] QName ::= (Prefix ':')? LocalPart [7] Prefix ::= NCName [8] LocalPart ::= NCName
Returns the Name parsed or NULL
Definition at line 9008 of file parser.c.
Referenced by xmlParseQNameAndCompare().
|
static |
Definition at line 9032 of file parser.c.
Referenced by xmlParseEndTag2().
|
static |
xmlParseQNameHashed: @ctxt: an XML parser context @prefix: pointer to store the prefix part
parse an XML Namespace QName
[6] QName ::= (Prefix ':')? LocalPart [7] Prefix ::= NCName [8] LocalPart ::= NCName
Returns the Name parsed or NULL
Definition at line 8948 of file parser.c.
Referenced by xmlParseAttribute2(), xmlParseQName(), and xmlParseStartTag2().
| void xmlParseReference | ( | xmlParserCtxtPtr | ctxt | ) |
xmlParseReference: @ctxt: an XML parser context
DEPRECATED: Internal function, don't use.
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.
Always consumes '&'.
[67] Reference ::= EntityRef | CharRef
Definition at line 7227 of file parser.c.
Referenced by xmlParseContentInternal().
xmlParserEntityCheck: @ctxt: parser context @extra: sum of unexpanded entity sizes
Check for non-linear entity expansion behaviour.
In some cases like xmlStringDecodeEntities, this function is called for each, possibly nested entity and its unexpanded content length.
In other cases like xmlParseReference, it's only called for each top-level entity with its unexpanded content length plus the sum of the unexpanded content lengths (plus fixed cost) of all nested entities.
Summing the unexpanded lengths also adds the length of the reference. This is by design. Taking the length of the entity name into account discourages attacks that try to waste CPU time with abusively long entity names. See test/recurse/lol6.xml for example. Each call also adds some fixed cost XML_ENT_FIXED_COST to discourage attacks with short entities.
Returns 1 on error, 0 on success.
Definition at line 580 of file parser.c.
Referenced by xmlParseAttValueComplex(), xmlParseReference(), xmlParseStartTag2(), xmlSkipBlankChars(), and xmlStringDecodeEntitiesInt().
| void xmlParserHandlePEReference | ( | xmlParserCtxtPtr | ctxt | ) |
xmlParserHandlePEReference: @ctxt: the parser context
DEPRECATED: Internal function, do not use.
[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.
Definition at line 2715 of file parser.c.
| xmlParserNsData * xmlParserNsCreate | ( | void | ) |
xmlParserNsCreate:
Create a new namespace database.
Returns the new obejct.
Definition at line 1413 of file parser.c.
Referenced by xmlInitSAXParserCtxt().
| void xmlParserNsFree | ( | xmlParserNsData * | nsdb | ) |
xmlParserNsFree: @nsdb: namespace database
Free a namespace database.
Definition at line 1431 of file parser.c.
Referenced by xmlFreeParserCtxt().
|
static |
xmlParserNsGrow: @ctxt: parser context
Grows the namespace tables.
Returns 0 on success, -1 if a memory allocation failed.
Definition at line 1631 of file parser.c.
Referenced by xmlParserNsPush().
|
static |
xmlParserNsLookup: @ctxt: parser context @prefix: namespace prefix @bucketPtr: optional bucket (return value)
Lookup namespace with given prefix. If @bucketPtr is non-NULL, it will be set to the matching bucket, or the first empty bucket if no match was found.
Returns the namespace index on success, INT_MAX if no namespace was found.
Definition at line 1490 of file parser.c.
Referenced by xmlParserNsLookupSax(), xmlParserNsLookupUri(), xmlParserNsPop(), xmlParserNsPush(), xmlParserNsUpdateSax(), and xmlParseStartTag2().
xmlParserNsLookupSax: @ctxt: parser context @prefix: namespace prefix
Lookup extra data for the given prefix. This returns data stored with xmlParserNsUdpateSax.
Returns the data on success, NULL if no namespace was found.
Definition at line 1569 of file parser.c.
Referenced by xmlSAX2AttributeNs(), and xmlSAX2StartElementNs().
|
static |
xmlParserNsLookupUri: @ctxt: parser context @prefix: namespace prefix
Lookup namespace URI with given prefix.
Returns the namespace URI on success, NULL if no namespace was found.
Definition at line 1541 of file parser.c.
Referenced by xmlParseBalancedChunkMemoryInternal(), and xmlParseStartTag2().
xmlParserNsPop: @ctxt: an XML parser context @nr: the number to pop
Pops the top @nr namespaces and restores the hash table.
Returns the number of namespaces popped.
Definition at line 1829 of file parser.c.
Referenced by xmlParseElementStart(), xmlParseEndTag2(), and xmlParseInNodeContext().
|
static |
xmlParserNsPush: @ctxt: parser context @prefix: prefix with hash value @uri: uri with hash value @saxData: extra data for SAX handler @defAttr: whether the namespace comes from a default attribute
Push a new namespace on the table.
Returns 1 if the namespace was pushed, 0 if the namespace was ignored, -1 if a memory allocation failed.
Definition at line 1672 of file parser.c.
Referenced by xmlParseBalancedChunkMemoryInternal(), xmlParseInNodeContext(), and xmlParseStartTag2().
|
static |
xmlParserNsReset: @nsdb: namespace database
Reset a namespace database.
Definition at line 1447 of file parser.c.
Referenced by xmlCtxtReset().
|
static |
xmlParserStartElement: @nsdb: namespace database
Signal that a new element has started.
Returns 0 on success, -1 if the element counter overflowed.
Definition at line 1468 of file parser.c.
Referenced by xmlParseStartTag2().
xmlParserNsUpdateSax: @ctxt: parser context @prefix: namespace prefix @saxData: extra data for SAX handler
Sets or updates extra data for the given prefix. This value will be returned by xmlParserNsLookupSax as long as the namespace with the given prefix is in scope.
Returns the data on success, NULL if no namespace was found.
Definition at line 1601 of file parser.c.
Referenced by xmlSAX2StartElementNs().
| int xmlParseSDDecl | ( | xmlParserCtxtPtr | ctxt | ) |
xmlParseSDDecl: @ctxt: an XML parser context
DEPRECATED: Internal function, don't use.
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:
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).
Definition at line 10792 of file parser.c.
Referenced by xmlParseXMLDecl().
|
static |
xmlParseStartTag2: @ctxt: an XML parser context
Parse a start tag. Always consumes '<'.
This routine is called when running SAX2 parsing
[40] STag ::= '<' Name (S Attribute)* S? '>'
[ WFC: Unique Att Spec ] No attribute name may appear more than once in the same start-tag or empty-element tag.
[44] EmptyElemTag ::= '<' Name (S Attribute)* S? '/>'
[ WFC: Unique Att Spec ] No attribute name may appear more than once in the same start-tag or empty-element tag.
With namespace:
[NS 8] STag ::= '<' QName (S Attribute)* S? '>'
[NS 10] EmptyElement ::= '<' QName (S Attribute)* S? '/>'
Returns the element name parsed
Definition at line 9478 of file parser.c.
Referenced by xmlParseElementStart().
xmlParseStringCharRef: @ctxt: an XML parser context @str: a pointer to an index in the string
parse Reference declarations, variant parsing from a string rather than an an input flow.
[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, str will be updated to the current value of the index
Definition at line 2605 of file parser.c.
Referenced by xmlStringDecodeEntitiesInt().
xmlParseStringEntityRef: @ctxt: an XML parser context @str: a pointer to an index in the string
parse ENTITY references declarations, but this version parses it from a string value.
[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. The str pointer is updated to the current location in the string.
Definition at line 7868 of file parser.c.
Referenced by xmlStringDecodeEntitiesInt().
xmlParseStringName: @ctxt: an XML parser context @str: a pointer to the string pointer (IN/OUT)
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. The @str pointer is updated to the current location in the string.
Definition at line 3735 of file parser.c.
Referenced by xmlParseEntityValue(), xmlParseStringEntityRef(), and xmlParseStringPEReference().
|
static |
xmlParseStringPEReference: @ctxt: an XML parser context @str: a pointer to an index in the string
parse PEReference declarations
[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.
Returns the string of the entity content. str is updated to the current value of the index
Definition at line 8367 of file parser.c.
Referenced by xmlStringDecodeEntitiesInt().
| xmlChar * xmlParseSystemLiteral | ( | xmlParserCtxtPtr | ctxt | ) |
xmlParseSystemLiteral: @ctxt: an XML parser context
DEPRECATED: Internal function, don't use.
parse an XML Literal
[11] SystemLiteral ::= ('"' [^"]* '"') | ("'" [^']* "'")
Returns the SystemLiteral parsed or NULL
Definition at line 4361 of file parser.c.
Referenced by xmlParseExternalID().
| void xmlParseTextDecl | ( | xmlParserCtxtPtr | ctxt | ) |
xmlParseTextDecl: @ctxt: an XML parser context
DEPRECATED: Internal function, don't use.
parse an XML declaration header for external entities
[77] TextDecl ::= '<?xml' VersionInfo? EncodingDecl S? '?>'
Definition at line 7074 of file parser.c.
Referenced by xmlLoadEntityContent(), xmlParseExternalEntityPrivate(), xmlParseExternalSubset(), and xmlParsePEReference().
| xmlChar * xmlParseVersionInfo | ( | xmlParserCtxtPtr | ctxt | ) |
xmlParseVersionInfo: @ctxt: an XML parser context
DEPRECATED: Internal function, don't use.
parse the XML version.
[24] VersionInfo ::= S 'version' Eq (' VersionNum ' | " VersionNum ")
Returns the version string, e.g. "1.0"
Definition at line 10597 of file parser.c.
Referenced by xmlParseTextDecl(), and xmlParseXMLDecl().
| xmlChar * xmlParseVersionNum | ( | xmlParserCtxtPtr | ctxt | ) |
xmlParseVersionNum: @ctxt: an XML parser context
DEPRECATED: Internal function, don't use.
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
Definition at line 10534 of file parser.c.
Referenced by xmlParseVersionInfo().
| void xmlParseXMLDecl | ( | xmlParserCtxtPtr | ctxt | ) |
xmlParseXMLDecl: @ctxt: an XML parser context
DEPRECATED: Internal function, don't use.
parse an XML declaration header
[23] XMLDecl ::= '<?xml' VersionInfo EncodingDecl? SDDecl? S? '?>'
Definition at line 10856 of file parser.c.
Referenced by xmlParseDocument(), and xmlParseExtParsedEnt().
| xmlChar xmlPopInput | ( | xmlParserCtxtPtr | ctxt | ) |
xmlPopInput: @ctxt: 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
Definition at line 2419 of file parser.c.
Referenced by xmlSAX2ExternalSubset(), and xmlSkipBlankChars().
| int xmlPushInput | ( | xmlParserCtxtPtr | ctxt, |
| xmlParserInputPtr | input | ||
| ) |
xmlPushInput: @ctxt: an XML parser context @input: 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
Definition at line 2449 of file parser.c.
Referenced by xmlParsePEReference(), and xmlSAX2ExternalSubset().
xmlReadDoc: @cur: a pointer to a zero terminated string @URL: the base URL to use for the document @encoding: the document encoding, or NULL @options: a combination of xmlParserOption
parse an XML in-memory document and build a tree.
Returns the resulting document tree
xmlReadFd: @fd: an open file descriptor @URL: the base URL to use for the document @encoding: the document encoding, or NULL @options: a combination of xmlParserOption
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
Definition at line 14860 of file parser.c.
xmlReadFile: @filename: a file or URL @encoding: the document encoding, or NULL @options: 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: @ioread: an I/O read function @ioclose: an I/O close function @ioctx: an I/O handler @URL: the base URL to use for the document @encoding: the document encoding, or NULL @options: a combination of xmlParserOption
parse an XML document from I/O functions and source and build a tree.
Returns the resulting document tree
Definition at line 14903 of file parser.c.
| xmlDocPtr xmlReadMemory | ( | const char * | buffer, |
| int | size, | ||
| const char * | URL, | ||
| const char * | encoding, | ||
| int | options | ||
| ) |
xmlReadMemory: @buffer: a pointer to a char array @size: the size of the array @URL: the base URL to use for the document @encoding: the document encoding, or NULL @options: a combination of xmlParserOption
parse an XML in-memory document and build a tree.
Returns the resulting document tree
Definition at line 14835 of file parser.c.
Referenced by parse_xml().
Definition at line 540 of file parser.c.
Referenced by xmlLoadEntityContent(), xmlParseBalancedChunkMemoryInternal(), xmlParseExternalEntityPrivate(), xmlParsePEReference(), xmlParserEntityCheck(), and xmlSkipBlankChars().
Definition at line 548 of file parser.c.
Referenced by xmlParseBalancedChunkMemoryInternal(), xmlParseExternalEntityPrivate(), xmlParsePEReference(), xmlParserEntityCheck(), and xmlSkipBlankChars().
| int xmlSkipBlankChars | ( | xmlParserCtxtPtr | ctxt | ) |
xmlSkipBlankChars: @ctxt: the XML parser context
DEPRECATED: Internal function, do not use.
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
Definition at line 2316 of file parser.c.
Namespaces.
Definition at line 3157 of file parser.c.
Referenced by xmlSAX2AttributeDecl().
| void xmlStopParser | ( | xmlParserCtxtPtr | ctxt | ) |
xmlStopParser: @ctxt: an XML parser context
Blocks further parser processing
Definition at line 12311 of file parser.c.
Referenced by format_error_message_from_id(), libxmlFatalError(), and xmlSwitchEncoding().
| xmlChar * xmlStringDecodeEntities | ( | xmlParserCtxtPtr | ctxt, |
| const xmlChar * | str, | ||
| int | what, | ||
| xmlChar | end, | ||
| xmlChar | end2, | ||
| xmlChar | end3 | ||
| ) |
xmlStringDecodeEntities: @ctxt: the parser context @str: the input string @what: combination of XML_SUBSTITUTE_REF and XML_SUBSTITUTE_PEREF @end: an end marker xmlChar, 0 if none @end2: an end marker xmlChar, 0 if none @end3: an end marker xmlChar, 0 if none
DEPRECATED: Internal function, don't use.
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 !
|
static |
xmlStringDecodeEntitiesInt: @ctxt: the parser context @str: the input string @len: the string length @what: combination of XML_SUBSTITUTE_REF and XML_SUBSTITUTE_PEREF @end: an end marker xmlChar, 0 if none @end2: an end marker xmlChar, 0 if none @end3: an end marker xmlChar, 0 if none @check: whether to perform entity checks
Definition at line 2801 of file parser.c.
Referenced by xmlParseAttValueComplex(), xmlParseEntityValue(), xmlStringDecodeEntities(), xmlStringDecodeEntitiesInt(), and xmlStringLenDecodeEntities().
| xmlChar * xmlStringLenDecodeEntities | ( | xmlParserCtxtPtr | ctxt, |
| const xmlChar * | str, | ||
| int | len, | ||
| int | what, | ||
| xmlChar | end, | ||
| xmlChar | end2, | ||
| xmlChar | end3 | ||
| ) |
xmlStringLenDecodeEntities: @ctxt: the parser context @str: the input string @len: the string length @what: combination of XML_SUBSTITUTE_REF and XML_SUBSTITUTE_PEREF @end: an end marker xmlChar, 0 if none @end2: an end marker xmlChar, 0 if none @end3: an end marker xmlChar, 0 if none
DEPRECATED: Internal function, don't use.
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 !
Definition at line 4511 of file parser.c.
Referenced by xmlParseCharDataInternal().
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.
Definition at line 162 of file parser.c.
Referenced by nodePush(), and xmlParseElementStart().
| const char* const xmlParserVersion = LIBXML_VERSION_STRING LIBXML_VERSION_EXTRA |