ReactOS 0.4.16-dev-814-g656a5dc
|
#include "libxml.h"
#include <stdlib.h>
#include <limits.h>
#include <string.h>
#include <stdarg.h>
#include <stddef.h>
#include <ctype.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 "buf.h"
#include "enc.h"
Go to the source code of this file.
Classes | |
struct | _xmlStartTag |
struct | _xmlDefAttrs |
Typedefs | |
typedef struct _xmlDefAttrs | xmlDefAttrs |
typedef xmlDefAttrs * | xmlDefAttrsPtr |
Variables | |
unsigned int | xmlParserMaxDepth = 256 |
static const char *const | xmlW3CPIs [] |
DICT_FREE: @str: a string
Free a string if it is not owned by the "dict" dictionary in the current scope
#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 2864 of file parser.c.
Referenced by xmlParseCharData(), and xmlParseCharDataComplex().
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 1774 of file parser.c.
Referenced by xmlCtxtReset(), xmlFreeParserCtxt(), xmlHaltParser(), xmlInitParserCtxt(), 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 1745 of file parser.c.
Referenced by testSAX(), xmlCreateEntityParserCtxtInternal(), xmlCreateIOParserCtxt(), xmlCreateMemoryParserCtxt(), xmlCreateURLParserCtxt(), xmlCtxtReadFd(), xmlCtxtReadFile(), xmlCtxtReadIO(), xmlCtxtReadMemory(), xmlCtxtResetPush(), xmlPushInput(), xmlReadFd(), xmlReadIO(), 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 593 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 1870 of file parser.c.
Referenced by xmlParseElementStart().
const xmlChar * namePop | ( | xmlParserCtxtPtr | ctxt | ) |
namePop: @ctxt: an XML parser context
Pops the top element name from the name stack
Returns the name just removed
Definition at line 1981 of file parser.c.
Referenced by xmlParseElementEnd(), and xmlParseElementStart().
int namePush | ( | xmlParserCtxtPtr | ctxt, |
const xmlChar * | value | ||
) |
namePush: @ctxt: an XML parser context @value: 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: @ctxt: an XML parser context
Pops the top element node from the node stack
Returns the node just removed
Definition at line 1839 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
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 1801 of file parser.c.
Referenced by xmlParseBalancedChunkMemoryInternal(), xmlParseExternalEntityPrivate(), xmlParseInNodeContext(), and xmlSAX2StartElementNs().
|
static |
nsPop: @ctxt: an XML parser context @nr: the number to pop
Pops the top @nr parser prefix/namespace from the ns stack
Returns the number of namespaces removed
Definition at line 1681 of file parser.c.
Referenced by xmlParseElementStart(), xmlParseEndTag2(), and xmlParseInNodeContext().
nsPush: @ctxt: an XML parser context @prefix: the namespace prefix or NULL @URL: the namespace name
Pushes a new parser namespace on top of the ns stack
Returns -1 in case of error, -2 if the namespace should be discarded and the index in the stack otherwise.
Definition at line 1631 of file parser.c.
Referenced by xmlParseBalancedChunkMemoryInternal(), xmlParseInNodeContext(), and xmlParseStartTag2().
|
static |
Definition at line 2016 of file parser.c.
Referenced by xmlParseElementStart(), and xmlParseEndTag2().
|
static |
|
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 1242 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 1353 of file parser.c.
Referenced by xmlParseAttributeListDecl().
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 1152 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 1185 of file parser.c.
Referenced by xmlParseAttribute2().
xmlCheckLanguageID: @lang: 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])+
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 1474 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 1401 of file parser.c.
Referenced by xmlParseDocument().
|
static |
xmlCleanSpecialAttrCallback:
Removes CDATA attributes from the special attribute table
Definition at line 1382 of file parser.c.
Referenced by xmlCleanSpecialAttr().
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 !
Definition at line 14739 of file parser.c.
Referenced by DllMain(), main(), and xmlInitParser().
xmlParserCtxtPtr xmlCreateDocParserCtxt | ( | const xmlChar * | cur | ) |
xmlCreateDocParserCtxt: @cur: 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 14542 of file parser.c.
Referenced by 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 14027 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 13954 of file parser.c.
Referenced by xmlCreateEntityParserCtxt(), and xmlParseExternalEntityPrivate().
xmlParserCtxtPtr xmlCreateFileParserCtxt | ( | const char * | filename | ) |
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 14093 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 12605 of file parser.c.
xmlParserCtxtPtr xmlCreateMemoryParserCtxt | ( | const char * | buffer, |
int | size | ||
) |
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 14339 of file parser.c.
Referenced by xmlCreateDocParserCtxt(), xmlParseBalancedChunkMemoryInternal(), xmlParseInNodeContext(), and xmlReadMemory().
xmlParserCtxtPtr xmlCreateURLParserCtxt | ( | const char * | filename, |
int | options | ||
) |
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 14051 of file parser.c.
Referenced by xmlCreateFileParserCtxt(), and xmlReadFile().
|
static |
Definition at line 1702 of file parser.c.
Referenced by xmlParseStartTag2().
xmlDocPtr xmlCtxtReadDoc | ( | xmlParserCtxtPtr | ctxt, |
const xmlChar * | cur, | ||
const char * | URL, | ||
const char * | encoding, | ||
int | options | ||
) |
xmlCtxtReadDoc: @ctxt: an XML parser context @cur: a pointer to a zero terminated string @URL: the base URL to use for the document @encoding: the document encoding, or NULL @options: a combination of xmlParserOption
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 15368 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 15471 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 15390 of file parser.c.
Referenced by parseAndPrintFile().
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 15515 of file parser.c.
Referenced by parseAndPrintFile().
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 15426 of file parser.c.
Referenced by parseAndPrintFile(), and xmlCtxtReadDoc().
void xmlCtxtReset | ( | xmlParserCtxtPtr | ctxt | ) |
xmlCtxtReset: @ctxt: an XML parser context
Reset a parser context
Definition at line 14801 of file parser.c.
Referenced by xmlClearParserCtxt(), 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 14907 of file parser.c.
int xmlCtxtUseOptions | ( | xmlParserCtxtPtr | ctxt, |
int | options | ||
) |
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 15141 of file parser.c.
Referenced by parseAndPrintFile(), and xsltDocDefaultLoaderFunc().
|
static |
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 15000 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 1094 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 15159 of file parser.c.
Referenced by 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 342 of file parser.c.
Referenced by xmlParseStartTag2().
|
static |
xmlFatalErr: @ctxt: an XML parser context @error: the error number @extra: extra information string
Handle a fatal parser error, i.e. violating Well-Formedness constraints
Definition at line 378 of file parser.c.
Referenced by xmlGROW(), xmlLoadEntityContent(), xmlParseAttValueComplex(), xmlParseAttValueInternal(), xmlParseBalancedChunkMemoryInternal(), xmlParseCDSect(), xmlParseCharData(), xmlParseCharDataComplex(), xmlParseCharRef(), xmlParseCommentComplex(), xmlParseConditionalSections(), xmlParseContentInternal(), xmlParseDocTypeDecl(), xmlParseDocument(), xmlParseElementChildrenContentDeclPriv(), xmlParseElementDecl(), xmlParseElementMixedContentDecl(), xmlParseEncName(), xmlParseEncodingDecl(), xmlParseEndTag2(), xmlParseEntityDecl(), xmlParseEntityRef(), xmlParseEntityValue(), xmlParseEnumerationType(), xmlParseExternalEntityPrivate(), xmlParseExternalID(), xmlParseExternalSubset(), xmlParseExtParsedEnt(), xmlParseInNodeContext(), xmlParseInternalSubset(), xmlParseName(), xmlParseNameComplex(), xmlParseNCName(), xmlParseNCNameComplex(), xmlParseNmtoken(), xmlParseNotationDecl(), xmlParseNotationType(), xmlParsePEReference(), xmlParsePI(), xmlParsePITarget(), xmlParsePubidLiteral(), xmlParseReference(), xmlParserEntityCheck(), xmlParserHandlePEReference(), xmlParseSDDecl(), xmlParseStartTag2(), xmlParseStringCharRef(), xmlParseStringEntityRef(), xmlParseStringName(), xmlParseStringPEReference(), xmlParseSystemLiteral(), xmlParseTextDecl(), xmlParseVersionInfo(), xmlParseXMLDecl(), xmlPopInput(), xmlPushInput(), and xmlStringLenDecodeEntities().
Referenced by xmlInitParser().
|
static |
Definition at line 8760 of file parser.c.
Referenced by xmlParseInNodeContext(), and xmlParseStartTag2().
|
static |
Definition at line 2121 of file parser.c.
|
static |
xmlHaltParser: @ctxt: an XML parser context
Blocks further parser processing don't override error for internal use
Definition at line 12549 of file parser.c.
Referenced by nodePush(), xmlGROW(), xmlParseConditionalSections(), xmlParseContentInternal(), xmlParseElementStart(), xmlParseEntityDecl(), xmlParseExternalSubset(), xmlParseReference(), and xmlStopParser().
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 874 of file parser.c.
Referenced by showVersion().
xmlInitParser:
Initialization function for the XML parser. This is not reentrant. Call once before processing in case of use in multithreaded programs.
Definition at line 14676 of file parser.c.
Referenced by DllMain(), xmlCheckVersion(), xmlCtxtReadFd(), xmlCtxtReadFile(), xmlCtxtReadIO(), xmlCtxtReadMemory(), xmlInitParserCtxt(), xmlParseDocument(), xmlReadDoc(), xmlReadFd(), xmlReadFile(), xmlReadIO(), and xmlReadMemory().
|
static |
Definition at line 3161 of file parser.c.
Referenced by xmlParseNCNameComplex(), xmlParseNmtoken(), and xmlParseStringName().
|
static |
Definition at line 3130 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 8060 of file parser.c.
Referenced by xmlStringLenDecodeEntities().
|
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 9125 of file parser.c.
Referenced by xmlParseStartTag2().
void xmlParseAttributeListDecl | ( | xmlParserCtxtPtr | ctxt | ) |
xmlParseAttributeListDecl: @ctxt: 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
Definition at line 5976 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
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 5934 of file parser.c.
Referenced by xmlParseAttributeListDecl().
xmlChar * xmlParseAttValue | ( | xmlParserCtxtPtr | ctxt | ) |
xmlParseAttValue: @ctxt: 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:
Returns the AttValue parsed or NULL. The value has to be freed by the caller.
Definition at line 4182 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 3921 of file parser.c.
Referenced by xmlParseAttValueInternal().
|
static |
Definition at line 8960 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 13303 of file parser.c.
Referenced by xmlParseReference().
void xmlParseCDSect | ( | xmlParserCtxtPtr | ctxt | ) |
xmlParseCDSect: @ctxt: an XML parser context
Parse escaped pure raw content.
[18] CDSect ::= CDStart CData CDEnd
[19] CDStart ::= ''
[20] Data ::= (Char* - (Char* '' Char*))
[21] CDEnd ::= ']]>'
Definition at line 9765 of file parser.c.
Referenced by xmlParseContentInternal().
void xmlParseCharData | ( | xmlParserCtxtPtr | ctxt, |
int | cdata | ||
) |
xmlParseCharData: @ctxt: an XML parser context @cdata: 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 ">", 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 4425 of file parser.c.
Referenced by xmlParseContentInternal().
|
static |
xmlParseCharDataComplex: @ctxt: an XML parser context @cdata: int indicating whether we are within a CDATA section
parse a CharData section.this is the fallback function of xmlParseCharData() when the parsing requires handling of non-ASCII characters.
Definition at line 4576 of file parser.c.
Referenced by xmlParseCharData().
int xmlParseCharRef | ( | xmlParserCtxtPtr | ctxt | ) |
xmlParseCharRef: @ctxt: 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
Definition at line 2332 of file parser.c.
Referenced by xmlParseAttValueComplex(), and xmlParseReference().
void xmlParseComment | ( | xmlParserCtxtPtr | ctxt | ) |
xmlParseComment: @ctxt: 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 ::= ''
Definition at line 4888 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 4750 of file parser.c.
Referenced by xmlParseComment().
|
static |
xmlParseConditionalSections @ctxt: an XML parser context
[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 6703 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 9958 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 9873 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 12968 of file parser.c.
int xmlParseDefaultDecl | ( | xmlParserCtxtPtr | ctxt, |
xmlChar ** | value | ||
) |
xmlParseDefaultDecl: @ctxt: an XML parser context @value: 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.
Definition at line 5682 of file parser.c.
Referenced by xmlParseAttributeListDecl().
void xmlParseDocTypeDecl | ( | xmlParserCtxtPtr | ctxt | ) |
xmlParseDocTypeDecl: @ctxt: 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.
Definition at line 8282 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 10697 of file parser.c.
Referenced by testSAX(), xmlDoRead(), and xsltDocDefaultLoaderFunc().
void xmlParseElement | ( | xmlParserCtxtPtr | ctxt | ) |
xmlParseElement: @ctxt: an XML parser context
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 9987 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
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 6533 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 6230 of file parser.c.
Referenced by xmlParseElementChildrenContentDecl(), xmlParseElementChildrenContentDeclPriv(), and xmlParseElementContentDecl().
int xmlParseElementContentDecl | ( | xmlParserCtxtPtr | ctxt, |
const xmlChar * | name, | ||
xmlElementContentPtr * | result | ||
) |
Definition at line 6553 of file parser.c.
Referenced by xmlParseElementDecl().
int xmlParseElementDecl | ( | xmlParserCtxtPtr | ctxt | ) |
xmlParseElementDecl: @ctxt: 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
Definition at line 6598 of file parser.c.
Referenced by xmlParseMarkupDecl().
|
static |
xmlParseElementEnd: @ctxt: an XML parser context
Parse the end of an XML element.
Definition at line 10144 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
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 6104 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.
Definition at line 10015 of file parser.c.
Referenced by xmlParseContentInternal(), and xmlParseElement().
xmlChar * xmlParseEncName | ( | xmlParserCtxtPtr | ctxt | ) |
xmlParseEncName: @ctxt: 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
Definition at line 10293 of file parser.c.
Referenced by xmlParseEncodingDecl().
const xmlChar * xmlParseEncodingDecl | ( | xmlParserCtxtPtr | ctxt | ) |
xmlParseEncodingDecl: @ctxt: 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
Definition at line 10358 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 of tag
[42] ETag ::= '</' Name S? '>'
With namespace
[NS 9] ETag ::= '</' QName S? '>'
Definition at line 9697 of file parser.c.
Referenced by xmlParseElementEnd().
void xmlParseEntityDecl | ( | xmlParserCtxtPtr | ctxt | ) |
xmlParseEntityDecl: @ctxt: 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.
Definition at line 5409 of file parser.c.
Referenced by xmlParseMarkupDecl().
xmlEntityPtr xmlParseEntityRef | ( | xmlParserCtxtPtr | ctxt | ) |
xmlParseEntityRef: @ctxt: 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.
Definition at line 7531 of file parser.c.
Referenced by xmlParseAttValueComplex(), and xmlParseReference().
xmlChar * xmlParseEntityValue | ( | xmlParserCtxtPtr | ctxt, |
xmlChar ** | orig | ||
) |
xmlParseEntityValue: @ctxt: an XML parser context @orig: 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
Definition at line 3767 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
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 5871 of file parser.c.
Referenced by xmlParseAttributeType().
xmlEnumerationPtr xmlParseEnumerationType | ( | xmlParserCtxtPtr | ctxt | ) |
xmlParseEnumerationType: @ctxt: 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
Definition at line 5802 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 13005 of file parser.c.
Referenced by xmlParseCtxtExternalEntity(), and xmlParseReference().
xmlChar * xmlParseExternalID | ( | xmlParserCtxtPtr | ctxt, |
xmlChar ** | publicID, | ||
int | strict | ||
) |
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
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 4683 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 6998 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 10889 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 13496 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 8354 of file parser.c.
Referenced by xmlParseDocument().
void xmlParseMarkupDecl | ( | xmlParserCtxtPtr | ctxt | ) |
xmlParseMarkupDecl: @ctxt: 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.)
Definition at line 6866 of file parser.c.
Referenced by xmlParseConditionalSections(), xmlParseExternalSubset(), and xmlParseInternalSubset().
void xmlParseMisc | ( | xmlParserCtxtPtr | ctxt | ) |
xmlParseMisc: @ctxt: an XML parser context
parse an XML Misc* optional field.
[27] Misc ::= Comment | PI | S
Definition at line 10667 of file parser.c.
Referenced by xmlParseDocument().
const xmlChar * xmlParseName | ( | xmlParserCtxtPtr | ctxt | ) |
xmlParseName: @ctxt: 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
Definition at line 3344 of file parser.c.
Referenced by xmlParseAttributeListDecl(), xmlParseDocTypeDecl(), xmlParseElementChildrenContentDeclPriv(), xmlParseElementDecl(), xmlParseElementMixedContentDecl(), xmlParseEntityDecl(), xmlParseEntityRef(), xmlParseNameAndCompare(), xmlParseNotationDecl(), xmlParseNotationType(), xmlParsePEReference(), xmlParsePITarget(), and xmlParseQName().
|
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 3525 of file parser.c.
Referenced by xmlParseEndTag2(), and xmlParseQNameAndCompare().
|
static |
Definition at line 3203 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 3465 of file parser.c.
Referenced by xmlParseQName().
|
static |
Definition at line 3391 of file parser.c.
Referenced by xmlParseNCName().
xmlChar * xmlParseNmtoken | ( | xmlParserCtxtPtr | ctxt | ) |
xmlParseNmtoken: @ctxt: an XML parser context
parse an XML Nmtoken.
[7] Nmtoken ::= (NameChar)+
[8] Nmtokens ::= Nmtoken (#x20 Nmtoken)*
Returns the Nmtoken parsed or NULL
Definition at line 3662 of file parser.c.
Referenced by xmlParseEnumerationType(), and xmlParseQName().
void xmlParseNotationDecl | ( | xmlParserCtxtPtr | ctxt | ) |
xmlParseNotationDecl: @ctxt: 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().
Definition at line 5331 of file parser.c.
Referenced by xmlParseMarkupDecl().
xmlEnumerationPtr xmlParseNotationType | ( | xmlParserCtxtPtr | ctxt | ) |
xmlParseNotationType: @ctxt: 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
Definition at line 5732 of file parser.c.
Referenced by xmlParseEnumeratedType().
void xmlParsePEReference | ( | xmlParserCtxtPtr | ctxt | ) |
xmlParsePEReference: @ctxt: 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.
Definition at line 7912 of file parser.c.
Referenced by xmlParseInternalSubset(), xmlParserHandlePEReference(), and xmlSkipBlankChars().
void xmlParsePI | ( | xmlParserCtxtPtr | ctxt | ) |
xmlParsePI: @ctxt: an XML parser context
parse an XML Processing Instruction.
[16] PI ::= '<?' PITarget (S (Char* - (Char* '?>' Char*)))? '?>'
The processing is transferred to SAX once parsed.
Definition at line 5174 of file parser.c.
Referenced by xmlParseContentInternal(), xmlParseMarkupDecl(), and xmlParseMisc().
const xmlChar * xmlParsePITarget | ( | xmlParserCtxtPtr | ctxt | ) |
xmlParsePITarget: @ctxt: 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
Definition at line 5066 of file parser.c.
Referenced by xmlParsePI().
xmlChar * xmlParsePubidLiteral | ( | xmlParserCtxtPtr | ctxt | ) |
xmlParsePubidLiteral: @ctxt: an XML parser context
parse an XML public literal
[12] PubidLiteral ::= '"' PubidChar* '"' | "'" (PubidChar - "'")* "'"
Returns the PubidLiteral parsed or NULL.
Definition at line 4291 of file parser.c.
Referenced by xmlParseExternalID().
|
static |
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 8788 of file parser.c.
Referenced by xmlParseAttribute2(), xmlParseQNameAndCompare(), and xmlParseStartTag2().
|
static |
Definition at line 8873 of file parser.c.
Referenced by xmlParseEndTag2().
void xmlParseReference | ( | xmlParserCtxtPtr | ctxt | ) |
xmlParseReference: @ctxt: 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
Definition at line 7078 of file parser.c.
Referenced by xmlParseContentInternal().
|
static |
Definition at line 128 of file parser.c.
Referenced by xmlParseEntityRef(), xmlParsePEReference(), xmlParseReference(), xmlParseStringEntityRef(), xmlParseStringPEReference(), and xmlStringLenDecodeEntities().
void xmlParserHandlePEReference | ( | xmlParserCtxtPtr | ctxt | ) |
xmlParserHandlePEReference: @ctxt: 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.
Definition at line 2550 of file parser.c.
int xmlParseSDDecl | ( | xmlParserCtxtPtr | ctxt | ) |
xmlParseSDDecl: @ctxt: 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:
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 10490 of file parser.c.
Referenced by xmlParseXMLDecl().
|
static |
xmlParseStartTag2: @ctxt: an XML parser context
parse a start of tag either for rule element or EmptyElement. In both case we don't parse the tag closing chars. 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 9256 of file parser.c.
Referenced by xmlParseElementStart().
|
static |
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 2442 of file parser.c.
Referenced by xmlStringLenDecodeEntities().
|
static |
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 7718 of file parser.c.
Referenced by xmlStringLenDecodeEntities().
|
static |
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 3573 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 8179 of file parser.c.
Referenced by xmlStringLenDecodeEntities().
xmlChar * xmlParseSystemLiteral | ( | xmlParserCtxtPtr | ctxt | ) |
xmlParseSystemLiteral: @ctxt: an XML parser context
parse an XML Literal
[11] SystemLiteral ::= ('"' [^"]* '"') | ("'" [^']* "'")
Returns the SystemLiteral parsed or NULL
Definition at line 4199 of file parser.c.
Referenced by xmlParseExternalID().
void xmlParseTextDecl | ( | xmlParserCtxtPtr | ctxt | ) |
xmlParseTextDecl: @ctxt: an XML parser context
parse an XML declaration header for external entities
[77] TextDecl ::= '<?xml' VersionInfo? EncodingDecl S? '?>'
Definition at line 6915 of file parser.c.
Referenced by xmlParseExternalEntityPrivate(), xmlParseExternalSubset(), and xmlParsePEReference().
xmlChar * xmlParseVersionInfo | ( | xmlParserCtxtPtr | ctxt | ) |
xmlParseVersionInfo: @ctxt: an XML parser context
parse the XML version.
[24] VersionInfo ::= S 'version' Eq (' VersionNum ' | " VersionNum ")
Returns the version string, e.g. "1.0"
Definition at line 10249 of file parser.c.
Referenced by xmlParseTextDecl(), and xmlParseXMLDecl().
xmlChar * xmlParseVersionNum | ( | xmlParserCtxtPtr | ctxt | ) |
xmlParseVersionNum: @ctxt: 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
Definition at line 10188 of file parser.c.
Referenced by xmlParseVersionInfo().
void xmlParseXMLDecl | ( | xmlParserCtxtPtr | ctxt | ) |
xmlParseXMLDecl: @ctxt: an XML parser context
parse an XML declaration header
[23] XMLDecl ::= '<?xml' VersionInfo EncodingDecl? SDDecl? S? '?>'
Definition at line 10552 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 2265 of file parser.c.
Referenced by xmlLoadEntityContent(), xmlParseInternalSubset(), 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 2290 of file parser.c.
Referenced by xmlLoadEntityContent(), 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
Definition at line 15204 of file parser.c.
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 15278 of file parser.c.
Referenced by parseAndPrintFile().
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
Definition at line 15229 of file parser.c.
Referenced by parseAndPrintFile().
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 15321 of file parser.c.
Referenced by parseAndPrintFile().
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 15253 of file parser.c.
Referenced by parseAndPrintFile().
|
static |
Definition at line 2111 of file parser.c.
int xmlSkipBlankChars | ( | xmlParserCtxtPtr | ctxt | ) |
xmlSkipBlankChars: @ctxt: 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
Definition at line 2184 of file parser.c.
xmlChar * xmlSplitQName | ( | xmlParserCtxtPtr | ctxt, |
const xmlChar * | name, | ||
xmlChar ** | prefix | ||
) |
Namespaces.
Definition at line 2946 of file parser.c.
Referenced by xmlSAX2AttributeDecl().
void xmlStopParser | ( | xmlParserCtxtPtr | ctxt | ) |
xmlStopParser: @ctxt: an XML parser context
Blocks further parser processing
Definition at line 12583 of file parser.c.
Referenced by xmlNextChar(), 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
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 2839 of file parser.c.
Referenced by xmlParseAttValueComplex(), xmlParseEntityValue(), xmlParserEntityCheck(), 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
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 2643 of file parser.c.
Referenced by xmlStringDecodeEntities().
Definition at line 4373 of file parser.c.
Referenced by xmlParseCharData().
|
static |
Definition at line 14665 of file parser.c.
Referenced by xmlCleanupParser(), and xmlInitParser().
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 270 of file parser.c.
Referenced by nodePush(), and xmlParseElementStart().