Eneboo - Documentación para desarrolladores
|
#include <libxml/xmlversion.h>
#include <libxml/parser.h>
#include <libxml/HTMLparser.h>
#include <libxml/chvalid.h>
Ir al código fuente de este archivo.
#define INPUT_CHUNK 250 |
INPUT_CHUNK:
The parser tries to always have that amount of input ready. One of the point is providing context when reporting errors.
#define IS_ASCII_DIGIT | ( | c | ) | ((0x30 <= (c)) && ((c) <= 0x39)) |
IS_ASCII_DIGIT: : an xmlChar value
Macro to check [0-9]
#define IS_ASCII_LETTER | ( | c | ) |
IS_BASECHAR: : an UNICODE value (int)
Macro to check the following production in the XML spec:
[85] BaseChar ::= ... long list see REC ...
IS_BLANK: : an UNICODE value (int)
Macro to check the following production in the XML spec:
[3] S ::= (#x20 | #x9 | #xD | #xA)+
IS_BLANK_CH: : an xmlChar value (normally unsigned char)
Behaviour same as IS_BLANK
IS_BYTE_CHAR: : an byte value (int)
Macro to check the following production in the XML spec:
[2] Char ::= #x9 | #xA | #xD | [#x20...] any byte character in the accepted range
IS_CHAR: : an UNICODE value (int)
Macro to check the following production in the XML spec:
[2] Char ::= #x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD] | [#x10000-#x10FFFF] any Unicode character, excluding the surrogate blocks, FFFE, and FFFF.
IS_CHAR_CH: : an xmlChar (usually an unsigned char)
Behaves like IS_CHAR on single-byte value
IS_COMBINING: : an UNICODE value (int)
Macro to check the following production in the XML spec:
[87] CombiningChar ::= ... long list see REC ...
#define IS_COMBINING_CH | ( | c | ) | 0 |
IS_COMBINING_CH: : an xmlChar (usually an unsigned char)
Always false (all combining chars > 0xff)
IS_DIGIT: : an UNICODE value (int)
Macro to check the following production in the XML spec:
[88] Digit ::= ... long list see REC ...
IS_DIGIT_CH: : an xmlChar value (usually an unsigned char)
Behaves like IS_DIGIT but with a single byte argument
IS_EXTENDER: : an UNICODE value (int)
Macro to check the following production in the XML spec:
[89] Extender ::= #x00B7 | #x02D0 | #x02D1 | #x0387 | #x0640 | #x0E46 | #x0EC6 | #x3005 | [#x3031-#x3035] | [#x309D-#x309E] | [#x30FC-#x30FE]
IS_EXTENDER_CH: : an xmlChar value (usually an unsigned char)
Behaves like IS_EXTENDER but with a single-byte argument
IS_IDEOGRAPHIC: : an UNICODE value (int)
Macro to check the following production in the XML spec:
[86] Ideographic ::= [#x4E00-#x9FA5] | #x3007 | [#x3021-#x3029]
IS_LETTER: : an UNICODE value (int)
Macro to check the following production in the XML spec:
[84] Letter ::= BaseChar | Ideographic
IS_LETTER_CH: : an xmlChar value (normally unsigned char)
Macro behaves like IS_LETTER, but only check base chars
IS_PUBIDCHAR: : an UNICODE value (int)
Macro to check the following production in the XML spec:
[13] PubidChar ::= #x20 | #xD | #xA | [a-zA-Z0-9] | [-'()+,./:=?;!*#$_%]
IS_PUBIDCHAR_CH: : an xmlChar value (normally unsigned char)
Same as IS_PUBIDCHAR but for single-byte value
#define MOVETO_ENDTAG | ( | p | ) | while ((*p) && (*(p) != '>')) (p)++ |
MOVETO_ENDTAG: : and UTF8 string pointer
Skips to the next '>' char.
#define MOVETO_STARTTAG | ( | p | ) | while ((*p) && (*(p) != '<')) (p)++ |
MOVETO_STARTTAG: : and UTF8 string pointer
Skips to the next '<' char.
#define SKIP_EOL | ( | p | ) |
#define XML_MAX_NAMELEN 100 |
XML_MAX_NAMELEN:
Identifiers can be longer, but this will be more costly at runtime.
#define XML_MAX_TEXT_LENGTH 10000000 |
XML_MAX_TEXT_LENGTH:
Maximum size allowed for a single text node when building a tree. This is not a limitation of the parser but a safety boundary feature, use XML_PARSE_HUGE option to override it.
#define XML_SUBSTITUTE_BOTH 3 |
XML_SUBSTITUTE_BOTH:
Both general and parameter entities need to be substituted.
#define XML_SUBSTITUTE_NONE 0 |
XML_SUBSTITUTE_NONE:
If no entities need to be substituted.
#define XML_SUBSTITUTE_PEREF 2 |
XML_SUBSTITUTE_PEREF:
Whether parameter entities need to be substituted.
#define XML_SUBSTITUTE_REF 1 |
XML_SUBSTITUTE_REF:
Whether general entities need to be substituted.
XMLPUBFUN xmlParserInputPtr XMLCALL inputPop | ( | xmlParserCtxtPtr | ctxt | ) |
inputPop: : an XML parser context
Pops the top parser input from the input stack
Returns the input just removed
XMLPUBFUN int XMLCALL inputPush | ( | xmlParserCtxtPtr | ctxt, |
xmlParserInputPtr | value | ||
) |
inputPush: : an XML parser context : the parser input
Pushes a new parser input on top of the input stack
Returns -1 in case of error, the index in the stack otherwise
XMLPUBFUN const xmlChar* XMLCALL namePop | ( | xmlParserCtxtPtr | ctxt | ) |
namePop: : an XML parser context
Pops the top element name from the name stack
Returns the name just removed
XMLPUBFUN int XMLCALL namePush | ( | xmlParserCtxtPtr | ctxt, |
const xmlChar * | value | ||
) |
namePush: : an XML parser context : the element name
Pushes a new element name on top of the name stack
Returns -1 in case of error, the index in the stack otherwise
XMLPUBFUN xmlNodePtr XMLCALL nodePop | ( | xmlParserCtxtPtr | ctxt | ) |
nodePop: : an XML parser context
Pops the top element node from the node stack
Returns the node just removed
XMLPUBFUN int XMLCALL nodePush | ( | xmlParserCtxtPtr | ctxt, |
xmlNodePtr | value | ||
) |
nodePush: : an XML parser context : the element node
Pushes a new element node on top of the node stack
Returns -1 in case of error, the index in the stack otherwise
xmlCheckLanguageID: : pointer to the string value
Checks that the value conforms to the LanguageID production:
NOTE: this is somewhat deprecated, those productions were removed from the XML Second edition.
[33] LanguageID ::= Langcode ('-' Subcode)* [34] Langcode ::= ISO639Code | IanaCode | UserCode [35] ISO639Code ::= ([a-z] | [A-Z]) ([a-z] | [A-Z]) [36] IanaCode ::= ('i' | 'I') '-' ([a-z] | [A-Z])+ [37] UserCode ::= ('x' | 'X') '-' ([a-z] | [A-Z])+ [38] Subcode ::= ([a-z] | [A-Z])+
Returns 1 if correct 0 otherwise
xmlCopyChar: : Ignored, compatibility : pointer to an array of xmlChar : the char value
append the char value in the array
Returns the number of xmlChar written
xmlCopyCharMultiByte: : pointer to an array of xmlChar : the char value
append the char value in the array
Returns the number of xmlChar written
XMLPUBFUN xmlParserCtxtPtr XMLCALL xmlCreateEntityParserCtxt | ( | const xmlChar * | URL, |
const xmlChar * | ID, | ||
const xmlChar * | base | ||
) |
xmlCreateEntityParserCtxt: : the entity URL : the entity PUBLIC ID : a possible base for the target URI
Create a parser context for an external entity Automatic support for ZLIB/Compress compressed document is provided by default if found at compile-time.
Returns the new parser context or NULL
XMLPUBFUN xmlParserCtxtPtr XMLCALL xmlCreateFileParserCtxt | ( | const char * | filename | ) |
Parser context.
xmlCreateFileParserCtxt: : the filename
Create a parser context for a file content. Automatic support for ZLIB/Compress compressed document is provided by default if found at compile-time.
Returns the new parser context or NULL
XMLPUBFUN xmlParserCtxtPtr XMLCALL xmlCreateMemoryParserCtxt | ( | const char * | buffer, |
int | size | ||
) |
xmlCreateMemoryParserCtxt: : a pointer to a char array : the size of the array
Create a parser context for an XML in-memory document.
Returns the new parser context or NULL
XMLPUBFUN xmlParserCtxtPtr XMLCALL xmlCreateURLParserCtxt | ( | const char * | filename, |
int | options | ||
) |
xmlCreateURLParserCtxt: : the filename or URL : a combination of xmlParserOption
Create a parser context for a file or URL content. Automatic support for ZLIB/Compress compressed document is provided by default if found at compile-time and for file accesses
Returns the new parser context or NULL
XMLPUBFUN int XMLCALL xmlCurrentChar | ( | xmlParserCtxtPtr | ctxt, |
int * | len | ||
) |
xmlCurrentChar: : the XML parser context : pointer to the length of the char read
The current char value, if using UTF-8 this may actually span multiple bytes in the input buffer. Implement the end of line normalization: 2.11 End-of-Line Handling Wherever an external parsed entity or the literal entity value of an internal parsed entity contains either the literal two-character sequence "#xD#xA" or a standalone literal #xD, an XML processor must pass to the application the single character #xA. This behavior can conveniently be produced by normalizing all line breaks to #xA on input, before parsing.)
Returns the current char value and its length
XMLPUBFUN void XMLCALL xmlFreeInputStream | ( | xmlParserInputPtr | input | ) |
xmlFreeInputStream: : an xmlParserInputPtr
Free up an input stream.
xmlIsLetter: : an unicode character (int)
Check whether the character is allowed by the production [84] Letter ::= BaseChar | Ideographic
Returns 0 if not, non-zero otherwise
XMLPUBFUN xmlParserInputPtr XMLCALL xmlNewEntityInputStream | ( | xmlParserCtxtPtr | ctxt, |
xmlEntityPtr | entity | ||
) |
xmlNewEntityInputStream: : an XML parser context : an Entity pointer
Create a new input stream based on an xmlEntityPtr
Returns the new input stream or NULL
XMLPUBFUN xmlParserInputPtr XMLCALL xmlNewInputFromFile | ( | xmlParserCtxtPtr | ctxt, |
const char * | filename | ||
) |
xmlNewInputFromFile: : an XML parser context : the filename to use as entity
Create a new input stream based on a file or an URL.
Returns the new input stream or NULL in case of error
XMLPUBFUN xmlParserInputPtr XMLCALL xmlNewInputStream | ( | xmlParserCtxtPtr | ctxt | ) |
xmlNewInputStream: : an XML parser context
Create a new input stream structure Returns the new input stream or NULL
XMLPUBFUN xmlParserInputPtr XMLCALL xmlNewStringInputStream | ( | xmlParserCtxtPtr | ctxt, |
const xmlChar * | buffer | ||
) |
Input Streams.
xmlNewStringInputStream: : an XML parser context : an memory buffer
Create a new input stream based on a memory buffer. Returns the new input stream
XMLPUBFUN void XMLCALL xmlNextChar | ( | xmlParserCtxtPtr | ctxt | ) |
xmlNextChar: : the XML parser context
Skip to the next char input char.
XMLPUBFUN void XMLCALL xmlParseAttributeListDecl | ( | xmlParserCtxtPtr | ctxt | ) |
XMLPUBFUN int XMLCALL xmlParseAttributeType | ( | xmlParserCtxtPtr | ctxt, |
xmlEnumerationPtr * | tree | ||
) |
xmlParseAttributeType: : an XML parser context : the enumeration tree built while parsing
parse the Attribute list def for an element
[54] AttType ::= StringType | TokenizedType | EnumeratedType
[55] StringType ::= 'CDATA'
[56] TokenizedType ::= 'ID' | 'IDREF' | 'IDREFS' | 'ENTITY' | 'ENTITIES' | 'NMTOKEN' | 'NMTOKENS'
Validity constraints for attribute values syntax are checked in xmlValidateAttributeValue()
[ VC: ID ] Values of type ID must match the Name production. A name must not appear more than once in an XML document as a value of this type; i.e., ID values must uniquely identify the elements which bear them.
[ VC: One ID per Element Type ] No element type may have more than one ID attribute specified.
[ VC: ID Attribute Default ] An ID attribute must have a declared default of #IMPLIED or #REQUIRED.
[ VC: IDREF ] Values of type IDREF must match the Name production, and values of type IDREFS must match Names; each IDREF Name must match the value of an ID attribute on some element in the XML document; i.e. IDREF values must match the value of some ID attribute.
[ VC: Entity Name ] Values of type ENTITY must match the Name production, values of type ENTITIES must match Names; each Entity Name must match the name of an unparsed entity declared in the DTD.
[ VC: Name Token ] Values of type NMTOKEN must match the Nmtoken production; values of type NMTOKENS must match Nmtokens.
Returns the attribute type
XMLPUBFUN xmlChar* XMLCALL xmlParseAttValue | ( | xmlParserCtxtPtr | ctxt | ) |
xmlParseAttValue: : an XML parser context
parse a value for an attribute Note: the parser won't do substitution of entities here, this will be handled later in xmlStringGetNodeList
[10] AttValue ::= '"' ([^<&"] | Reference)* '"' | "'" ([^<&'] | Reference)* "'"
3.3.3 Attribute-Value Normalization: Before the value of an attribute is passed to the application or checked for validity, the XML processor must normalize it as follows:
Returns the AttValue parsed or NULL. The value has to be freed by the caller.
XMLPUBFUN void XMLCALL xmlParseCDSect | ( | xmlParserCtxtPtr | ctxt | ) |
xmlParseCDSect: : an XML parser context
Parse escaped pure raw content.
[18] CDSect ::= CDStart CData CDEnd
[19] CDStart ::= '<![CDATA['
[20] Data ::= (Char* - (Char* ']]>' Char*))
[21] CDEnd ::= ']]>'
XMLPUBFUN void XMLCALL xmlParseCharData | ( | xmlParserCtxtPtr | ctxt, |
int | cdata | ||
) |
xmlParseCharData: : an XML parser context : int indicating whether we are within a CDATA section
parse a CharData section. if we are within a CDATA section ']]>' marks an end of section.
The right angle bracket (>) may be represented using the string ">", 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 ::= [^<&]* - ([^<&]* ']]>' [^<&]*)
XMLPUBFUN int XMLCALL xmlParseCharRef | ( | xmlParserCtxtPtr | ctxt | ) |
xmlParseCharRef: : an XML parser context
parse Reference declarations
[66] CharRef ::= '&#' [0-9]+ ';' | '&#x' [0-9a-fA-F]+ ';'
[ WFC: Legal Character ] Characters referred to using character references must match the production for Char.
Returns the value parsed (as an int), 0 in case of error
XMLPUBFUN void XMLCALL xmlParseComment | ( | xmlParserCtxtPtr | ctxt | ) |
xmlParseComment: : an XML parser context
Skip an XML (SGML) comment The spec says that "For compatibility, the string "--" (double-hyphen) must not occur within comments. "
[15] Comment ::= ''
XMLPUBFUN void XMLCALL xmlParseContent | ( | xmlParserCtxtPtr | ctxt | ) |
xmlParseContent: : an XML parser context
Parse a content:
[43] content ::= (element | CharData | Reference | CDSect | PI | Comment)*
XMLPUBFUN int XMLCALL xmlParseDefaultDecl | ( | xmlParserCtxtPtr | ctxt, |
xmlChar ** | value | ||
) |
xmlParseDefaultDecl: : an XML parser context : Receive a possible fixed default value for the attribute
Parse an attribute default declaration
[60] DefaultDecl ::= '#REQUIRED' | '#IMPLIED' | (('FIXED' S)? AttValue)
[ VC: Required Attribute ] if the default declaration is the keyword #REQUIRED, then the attribute must be specified for all elements of the type in the attribute-list declaration.
[ VC: Attribute Default Legal ] The declared default value must meet the lexical constraints of the declared attribute type c.f. xmlValidateAttributeDecl()
[ VC: Fixed Attribute Default ] if an attribute has a default value declared with the FIXED keyword, instances of that attribute must match the default value.
[ WFC: No < in Attribute Values ] handled in xmlParseAttValue()
returns: XML_ATTRIBUTE_NONE, XML_ATTRIBUTE_REQUIRED, XML_ATTRIBUTE_IMPLIED or XML_ATTRIBUTE_FIXED.
XMLPUBFUN void XMLCALL xmlParseDocTypeDecl | ( | xmlParserCtxtPtr | ctxt | ) |
XMLPUBFUN void XMLCALL xmlParseElement | ( | xmlParserCtxtPtr | ctxt | ) |
xmlParseElement: : an XML parser context
parse an XML element, this is highly recursive
[39] element ::= EmptyElemTag | STag content ETag
[ WFC: Element Type Match ] The Name in an element's end-tag must match the element type in the start-tag.
XMLPUBFUN xmlElementContentPtr XMLCALL xmlParseElementChildrenContentDecl | ( | xmlParserCtxtPtr | ctxt, |
int | inputchk | ||
) |
xmlParseElementChildrenContentDecl: : an XML parser context : the input used for the current entity, needed for boundary checks
parse the declaration for a Mixed Element content The leading '(' and spaces have been skipped in xmlParseElementContentDecl
[47] children ::= (choice | seq) ('?' | '*' | '+')?
[48] cp ::= (Name | choice | seq) ('?' | '*' | '+')?
[49] choice ::= '(' S? cp ( S? '|' S? cp )* S? ')'
[50] seq ::= '(' S? cp ( S? ',' S? cp )* S? ')'
[ VC: Proper Group/PE Nesting ] applies to [49] and [50] TODO Parameter-entity replacement text must be properly nested with parenthesized groups. That is to say, if either of the opening or closing parentheses in a choice, seq, or Mixed construct is contained in the replacement text for a parameter entity, both must be contained in the same replacement text. For interoperability, if a parameter-entity reference appears in a choice, seq, or Mixed construct, its replacement text should not be empty, and neither the first nor last non-blank character of the replacement text should be a connector (| or ,).
Returns the tree of xmlElementContentPtr describing the element hierarchy.
XMLPUBFUN int XMLCALL xmlParseElementContentDecl | ( | xmlParserCtxtPtr | ctxt, |
const xmlChar * | name, | ||
xmlElementContentPtr * | result | ||
) |
XMLPUBFUN int XMLCALL xmlParseElementDecl | ( | xmlParserCtxtPtr | ctxt | ) |
XMLPUBFUN xmlElementContentPtr XMLCALL xmlParseElementMixedContentDecl | ( | xmlParserCtxtPtr | ctxt, |
int | inputchk | ||
) |
xmlParseElementMixedContentDecl: : an XML parser context : the input used for the current entity, needed for boundary checks
parse the declaration for a Mixed Element content The leading '(' and spaces have been skipped in xmlParseElementContentDecl
[51] Mixed ::= '(' S? '#PCDATA' (S? '|' S? Name)* S? ')*' | '(' S? '#PCDATA' S? ')'
[ VC: Proper Group/PE Nesting ] applies to [51] too (see [49])
[ VC: No Duplicate Types ] The same name must not appear more than once in a single mixed-content declaration.
returns: the list of the xmlElementContentPtr describing the element choices
XMLPUBFUN xmlChar* XMLCALL xmlParseEncName | ( | xmlParserCtxtPtr | ctxt | ) |
xmlParseEncName: : an XML parser context
parse the XML encoding name
[81] EncName ::= [A-Za-z] ([A-Za-z0-9._] | '-')*
Returns the encoding name value or NULL
XMLPUBFUN const xmlChar* XMLCALL xmlParseEncodingDecl | ( | xmlParserCtxtPtr | ctxt | ) |
xmlParseEncodingDecl: : an XML parser context
parse the XML encoding declaration
[80] EncodingDecl ::= S 'encoding' Eq ('"' EncName '"' | "'" EncName "'")
this setups the conversion filters.
Returns the encoding value or NULL
XMLPUBFUN void XMLCALL xmlParseEntityDecl | ( | xmlParserCtxtPtr | ctxt | ) |
xmlParseEntityDecl: : an XML parser context
parse <!ENTITY declarations
[70] EntityDecl ::= GEDecl | PEDecl
[71] GEDecl ::= '<!ENTITY' S Name S EntityDef S? '>'
[72] PEDecl ::= '<!ENTITY' S '%' S Name S PEDef S? '>'
[73] EntityDef ::= EntityValue | (ExternalID NDataDecl?)
[74] PEDef ::= EntityValue | ExternalID
[76] NDataDecl ::= S 'NDATA' S Name
[ VC: Notation Declared ] The Name must match the declared name of a notation.
XMLPUBFUN xmlEntityPtr XMLCALL xmlParseEntityRef | ( | xmlParserCtxtPtr | ctxt | ) |
xmlParseEntityRef: : an XML parser context
parse ENTITY references declarations
[68] EntityRef ::= '&' Name ';'
[ WFC: Entity Declared ] In a document without any DTD, a document with only an internal DTD subset which contains no parameter entity references, or a document with "standalone='yes'", the Name given in the entity reference must match that in an entity declaration, except that well-formed documents need not declare any of the following entities: amp, lt, gt, apos, quot. The declaration of a parameter entity must precede any reference to it. Similarly, the declaration of a general entity must precede any reference to it which appears in a default value in an attribute-list declaration. Note that if entities are declared in the external subset or in external parameter entities, a non-validating processor is not obligated to read and process their declarations; for such documents, the rule that an entity must be declared is a well-formedness constraint only if standalone='yes'.
[ WFC: Parsed Entity ] An entity reference must not contain the name of an unparsed entity
Returns the xmlEntityPtr if found, or NULL otherwise.
XMLPUBFUN xmlChar* XMLCALL xmlParseEntityValue | ( | xmlParserCtxtPtr | ctxt, |
xmlChar ** | orig | ||
) |
xmlParseEntityValue: : an XML parser context : if non-NULL store a copy of the original entity value
parse a value for ENTITY declarations
[9] EntityValue ::= '"' ([^%&"] | PEReference | Reference)* '"' | "'" ([^%&'] | PEReference | Reference)* "'"
Returns the EntityValue parsed with reference substituted or NULL
XMLPUBFUN int XMLCALL xmlParseEnumeratedType | ( | xmlParserCtxtPtr | ctxt, |
xmlEnumerationPtr * | tree | ||
) |
xmlParseEnumeratedType: : an XML parser context : the enumeration tree built while parsing
parse an Enumerated attribute type.
[57] EnumeratedType ::= NotationType | Enumeration
[58] NotationType ::= 'NOTATION' S '(' S? Name (S? '|' S? Name)* S? ')'
Returns: XML_ATTRIBUTE_ENUMERATION or XML_ATTRIBUTE_NOTATION
XMLPUBFUN xmlEnumerationPtr XMLCALL xmlParseEnumerationType | ( | xmlParserCtxtPtr | ctxt | ) |
xmlParseEnumerationType: : an XML parser context
parse an Enumeration attribute type.
[59] Enumeration ::= '(' S? Nmtoken (S? '|' S? Nmtoken)* S? ')'
[ VC: Enumeration ] Values of this type must match one of the Nmtoken tokens in the declaration
Returns: the enumeration attribute tree built while parsing
XMLPUBFUN xmlChar* XMLCALL xmlParseExternalID | ( | xmlParserCtxtPtr | ctxt, |
xmlChar ** | publicID, | ||
int | strict | ||
) |
xmlParseExternalID: : an XML parser context : a xmlChar** receiving PubidLiteral : indicate whether we should restrict parsing to only production [75], see NOTE below
Parse an External ID or a Public ID
NOTE: Productions [75] and [83] interact badly since [75] can generate 'PUBLIC' S PubidLiteral S SystemLiteral
[75] ExternalID ::= 'SYSTEM' S SystemLiteral | 'PUBLIC' S PubidLiteral S SystemLiteral
[83] PublicID ::= 'PUBLIC' S PubidLiteral
Returns the function returns SystemLiteral and in the second case publicID receives PubidLiteral, is strict is off it is possible to return NULL and have publicID set.
XMLPUBFUN void XMLCALL xmlParseExternalSubset | ( | xmlParserCtxtPtr | ctxt, |
const xmlChar * | ExternalID, | ||
const xmlChar * | SystemID | ||
) |
xmlParseExternalSubset: : an XML parser context : the external identifier : the system identifier (or URL)
parse Markup declarations from an external subset
[30] extSubset ::= textDecl? extSubsetDecl
[31] extSubsetDecl ::= (markupdecl | conditionalSect | PEReference | S) *
XMLPUBFUN void XMLCALL xmlParseMarkupDecl | ( | xmlParserCtxtPtr | ctxt | ) |
xmlParseMarkupDecl: : an XML parser context
parse Markup declarations
[29] markupdecl ::= elementdecl | AttlistDecl | EntityDecl | NotationDecl | PI | Comment
[ VC: Proper Declaration/PE Nesting ] Parameter-entity replacement text must be properly nested with markup declarations. That is to say, if either the first character or the last character of a markup declaration (markupdecl above) is contained in the replacement text for a parameter-entity reference, both must be contained in the same replacement text.
[ WFC: PEs in Internal Subset ] In the internal DTD subset, parameter-entity references can occur only where markup declarations can occur, not within markup declarations. (This does not apply to references that occur in external parameter entities or to the external subset.)
XMLPUBFUN void XMLCALL xmlParseMisc | ( | xmlParserCtxtPtr | ctxt | ) |
xmlParseMisc: : an XML parser context
parse an XML Misc* optional field.
[27] Misc ::= Comment | PI | S
XMLPUBFUN const xmlChar* XMLCALL xmlParseName | ( | xmlParserCtxtPtr | ctxt | ) |
Generic production rules.
xmlParseName: : an XML parser context
parse an XML name.
[4] NameChar ::= Letter | Digit | '.' | '-' | '_' | ':' | CombiningChar | Extender
[5] Name ::= (Letter | '_' | ':') (NameChar)*
[6] Names ::= Name (#x20 Name)*
Returns the Name parsed or NULL
XMLPUBFUN xmlChar* XMLCALL xmlParseNmtoken | ( | xmlParserCtxtPtr | ctxt | ) |
xmlParseNmtoken: : an XML parser context
parse an XML Nmtoken.
[7] Nmtoken ::= (NameChar)+
[8] Nmtokens ::= Nmtoken (#x20 Nmtoken)*
Returns the Nmtoken parsed or NULL
XMLPUBFUN void XMLCALL xmlParseNotationDecl | ( | xmlParserCtxtPtr | ctxt | ) |
xmlParseNotationDecl: : an XML parser context
parse a notation declaration
[82] NotationDecl ::= '<!NOTATION' S Name S (ExternalID | PublicID) S? '>'
Hence there is actually 3 choices: 'PUBLIC' S PubidLiteral 'PUBLIC' S PubidLiteral S SystemLiteral and 'SYSTEM' S SystemLiteral
See the NOTE on xmlParseExternalID().
XMLPUBFUN xmlEnumerationPtr XMLCALL xmlParseNotationType | ( | xmlParserCtxtPtr | ctxt | ) |
xmlParseNotationType: : an XML parser context
parse an Notation attribute type.
Note: the leading 'NOTATION' S part has already being parsed...
[58] NotationType ::= 'NOTATION' S '(' S? Name (S? '|' S? Name)* S? ')'
[ VC: Notation Attributes ] Values of this type must match one of the notation names included in the declaration; all notation names in the declaration must be declared.
Returns: the notation attribute tree built while parsing
XMLPUBFUN void XMLCALL xmlParsePEReference | ( | xmlParserCtxtPtr | ctxt | ) |
xmlParsePEReference: : an XML parser context
parse PEReference declarations The entity content is handled directly by pushing it's content as a new input stream.
[69] PEReference ::= '%' Name ';'
[ WFC: No Recursion ] A parsed entity must not contain a recursive reference to itself, either directly or indirectly.
[ WFC: Entity Declared ] In a document without any DTD, a document with only an internal DTD subset which contains no parameter entity references, or a document with "standalone='yes'", ... ... The declaration of a parameter entity must precede any reference to it...
[ VC: Entity Declared ] In a document with an external subset or external parameter entities with "standalone='no'", ... ... The declaration of a parameter entity must precede any reference to it...
[ WFC: In DTD ] Parameter-entity references may only appear in the DTD. NOTE: misleading but this is handled.
XMLPUBFUN void XMLCALL xmlParsePI | ( | xmlParserCtxtPtr | ctxt | ) |
xmlParsePI: : an XML parser context
parse an XML Processing Instruction.
[16] PI ::= '<?' PITarget (S (Char* - (Char* '?>' Char*)))? '?>'
The processing is transfered to SAX once parsed.
XMLPUBFUN const xmlChar* XMLCALL xmlParsePITarget | ( | xmlParserCtxtPtr | ctxt | ) |
xmlParsePITarget: : an XML parser context
parse the name of a PI
[17] PITarget ::= Name - (('X' | 'x') ('M' | 'm') ('L' | 'l'))
Returns the PITarget name or NULL
XMLPUBFUN xmlChar* XMLCALL xmlParsePubidLiteral | ( | xmlParserCtxtPtr | ctxt | ) |
xmlParsePubidLiteral: : an XML parser context
parse an XML public literal
[12] PubidLiteral ::= '"' PubidChar* '"' | "'" (PubidChar - "'")* "'"
Returns the PubidLiteral parsed or NULL.
XMLPUBFUN void XMLCALL xmlParseReference | ( | xmlParserCtxtPtr | ctxt | ) |
xmlParseReference: : an XML parser context
parse and handle entity references in content, depending on the SAX interface, this may end-up in a call to character() if this is a CharRef, a predefined entity, if there is no reference() callback. or if the parser was asked to switch to that mode.
[67] Reference ::= EntityRef | CharRef
XMLPUBFUN void XMLCALL xmlParserHandlePEReference | ( | xmlParserCtxtPtr | ctxt | ) |
xmlParserHandlePEReference: : the parser context
[69] PEReference ::= '%' Name ';'
[ WFC: No Recursion ] A parsed entity must not contain a recursive reference to itself, either directly or indirectly.
[ WFC: Entity Declared ] In a document without any DTD, a document with only an internal DTD subset which contains no parameter entity references, or a document with "standalone='yes'", ... ... The declaration of a parameter entity must precede any reference to it...
[ VC: Entity Declared ] In a document with an external subset or external parameter entities with "standalone='no'", ... ... The declaration of a parameter entity must precede any reference to it...
[ WFC: In DTD ] Parameter-entity references may only appear in the DTD. NOTE: misleading but this is handled.
A PEReference may have been detected in the current input stream the handling is done accordingly to http://www.w3.org/TR/REC-xml#entproc i.e.
XMLPUBFUN void XMLCALL xmlParserInputShrink | ( | xmlParserInputPtr | in | ) |
xmlParserInputShrink: : an XML parser input
This function removes used input for the parser.
XMLPUBFUN int XMLCALL xmlParseSDDecl | ( | xmlParserCtxtPtr | ctxt | ) |
xmlParseSDDecl: : an XML parser context
parse the XML standalone declaration
[32] SDDecl ::= S 'standalone' Eq (("'" ('yes' | 'no') "'") | ('"' ('yes' | 'no')'"'))
[ VC: Standalone Document Declaration ] TODO The standalone document declaration must have the value "no" if any external markup declarations contain declarations of:
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).
XMLPUBFUN xmlChar* XMLCALL xmlParseSystemLiteral | ( | xmlParserCtxtPtr | ctxt | ) |
xmlParseSystemLiteral: : an XML parser context
parse an XML Literal
[11] SystemLiteral ::= ('"' [^"]* '"') | ("'" [^']* "'")
Returns the SystemLiteral parsed or NULL
XMLPUBFUN void XMLCALL xmlParseTextDecl | ( | xmlParserCtxtPtr | ctxt | ) |
xmlParseTextDecl: : an XML parser context
parse an XML declaration header for external entities
[77] TextDecl ::= '<?xml' VersionInfo? EncodingDecl S? '?>'
XMLPUBFUN xmlChar* XMLCALL xmlParseVersionInfo | ( | xmlParserCtxtPtr | ctxt | ) |
XMLPUBFUN xmlChar* XMLCALL xmlParseVersionNum | ( | xmlParserCtxtPtr | ctxt | ) |
xmlParseVersionNum: : an XML parser context
parse the XML version value.
[26] VersionNum ::= '1.' [0-9]+
In practice allow [0-9].[0-9]+ at that level
Returns the string giving the XML version number, or NULL
XMLPUBFUN void XMLCALL xmlParseXMLDecl | ( | xmlParserCtxtPtr | ctxt | ) |
xmlParseXMLDecl: : an XML parser context
parse an XML declaration header
[23] XMLDecl ::= '<?xml' VersionInfo EncodingDecl? SDDecl? S? '?>'
XMLPUBFUN xmlChar XMLCALL xmlPopInput | ( | xmlParserCtxtPtr | ctxt | ) |
xmlPopInput: : an XML parser context
xmlPopInput: the current input pointed by ctxt->input came to an end pop it and return the next char.
Returns the current xmlChar in the parser context
XMLPUBFUN int XMLCALL xmlPushInput | ( | xmlParserCtxtPtr | ctxt, |
xmlParserInputPtr | input | ||
) |
xmlPushInput: : an XML parser context : an XML parser input fragment (entity, XML fragment ...).
xmlPushInput: switch to a new input stream which is stacked on top of the previous one(s). Returns -1 in case of error or the index in the input stack
XMLPUBFUN int XMLCALL xmlSkipBlankChars | ( | xmlParserCtxtPtr | ctxt | ) |
xmlSkipBlankChars: : the XML parser context
skip all blanks character found at that point in the input streams. It pops up finished entities in the process if allowable at that point.
Returns the number of space chars skipped
XMLPUBFUN xmlChar* XMLCALL xmlSplitQName | ( | xmlParserCtxtPtr | ctxt, |
const xmlChar * | name, | ||
xmlChar ** | prefix | ||
) |
Namespaces.
XMLPUBFUN int XMLCALL xmlStringCurrentChar | ( | xmlParserCtxtPtr | ctxt, |
const xmlChar * | cur, | ||
int * | len | ||
) |
xmlStringCurrentChar: : the XML parser context : pointer to the beginning of the char : pointer to the length of the char read
The current char value, if using UTF-8 this may actually span multiple bytes in the input buffer.
Returns the current char value and its length
XMLPUBFUN xmlChar* XMLCALL xmlStringDecodeEntities | ( | xmlParserCtxtPtr | ctxt, |
const xmlChar * | str, | ||
int | what, | ||
xmlChar | end, | ||
xmlChar | end2, | ||
xmlChar | end3 | ||
) |
xmlStringDecodeEntities: : the parser context : the input string : combination of XML_SUBSTITUTE_REF and XML_SUBSTITUTE_PEREF : an end marker xmlChar, 0 if none : an end marker xmlChar, 0 if none : an end marker xmlChar, 0 if none
Takes a entity string content and process to do the adequate substitutions.
[67] Reference ::= EntityRef | CharRef
[69] PEReference ::= '%' Name ';'
Returns A newly allocated string with the substitution done. The caller must deallocate it !
XMLPUBFUN xmlChar* XMLCALL xmlStringLenDecodeEntities | ( | xmlParserCtxtPtr | ctxt, |
const xmlChar * | str, | ||
int | len, | ||
int | what, | ||
xmlChar | end, | ||
xmlChar | end2, | ||
xmlChar | end3 | ||
) |
xmlStringLenDecodeEntities: : the parser context : the input string : the string length : combination of XML_SUBSTITUTE_REF and XML_SUBSTITUTE_PEREF : an end marker xmlChar, 0 if none : an end marker xmlChar, 0 if none : an end marker xmlChar, 0 if none
Takes a entity string content and process to do the adequate substitutions.
[67] Reference ::= EntityRef | CharRef
[69] PEReference ::= '%' Name ';'
Returns A newly allocated string with the substitution done. The caller must deallocate it !
XMLPUBFUN int XMLCALL xmlSwitchEncoding | ( | xmlParserCtxtPtr | ctxt, |
xmlCharEncoding | enc | ||
) |
xmlSwitchEncoding: : the parser context : the encoding value (number)
change the input functions when discovering the character encoding of a given entity.
Returns 0 in case of success, -1 otherwise
XMLPUBFUN int XMLCALL xmlSwitchInputEncoding | ( | xmlParserCtxtPtr | ctxt, |
xmlParserInputPtr | input, | ||
xmlCharEncodingHandlerPtr | handler | ||
) |
xmlSwitchInputEncoding: : the parser context : the input stream : the encoding handler
change the input functions when discovering the character encoding of a given entity.
Returns 0 in case of success, -1 otherwise
XMLPUBFUN int XMLCALL xmlSwitchToEncoding | ( | xmlParserCtxtPtr | ctxt, |
xmlCharEncodingHandlerPtr | handler | ||
) |
xmlSwitchToEncoding: : the parser context : the encoding handler
change the input functions when discovering the character encoding of a given entity.
Returns 0 in case of success, -1 otherwise
XMLPUBVAR unsigned int xmlParserMaxDepth |
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, use XML_PARSE_HUGE option to override it.
XMLPUBVAR const xmlChar xmlStringComment[] |
XMLPUBVAR const xmlChar xmlStringText[] |
Global variables used for predefined strings.
XMLPUBVAR const xmlChar xmlStringTextNoenc[] |