libxml2
Loading...
Searching...
No Matches
parserInternals.h File Reference

Internals routines and limits exported by the parser. More...

Macros

#define inputPush   xmlCtxtPushInput
 Push an input on the stack.
#define inputPop   xmlCtxtPopInput
 Pop an input from the stack.
#define xmlParserMaxDepth   256
 Maximum element nesting depth (without XML_PARSE_HUGE).
#define XML_MAX_TEXT_LENGTH   10000000
 Maximum size allowed for a single text node when building a tree.
#define XML_MAX_HUGE_LENGTH   1000000000
 Maximum size allowed when XML_PARSE_HUGE is set.
#define XML_MAX_NAME_LENGTH   50000
 Maximum size allowed for a markup identifier.
#define XML_MAX_DICTIONARY_LIMIT   100000000
 Maximum size allowed by the parser for a dictionary by default This is not a limitation of the parser but a safety boundary feature, use XML_PARSE_HUGE option to override it.
#define XML_MAX_LOOKUP_LIMIT   10000000
 Maximum size allowed by the parser for ahead lookup This is an upper boundary enforced by the parser to avoid bad behaviour on "unfriendly' content Introduced in 2.9.0.
#define XML_MAX_NAMELEN   100
 Identifiers can be longer, but this will be more costly at runtime.
#define IS_BYTE_CHAR(c)
 Macro to check the following production in the XML spec:
#define IS_CHAR(c)
 Macro to check the following production in the XML spec:
#define IS_CHAR_CH(c)
 Behaves like IS_CHAR on single-byte value.
#define IS_BLANK(c)
 Macro to check the following production in the XML spec:
#define IS_BLANK_CH(c)
 Behaviour same as IS_BLANK.
#define IS_BASECHAR(c)
 Macro to check the following production in the XML spec:
#define IS_DIGIT(c)
 Macro to check the following production in the XML spec:
#define IS_DIGIT_CH(c)
 Behaves like IS_DIGIT but with a single byte argument.
#define IS_COMBINING(c)
 Macro to check the following production in the XML spec:
#define IS_COMBINING_CH(c)
 Always false (all combining chars > 0xff)
#define IS_EXTENDER(c)
 Macro to check the following production in the XML spec:
#define IS_EXTENDER_CH(c)
 Behaves like IS_EXTENDER but with a single-byte argument.
#define IS_IDEOGRAPHIC(c)
 Macro to check the following production in the XML spec:
#define IS_LETTER(c)
 Macro to check the following production in the XML spec:
#define IS_LETTER_CH(c)
 Macro behaves like IS_LETTER, but only check base chars.
#define IS_ASCII_LETTER(c)
 Macro to check [a-zA-Z].
#define IS_ASCII_DIGIT(c)
 Macro to check [0-9].
#define IS_PUBIDCHAR(c)
 Macro to check the following production in the XML spec:
#define IS_PUBIDCHAR_CH(c)
 Same as IS_PUBIDCHAR but for single-byte value.

Functions

int xmlIsLetter (int c)
 Check whether the character is allowed by the production.
xmlParserCtxtxmlCreateFileParserCtxt (const char *filename)
 Create a parser context for a file content.
xmlParserCtxtxmlCreateURLParserCtxt (const char *filename, int options)
 Create a parser context for a file or URL content.
xmlParserCtxtxmlCreateMemoryParserCtxt (const char *buffer, int size)
 Create a parser context for an XML in-memory document.
xmlParserCtxtxmlCreateEntityParserCtxt (const xmlChar *URL, const xmlChar *ID, const xmlChar *base)
 Create a parser context for an external entity Automatic support for ZLIB/Compress compressed document is provided by default if found at compile-time.
void xmlCtxtErrMemory (xmlParserCtxt *ctxt)
 Handle an out-of-memory error.
int xmlSwitchEncoding (xmlParserCtxt *ctxt, xmlCharEncoding enc)
 Use encoding specified by enum to decode input data.
int xmlSwitchEncodingName (xmlParserCtxt *ctxt, const char *encoding)
 Use specified encoding to decode input data.
int xmlSwitchToEncoding (xmlParserCtxt *ctxt, xmlCharEncodingHandler *handler)
 Use encoding handler to decode input data.
int xmlSwitchInputEncoding (xmlParserCtxt *ctxt, xmlParserInput *input, xmlCharEncodingHandler *handler)
 Use encoding handler to decode input data.
xmlParserInputxmlNewStringInputStream (xmlParserCtxt *ctxt, const xmlChar *buffer)
 Create a new input stream based on a memory buffer.
xmlParserInputxmlNewEntityInputStream (xmlParserCtxt *ctxt, xmlEntity *entity)
 Create a new input stream based on an xmlEntity.
int xmlCtxtPushInput (xmlParserCtxt *ctxt, xmlParserInput *input)
 Pushes a new parser input on top of the input stack.
xmlParserInputxmlCtxtPopInput (xmlParserCtxt *ctxt)
 Pops the top parser input from the input stack.
int xmlPushInput (xmlParserCtxt *ctxt, xmlParserInput *input)
 Push an input stream onto the stack.
xmlChar xmlPopInput (xmlParserCtxt *ctxt)
void xmlFreeInputStream (xmlParserInput *input)
 Free up an input stream.
xmlParserInputxmlNewInputFromFile (xmlParserCtxt *ctxt, const char *filename)
 Create a new input stream based on a file or an URL.
xmlParserInputxmlNewInputStream (xmlParserCtxt *ctxt)
 Create a new input stream structure.
xmlCharxmlSplitQName (xmlParserCtxt *ctxt, const xmlChar *name, xmlChar **prefix)
 Parse an UTF8 encoded XML qualified name string.
const xmlCharxmlParseName (xmlParserCtxt *ctxt)
 Parse an XML name.
xmlCharxmlParseNmtoken (xmlParserCtxt *ctxt)
 Parse an XML Nmtoken.
xmlCharxmlParseEntityValue (xmlParserCtxt *ctxt, xmlChar **orig)
 Parse a value for ENTITY declarations.
xmlCharxmlParseAttValue (xmlParserCtxt *ctxt)
 Parse a value for an attribute Note: the parser won't do substitution of entities here, this will be handled later in xmlStringGetNodeList.
xmlCharxmlParseSystemLiteral (xmlParserCtxt *ctxt)
 Parse an XML Literal.
xmlCharxmlParsePubidLiteral (xmlParserCtxt *ctxt)
 Parse an XML public literal.
void xmlParseCharData (xmlParserCtxt *ctxt, int cdata)
xmlCharxmlParseExternalID (xmlParserCtxt *ctxt, xmlChar **publicId, int strict)
 Parse an External ID or a Public ID.
void xmlParseComment (xmlParserCtxt *ctxt)
 Parse an XML (SGML) comment.
const xmlCharxmlParsePITarget (xmlParserCtxt *ctxt)
 Parse the name of a PI.
void xmlParsePI (xmlParserCtxt *ctxt)
 Parse an XML Processing Instruction.
void xmlParseNotationDecl (xmlParserCtxt *ctxt)
 Parse a notation declaration.
void xmlParseEntityDecl (xmlParserCtxt *ctxt)
 Parse an entity declaration.
int xmlParseDefaultDecl (xmlParserCtxt *ctxt, xmlChar **value)
 Parse an attribute default declaration.
xmlEnumerationxmlParseNotationType (xmlParserCtxt *ctxt)
 Parse an Notation attribute type.
xmlEnumerationxmlParseEnumerationType (xmlParserCtxt *ctxt)
 Parse an Enumeration attribute type.
int xmlParseEnumeratedType (xmlParserCtxt *ctxt, xmlEnumeration **tree)
 Parse an Enumerated attribute type.
int xmlParseAttributeType (xmlParserCtxt *ctxt, xmlEnumeration **tree)
 Parse the Attribute list def for an element.
void xmlParseAttributeListDecl (xmlParserCtxt *ctxt)
 Parse an attribute list declaration for an element.
xmlElementContentxmlParseElementMixedContentDecl (xmlParserCtxt *ctxt, int inputchk)
 Parse the declaration for a Mixed Element content The leading '(' and spaces have been skipped in xmlParseElementContentDecl.
xmlElementContentxmlParseElementChildrenContentDecl (xmlParserCtxt *ctxt, int inputchk)
 Parse the declaration for a Mixed Element content The leading '(' and spaces have been skipped in xmlParseElementContentDecl.
int xmlParseElementContentDecl (xmlParserCtxt *ctxt, const xmlChar *name, xmlElementContent **result)
 Parse the declaration for an Element content either Mixed or Children, the cases EMPTY and ANY are handled directly in xmlParseElementDecl.
int xmlParseElementDecl (xmlParserCtxt *ctxt)
 Parse an element declaration.
void xmlParseMarkupDecl (xmlParserCtxt *ctxt)
 Parse markup declarations.
int xmlParseCharRef (xmlParserCtxt *ctxt)
 Parse a numeric character reference.
xmlEntityxmlParseEntityRef (xmlParserCtxt *ctxt)
void xmlParseReference (xmlParserCtxt *ctxt)
 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.
void xmlParsePEReference (xmlParserCtxt *ctxt)
 Parse a parameter entity reference.
void xmlParseDocTypeDecl (xmlParserCtxt *ctxt)
 Parse a DOCTYPE declaration.
const xmlCharxmlParseAttribute (xmlParserCtxt *ctxt, xmlChar **value)
 Parse an attribute.
const xmlCharxmlParseStartTag (xmlParserCtxt *ctxt)
 Parse a start tag.
void xmlParseEndTag (xmlParserCtxt *ctxt)
 Parse an end of tag.
void xmlParseCDSect (xmlParserCtxt *ctxt)
 Parse escaped pure raw content.
void xmlParseContent (xmlParserCtxt *ctxt)
 Parse XML element content.
void xmlParseElement (xmlParserCtxt *ctxt)
 Parse an XML element.
xmlCharxmlParseVersionNum (xmlParserCtxt *ctxt)
 Parse the XML version value.
xmlCharxmlParseVersionInfo (xmlParserCtxt *ctxt)
 Parse the XML version.
xmlCharxmlParseEncName (xmlParserCtxt *ctxt)
 Parse the XML encoding name.
const xmlCharxmlParseEncodingDecl (xmlParserCtxt *ctxt)
 Parse the XML encoding declaration.
int xmlParseSDDecl (xmlParserCtxt *ctxt)
 Parse the XML standalone declaration.
void xmlParseXMLDecl (xmlParserCtxt *ctxt)
 Parse an XML declaration header.
void xmlParseTextDecl (xmlParserCtxt *ctxt)
 Parse an XML declaration header for external entities.
void xmlParseMisc (xmlParserCtxt *ctxt)
 Parse an XML Misc* optional field.
void xmlParseExternalSubset (xmlParserCtxt *ctxt, const xmlChar *publicId, const xmlChar *systemId)
 Parse Markup declarations from an external subset.
xmlCharxmlStringDecodeEntities (xmlParserCtxt *ctxt, const xmlChar *str, int what, xmlChar end, xmlChar end2, xmlChar end3)
xmlCharxmlStringLenDecodeEntities (xmlParserCtxt *ctxt, const xmlChar *str, int len, int what, xmlChar end, xmlChar end2, xmlChar end3)
int xmlSkipBlankChars (xmlParserCtxt *ctxt)
 Skip whitespace in the input stream.
int xmlStringCurrentChar (xmlParserCtxt *ctxt, const xmlChar *cur, int *len)
 The current char value, if using UTF-8 this may actually span multiple bytes in the input buffer.
void xmlParserHandlePEReference (xmlParserCtxt *ctxt)
int xmlCheckLanguageID (const xmlChar *lang)
 Checks that the value conforms to the LanguageID production:
int xmlCurrentChar (xmlParserCtxt *ctxt, int *len)
 The current char value, if using UTF-8 this may actually span multiple bytes in the input buffer.
int xmlCopyCharMultiByte (xmlChar *out, int val)
 append the char value in the array
int xmlCopyChar (int len, xmlChar *out, int val)
 append the char value in the array
void xmlNextChar (xmlParserCtxt *ctxt)
 Skip to the next char input char.
void xmlParserInputShrink (xmlParserInput *in)
 This function removes used input for the parser.

Detailed Description

Internals routines and limits exported by the parser.

Except for some I/O-related functions, most of these macros and functions are deprecated.

Author
Daniel Veillard

Macro Definition Documentation

◆ inputPop

#define inputPop   xmlCtxtPopInput

Pop an input from the stack.

Deprecated
Use xmlCtxtPushInput

◆ inputPush

#define inputPush   xmlCtxtPushInput

Push an input on the stack.

Deprecated
Use xmlCtxtPushInput

◆ IS_ASCII_DIGIT

#define IS_ASCII_DIGIT ( c)
Value:
((0x30 <= (c)) && ((c) <= 0x39))

Macro to check [0-9].

Parameters
can xmlChar value

◆ IS_ASCII_LETTER

#define IS_ASCII_LETTER ( c)
Value:
((0x61 <= ((c) | 0x20)) && \
(((c) | 0x20) <= 0x7a))

Macro to check [a-zA-Z].

Parameters
can xmlChar value

◆ IS_BASECHAR

#define IS_BASECHAR ( c)
Value:
#define xmlIsBaseCharQ(c)
Automatically generated by genChRanges.py.
Definition chvalid.h:81

Macro to check the following production in the XML spec:

[85] BaseChar ::= ... long list see REC ...
Parameters
can UNICODE value (int)

◆ IS_BLANK

#define IS_BLANK ( c)
Value:
#define xmlIsBlankQ(c)
Automatically generated by genChRanges.py.
Definition chvalid.h:99

Macro to check the following production in the XML spec:

[3] S ::= (#x20 | #x9 | #xD | #xA)+
Parameters
can UNICODE value (int)

◆ IS_BLANK_CH

#define IS_BLANK_CH ( c)
Value:
#define xmlIsBlank_ch(c)
Automatically generated by genChRanges.py.
Definition chvalid.h:90

Behaviour same as IS_BLANK.

Parameters
can xmlChar value (normally unsigned char)

◆ IS_BYTE_CHAR

#define IS_BYTE_CHAR ( c)
Value:
#define xmlIsChar_ch(c)
Automatically generated by genChRanges.py.
Definition chvalid.h:108

Macro to check the following production in the XML spec:

[2] Char ::= #x9 | #xA | #xD | [#x20...]

any byte character in the accepted range

Parameters
can byte value (int)

◆ IS_CHAR

#define IS_CHAR ( c)
Value:
#define xmlIsCharQ(c)
Automatically generated by genChRanges.py.
Definition chvalid.h:117

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.

Parameters
can UNICODE value (int)

◆ IS_CHAR_CH

#define IS_CHAR_CH ( c)
Value:

Behaves like IS_CHAR on single-byte value.

Parameters
can xmlChar (usually an unsigned char)

◆ IS_COMBINING

#define IS_COMBINING ( c)
Value:
#define xmlIsCombiningQ(c)
Automatically generated by genChRanges.py.
Definition chvalid.h:128

Macro to check the following production in the XML spec:

[87] CombiningChar ::= ... long list see REC ...
Parameters
can UNICODE value (int)

◆ IS_COMBINING_CH

#define IS_COMBINING_CH ( c)
Value:
0

Always false (all combining chars > 0xff)

Parameters
can xmlChar (usually an unsigned char)

◆ IS_DIGIT

#define IS_DIGIT ( c)
Value:
#define xmlIsDigitQ(c)
Automatically generated by genChRanges.py.
Definition chvalid.h:144

Macro to check the following production in the XML spec:

[88] Digit ::= ... long list see REC ...
Parameters
can UNICODE value (int)

◆ IS_DIGIT_CH

#define IS_DIGIT_CH ( c)
Value:
#define xmlIsDigit_ch(c)
Automatically generated by genChRanges.py.
Definition chvalid.h:137

Behaves like IS_DIGIT but with a single byte argument.

Parameters
can xmlChar value (usually an unsigned char)

◆ IS_EXTENDER

#define IS_EXTENDER ( c)
Value:
#define xmlIsExtenderQ(c)
Automatically generated by genChRanges.py.
Definition chvalid.h:160

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]
Parameters
can UNICODE value (int)

◆ IS_EXTENDER_CH

#define IS_EXTENDER_CH ( c)
Value:
#define xmlIsExtender_ch(c)
Automatically generated by genChRanges.py.
Definition chvalid.h:153

Behaves like IS_EXTENDER but with a single-byte argument.

Parameters
can xmlChar value (usually an unsigned char)

◆ IS_IDEOGRAPHIC

#define IS_IDEOGRAPHIC ( c)
Value:
#define xmlIsIdeographicQ(c)
Automatically generated by genChRanges.py.
Definition chvalid.h:169

Macro to check the following production in the XML spec:

[86] Ideographic ::= [#x4E00-#x9FA5] | #x3007 | [#x3021-#x3029]
Parameters
can UNICODE value (int)

◆ IS_LETTER

#define IS_LETTER ( c)
Value:
#define IS_IDEOGRAPHIC(c)
Macro to check the following production in the XML spec:
Definition parserInternals.h:200
#define IS_BASECHAR(c)
Macro to check the following production in the XML spec:
Definition parserInternals.h:145

Macro to check the following production in the XML spec:

[84] Letter ::= BaseChar | Ideographic
Parameters
can UNICODE value (int)

◆ IS_LETTER_CH

#define IS_LETTER_CH ( c)
Value:
#define xmlIsBaseChar_ch(c)
Automatically generated by genChRanges.py.
Definition chvalid.h:70

Macro behaves like IS_LETTER, but only check base chars.

Parameters
can xmlChar value (normally unsigned char)

◆ IS_PUBIDCHAR

#define IS_PUBIDCHAR ( c)
Value:
#define xmlIsPubidCharQ(c)
Automatically generated by genChRanges.py.
Definition chvalid.h:187

Macro to check the following production in the XML spec:

[13] PubidChar ::= #x20 | #xD | #xA | [a-zA-Z0-9] |
                   [-'()+,./:=?;!*#@$_%]
Parameters
can UNICODE value (int)

◆ IS_PUBIDCHAR_CH

#define IS_PUBIDCHAR_CH ( c)
Value:
#define xmlIsPubidChar_ch(c)
Automatically generated by genChRanges.py.
Definition chvalid.h:180

Same as IS_PUBIDCHAR but for single-byte value.

Parameters
can xmlChar value (normally unsigned char)

◆ XML_MAX_DICTIONARY_LIMIT

#define XML_MAX_DICTIONARY_LIMIT   100000000

Maximum size allowed by the parser for a dictionary by default This is not a limitation of the parser but a safety boundary feature, use XML_PARSE_HUGE option to override it.

Introduced in 2.9.0

◆ XML_MAX_NAME_LENGTH

#define XML_MAX_NAME_LENGTH   50000

Maximum size allowed for a markup identifier.

This is not a limitation of the parser but a safety boundary feature, use XML_PARSE_HUGE option to override it. Note that with the use of parsing dictionaries overriding the limit may result in more runtime memory usage in face of "unfriendly' content Introduced in 2.9.0

◆ XML_MAX_TEXT_LENGTH

#define XML_MAX_TEXT_LENGTH   10000000

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. Introduced in 2.9.0

Function Documentation

◆ xmlCheckLanguageID()

int xmlCheckLanguageID ( const xmlChar * lang)

Checks that the value conforms to the LanguageID production:

Deprecated
Internal function, do not use.

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

Parameters
langpointer to the string value
Returns
1 if correct 0 otherwise

◆ xmlCopyChar()

int xmlCopyChar ( int len,
xmlChar * out,
int val )

append the char value in the array

Deprecated
Don't use.
Parameters
lenIgnored, compatibility
outpointer to an array of xmlChar
valthe char value
Returns
the number of xmlChar written

◆ xmlCopyCharMultiByte()

int xmlCopyCharMultiByte ( xmlChar * out,
int val )

append the char value in the array

Deprecated
Internal function, don't use.
Parameters
outpointer to an array of xmlChar
valthe char value
Returns
the number of xmlChar written

◆ xmlCreateEntityParserCtxt()

xmlParserCtxt * xmlCreateEntityParserCtxt ( const xmlChar * URL,
const xmlChar * ID,
const xmlChar * base )

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

Deprecated
Don't use.
Parameters
URLthe entity URL
IDthe entity PUBLIC ID
basea possible base for the target URI
Returns
the new parser context or NULL

◆ xmlCreateFileParserCtxt()

xmlParserCtxt * xmlCreateFileParserCtxt ( const char * 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.

Deprecated
Use xmlNewParserCtxt and xmlCtxtReadFile.
Parameters
filenamethe filename
Returns
the new parser context or NULL

◆ xmlCreateMemoryParserCtxt()

xmlParserCtxt * xmlCreateMemoryParserCtxt ( const char * buffer,
int size )

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

The input buffer must not contain a terminating null byte.

Parameters
buffera pointer to a char array
sizethe size of the array
Returns
the new parser context or NULL

◆ xmlCreateURLParserCtxt()

xmlParserCtxt * xmlCreateURLParserCtxt ( const char * filename,
int options )

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

Deprecated
Use xmlNewParserCtxt and xmlCtxtReadFile.
Parameters
filenamethe filename or URL
optionsa combination of xmlParserOption
Returns
the new parser context or NULL

◆ xmlCtxtErrMemory()

void xmlCtxtErrMemory ( xmlParserCtxt * ctxt)

Handle an out-of-memory error.

Since
2.13.0
Parameters
ctxtan XML parser context

◆ xmlCtxtPopInput()

xmlParserInput * xmlCtxtPopInput ( xmlParserCtxt * ctxt)

Pops the top parser input from the input stack.

Parameters
ctxtan XML parser context
Returns
the input just removed

◆ xmlCtxtPushInput()

int xmlCtxtPushInput ( xmlParserCtxt * ctxt,
xmlParserInput * value )

Pushes a new parser input on top of the input stack.

Parameters
ctxtan XML parser context
valuethe parser input
Returns
-1 in case of error, the index in the stack otherwise

◆ xmlCurrentChar()

int xmlCurrentChar ( xmlParserCtxt * ctxt,
int * len )

The current char value, if using UTF-8 this may actually span multiple bytes in the input buffer.

Implement the end of line normalization:

Deprecated
Internal function, do not use.

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

Parameters
ctxtthe XML parser context
lenpointer to the length of the char read
Returns
the current char value and its length

◆ xmlFreeInputStream()

void xmlFreeInputStream ( xmlParserInput * input)

Free up an input stream.

Parameters
inputan xmlParserInput

◆ xmlIsLetter()

int xmlIsLetter ( int c)

Check whether the character is allowed by the production.

Deprecated
Internal function, don't use.
[84] Letter ::= BaseChar | Ideographic
Parameters
can unicode character (int)
Returns
0 if not, non-zero otherwise

◆ xmlNewEntityInputStream()

xmlParserInput * xmlNewEntityInputStream ( xmlParserCtxt * ctxt,
xmlEntity * ent )

Create a new input stream based on an xmlEntity.

Deprecated
Internal function, do not use.
Parameters
ctxtan XML parser context
entan Entity pointer
Returns
the new input stream or NULL

◆ xmlNewInputFromFile()

xmlParserInput * xmlNewInputFromFile ( xmlParserCtxt * ctxt,
const char * filename )

Create a new input stream based on a file or an URL.

Unlike the default external entity loader, this function doesn't use XML catalogs.

Deprecated
Use xmlNewInputFromUrl.
Parameters
ctxtan XML parser context
filenamethe filename to use as entity
Returns
the new input stream or NULL in case of error

◆ xmlNewInputStream()

xmlParserInput * xmlNewInputStream ( xmlParserCtxt * ctxt)

Create a new input stream structure.

Deprecated
Use xmlNewInputFromUrl or similar functions.
Parameters
ctxtan XML parser context
Returns
the new input stream or NULL

◆ xmlNewStringInputStream()

xmlParserInput * xmlNewStringInputStream ( xmlParserCtxt * ctxt,
const xmlChar * buffer )

Create a new input stream based on a memory buffer.

Deprecated
Use xmlNewInputFromString.
Parameters
ctxtan XML parser context
bufferan memory buffer
Returns
the new input stream

◆ xmlNextChar()

void xmlNextChar ( xmlParserCtxt * ctxt)

Skip to the next char input char.

Deprecated
Internal function, do not use.
Parameters
ctxtthe XML parser context

◆ xmlParseAttribute()

const xmlChar * xmlParseAttribute ( xmlParserCtxt * ctxt,
xmlChar ** value )

Parse an attribute.

Deprecated
Internal function, don't use.
[41] Attribute ::= Name Eq AttValue

[ WFC: No External Entity References ] Attribute values cannot contain direct or indirect entity references to external entities.

[ WFC: No < in Attribute Values ] The replacement text of any entity referred to directly or indirectly in an attribute value (other than "&lt;") must not contain a <.

[ VC: Attribute Value Type ] The attribute must have been declared; the value must be of the type declared for it.

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

With namespace:

[NS 11] Attribute ::= QName Eq AttValue

Also the case QName == xmlns:??? is handled independently as a namespace definition.

Parameters
ctxtan XML parser context
valuea xmlChar ** used to store the value of the attribute
Returns
the attribute name, and the value in *value.

◆ xmlParseAttributeListDecl()

void xmlParseAttributeListDecl ( xmlParserCtxt * ctxt)

Parse an attribute list declaration for an element.

Always consumes '<!'.

Deprecated
Internal function, don't use.
[52] AttlistDecl ::= '<!ATTLIST' S Name AttDef* S? '>'

[53] AttDef ::= S Name S AttType S DefaultDecl
Parameters
ctxtan XML parser context

◆ xmlParseAttributeType()

int xmlParseAttributeType ( xmlParserCtxt * ctxt,
xmlEnumeration ** tree )

Parse the Attribute list def for an element.

Deprecated
Internal function, don't use.
[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.

Parameters
ctxtan XML parser context
treethe enumeration tree built while parsing
Returns
the attribute type

◆ xmlParseAttValue()

xmlChar * xmlParseAttValue ( xmlParserCtxt * ctxt)

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

Deprecated
Internal function, don't use.
[10] AttValue ::= '"' ([^<&"] | Reference)* '"' |
                  "'" ([^<&'] | Reference)* "'"

3.3.3 Attribute-Value Normalization:

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

  • a character reference is processed by appending the referenced character to the attribute value
  • an entity reference is processed by recursively processing the replacement text of the entity
  • a whitespace character (#x20, #xD, #xA, #x9) is processed by appending #x20 to the normalized value, except that only a single #x20 is appended for a "#xD#xA" sequence that is part of an external parsed entity or the literal entity value of an internal parsed entity
  • other characters are processed by appending them to the normalized value

If the declared value is not CDATA, then the XML processor must further process the normalized attribute value by discarding any leading and trailing space (#x20) characters, and by replacing sequences of space (#x20) characters by a single space (#x20) character. All attributes for which no declaration has been read should be treated by a non-validating parser as if declared CDATA.

Parameters
ctxtan XML parser context
Returns
the AttValue parsed or NULL. The value has to be freed by the caller.

◆ xmlParseCDSect()

void xmlParseCDSect ( xmlParserCtxt * ctxt)

Parse escaped pure raw content.

Always consumes '<!['.

Deprecated
Internal function, don't use.
[18] CDSect ::= CDStart CData CDEnd

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

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

[21] CDEnd ::= ']]>'
Parameters
ctxtan XML parser context

◆ xmlParseCharData()

void xmlParseCharData ( xmlParserCtxt * ctxt,
int cdata )
Deprecated
Internal function, don't use.
Parameters
ctxtan XML parser context
cdataunused

◆ xmlParseCharRef()

int xmlParseCharRef ( xmlParserCtxt * ctxt)

Parse a numeric character reference.

Always consumes '&'.

Deprecated
Internal function, don't use.
[66] CharRef ::= '&#' [0-9]+ ';' |
                 '&#x' [0-9a-fA-F]+ ';'

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

Parameters
ctxtan XML parser context
Returns
the value parsed (as an int), 0 in case of error

◆ xmlParseComment()

void xmlParseComment ( xmlParserCtxt * ctxt)

Parse an XML (SGML) comment.

Always consumes '<!'.

Deprecated
Internal function, don't use.

The spec says that "For compatibility, the string "–" (double-hyphen) must not occur within comments. "

[15] Comment ::= ''

Parameters
ctxtan XML parser context

◆ xmlParseContent()

void xmlParseContent ( xmlParserCtxt * ctxt)

Parse XML element content.

This is useful if you're only interested in custom SAX callbacks. If you want a node list, use xmlCtxtParseContent.

Parameters
ctxtan XML parser context

◆ xmlParseDefaultDecl()

int xmlParseDefaultDecl ( xmlParserCtxt * ctxt,
xmlChar ** value )

Parse an attribute default declaration.

Deprecated
Internal function, don't use.
[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

Parameters
ctxtan XML parser context
valueReceive a possible fixed default value for the attribute
Returns
XML_ATTRIBUTE_NONE, XML_ATTRIBUTE_REQUIRED, XML_ATTRIBUTE_IMPLIED or XML_ATTRIBUTE_FIXED.

◆ xmlParseDocTypeDecl()

void xmlParseDocTypeDecl ( xmlParserCtxt * ctxt)

Parse a DOCTYPE declaration.

Deprecated
Internal function, don't use.
[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.

Parameters
ctxtan XML parser context

◆ xmlParseElement()

void xmlParseElement ( xmlParserCtxt * ctxt)

Parse an XML element.

Deprecated
Internal function, don't use.
[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.

Parameters
ctxtan XML parser context

◆ xmlParseElementChildrenContentDecl()

xmlElementContent * xmlParseElementChildrenContentDecl ( xmlParserCtxt * ctxt,
int inputchk )

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

Deprecated
Internal function, don't use.
[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 ,).

Parameters
ctxtan XML parser context
inputchkthe input used for the current entity, needed for boundary checks
Returns
the tree of xmlElementContent describing the element hierarchy.

◆ xmlParseElementContentDecl()

int xmlParseElementContentDecl ( xmlParserCtxt * ctxt,
const xmlChar * name,
xmlElementContent ** result )

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

Deprecated
Internal function, don't use.
[46] contentspec ::= 'EMPTY' | 'ANY' | Mixed | children
Parameters
ctxtan XML parser context
namethe name of the element being defined.
resultthe Element Content pointer will be stored here if any
Returns
an xmlElementTypeVal value or -1 on error

◆ xmlParseElementDecl()

int xmlParseElementDecl ( xmlParserCtxt * ctxt)

Parse an element declaration.

Always consumes '<!'.

Deprecated
Internal function, don't use.
[45] elementdecl ::= '<!ELEMENT' S Name S contentspec S? '>'

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

Parameters
ctxtan XML parser context
Returns
the type of the element, or -1 in case of error

◆ xmlParseElementMixedContentDecl()

xmlElementContent * xmlParseElementMixedContentDecl ( xmlParserCtxt * ctxt,
int openInputNr )

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

Deprecated
Internal function, don't use.
[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.

Parameters
ctxtan XML parser context
openInputNrthe input used for the current entity, needed for boundary checks
Returns
the list of the xmlElementContent describing the element choices

◆ xmlParseEncName()

xmlChar * xmlParseEncName ( xmlParserCtxt * ctxt)

Parse the XML encoding name.

Deprecated
Internal function, don't use.
[81] EncName ::= [A-Za-z] ([A-Za-z0-9._] | '-')*
Parameters
ctxtan XML parser context
Returns
the encoding name value or NULL

◆ xmlParseEncodingDecl()

const xmlChar * xmlParseEncodingDecl ( xmlParserCtxt * ctxt)

Parse the XML encoding declaration.

Deprecated
Internal function, don't use.
[80] EncodingDecl ::= S 'encoding' Eq ('"' EncName '"' | 
                      "'" EncName "'")

this setups the conversion filters.

Parameters
ctxtan XML parser context
Returns
the encoding value or NULL

◆ xmlParseEndTag()

void xmlParseEndTag ( xmlParserCtxt * ctxt)

Parse an end of tag.

Deprecated
Internal function, don't use.
[42] ETag ::= '</' Name S? '>'

With namespace

[NS 9] ETag ::= '</' QName S? '>'
Parameters
ctxtan XML parser context

◆ xmlParseEntityDecl()

void xmlParseEntityDecl ( xmlParserCtxt * ctxt)

Parse an entity declaration.

Always consumes '<!'.

Deprecated
Internal function, don't use.
[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.

Parameters
ctxtan XML parser context

◆ xmlParseEntityRef()

xmlEntity * xmlParseEntityRef ( xmlParserCtxt * ctxt)
Deprecated
Internal function, don't use.
Parameters
ctxtan XML parser context
Returns
the xmlEntity if found, or NULL otherwise.

◆ xmlParseEntityValue()

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

Parse a value for ENTITY declarations.

Deprecated
Internal function, don't use.
[9] EntityValue ::= '"' ([^%&"] | PEReference | Reference)* '"' |
                    "'" ([^%&'] | PEReference | Reference)* "'"
Parameters
ctxtan XML parser context
origif non-NULL store a copy of the original entity value
Returns
the EntityValue parsed with reference substituted or NULL

◆ xmlParseEnumeratedType()

int xmlParseEnumeratedType ( xmlParserCtxt * ctxt,
xmlEnumeration ** tree )

Parse an Enumerated attribute type.

Deprecated
Internal function, don't use.
[57] EnumeratedType ::= NotationType | Enumeration

[58] NotationType ::= 'NOTATION' S '(' S? Name (S? '|' S? Name)* S? ')'
Parameters
ctxtan XML parser context
treethe enumeration tree built while parsing
Returns
XML_ATTRIBUTE_ENUMERATION or XML_ATTRIBUTE_NOTATION

◆ xmlParseEnumerationType()

xmlEnumeration * xmlParseEnumerationType ( xmlParserCtxt * ctxt)

Parse an Enumeration attribute type.

Deprecated
Internal function, don't use.
[59] Enumeration ::= '(' S? Nmtoken (S? '|' S? Nmtoken)* S? ')'

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

Parameters
ctxtan XML parser context
Returns
the enumeration attribute tree built while parsing

◆ xmlParseExternalID()

xmlChar * xmlParseExternalID ( xmlParserCtxt * ctxt,
xmlChar ** publicId,
int strict )

Parse an External ID or a Public ID.

Deprecated
Internal function, don't use.

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

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

[83] PublicID ::= 'PUBLIC' S PubidLiteral
Parameters
ctxtan XML parser context
publicIda xmlChar** receiving PubidLiteral
strictindicate whether we should restrict parsing to only production [75], see NOTE below
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.

◆ xmlParseExternalSubset()

void xmlParseExternalSubset ( xmlParserCtxt * ctxt,
const xmlChar * publicId,
const xmlChar * systemId )

Parse Markup declarations from an external subset.

Deprecated
Internal function, don't use.
[30] extSubset ::= textDecl? extSubsetDecl

[31] extSubsetDecl ::= (markupdecl | conditionalSect |
                        PEReference | S) *
Parameters
ctxtan XML parser context
publicIdthe public identifier
systemIdthe system identifier (URL)

◆ xmlParseMarkupDecl()

void xmlParseMarkupDecl ( xmlParserCtxt * ctxt)

Parse markup declarations.

Always consumes '<!' or '<?'.

Deprecated
Internal function, don't use.
[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.)

Parameters
ctxtan XML parser context

◆ xmlParseMisc()

void xmlParseMisc ( xmlParserCtxt * ctxt)

Parse an XML Misc* optional field.

Deprecated
Internal function, don't use.
[27] Misc ::= Comment | PI |  S
Parameters
ctxtan XML parser context

◆ xmlParseName()

const xmlChar * xmlParseName ( xmlParserCtxt * ctxt)

Parse an XML name.

Deprecated
Internal function, don't use.
[4] NameChar ::= Letter | Digit | '.' | '-' | '_' | ':' |
                 CombiningChar | Extender

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

[6] Names ::= Name (#x20 Name)*
Parameters
ctxtan XML parser context
Returns
the Name parsed or NULL

◆ xmlParseNmtoken()

xmlChar * xmlParseNmtoken ( xmlParserCtxt * ctxt)

Parse an XML Nmtoken.

Deprecated
Internal function, don't use.
[7] Nmtoken ::= (NameChar)+

[8] Nmtokens ::= Nmtoken (#x20 Nmtoken)*
Parameters
ctxtan XML parser context
Returns
the Nmtoken parsed or NULL

◆ xmlParseNotationDecl()

void xmlParseNotationDecl ( xmlParserCtxt * ctxt)

Parse a notation declaration.

Always consumes '<!'.

Deprecated
Internal function, don't use.
[82] NotationDecl ::= '<!NOTATION' S Name S (ExternalID |  PublicID)
                      S? '>'

Hence there is actually 3 choices:

'PUBLIC' S PubidLiteral
'PUBLIC' S PubidLiteral S SystemLiteral
'SYSTEM' S SystemLiteral

See the NOTE on xmlParseExternalID.

Parameters
ctxtan XML parser context

◆ xmlParseNotationType()

xmlEnumeration * xmlParseNotationType ( xmlParserCtxt * ctxt)

Parse an Notation attribute type.

Deprecated
Internal function, don't use.

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.

Parameters
ctxtan XML parser context
Returns
the notation attribute tree built while parsing

◆ xmlParsePEReference()

void xmlParsePEReference ( xmlParserCtxt * ctxt)

Parse a parameter entity reference.

Deprecated
Internal function, don't use.
Parameters
ctxtan XML parser context

◆ xmlParsePI()

void xmlParsePI ( xmlParserCtxt * ctxt)

Parse an XML Processing Instruction.

Deprecated
Internal function, don't use.
[16] PI ::= '<?' PITarget (S (Char* - (Char* '?>' Char*)))? '?>'

The processing is transferred to SAX once parsed.

Parameters
ctxtan XML parser context

◆ xmlParsePITarget()

const xmlChar * xmlParsePITarget ( xmlParserCtxt * ctxt)

Parse the name of a PI.

Deprecated
Internal function, don't use.
[17] PITarget ::= Name - (('X' | 'x') ('M' | 'm') ('L' | 'l'))
Parameters
ctxtan XML parser context
Returns
the PITarget name or NULL

◆ xmlParsePubidLiteral()

xmlChar * xmlParsePubidLiteral ( xmlParserCtxt * ctxt)

Parse an XML public literal.

Deprecated
Internal function, don't use.
[12] PubidLiteral ::= '"' PubidChar* '"' | "'" (PubidChar - "'")* "'"
Parameters
ctxtan XML parser context
Returns
the PubidLiteral parsed or NULL.

◆ xmlParseReference()

void xmlParseReference ( xmlParserCtxt * ctxt)

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.

Deprecated
Internal function, don't use.

Always consumes '&'.

[67] Reference ::= EntityRef | CharRef
Parameters
ctxtan XML parser context

◆ xmlParserHandlePEReference()

void xmlParserHandlePEReference ( xmlParserCtxt * ctxt)
[69] PEReference ::= '%' Name ';'
Deprecated
Internal function, do not use.

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

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

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

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

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

  • Included in literal in entity values
  • Included as Parameter Entity reference within DTDs
    Parameters
    ctxtthe parser context

◆ xmlParserInputShrink()

void xmlParserInputShrink ( xmlParserInput * in)

This function removes used input for the parser.

Deprecated
Don't use.
Parameters
inan XML parser input

◆ xmlParseSDDecl()

int xmlParseSDDecl ( xmlParserCtxt * ctxt)

Parse the XML standalone declaration.

Deprecated
Internal function, don't use.
[32] SDDecl ::= S 'standalone' Eq
                (("'" ('yes' | 'no') "'") | ('"' ('yes' | 'no')'"'))

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

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

◆ xmlParseStartTag()

const xmlChar * xmlParseStartTag ( xmlParserCtxt * ctxt)

Parse a start tag.

Always consumes '<'.

Deprecated
Internal function, don't use.
[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? '/>'
Parameters
ctxtan XML parser context
Returns
the element name parsed

◆ xmlParseSystemLiteral()

xmlChar * xmlParseSystemLiteral ( xmlParserCtxt * ctxt)

Parse an XML Literal.

Deprecated
Internal function, don't use.
[11] SystemLiteral ::= ('"' [^"]* '"') | ("'" [^']* "'")
Parameters
ctxtan XML parser context
Returns
the SystemLiteral parsed or NULL

◆ xmlParseTextDecl()

void xmlParseTextDecl ( xmlParserCtxt * ctxt)

Parse an XML declaration header for external entities.

Deprecated
Internal function, don't use.
[77] TextDecl ::= '<?xml' VersionInfo? EncodingDecl S? '?>'
Parameters
ctxtan XML parser context

◆ xmlParseVersionInfo()

xmlChar * xmlParseVersionInfo ( xmlParserCtxt * ctxt)

Parse the XML version.

Deprecated
Internal function, don't use.
[24] VersionInfo ::= S 'version' Eq (' VersionNum ' | " VersionNum ")

[25] Eq ::= S? '=' S?
Parameters
ctxtan XML parser context
Returns
the version string, e.g. "1.0"

◆ xmlParseVersionNum()

xmlChar * xmlParseVersionNum ( xmlParserCtxt * ctxt)

Parse the XML version value.

Deprecated
Internal function, don't use.
[26] VersionNum ::= '1.' [0-9]+

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

Parameters
ctxtan XML parser context
Returns
the string giving the XML version number, or NULL

◆ xmlParseXMLDecl()

void xmlParseXMLDecl ( xmlParserCtxt * ctxt)

Parse an XML declaration header.

Deprecated
Internal function, don't use.
[23] XMLDecl ::= '<?xml' VersionInfo EncodingDecl? SDDecl? S? '?>'
Parameters
ctxtan XML parser context

◆ xmlPopInput()

xmlChar xmlPopInput ( xmlParserCtxt * ctxt)
Deprecated
Internal function, don't use.
Parameters
ctxtan XML parser context
Returns
the current xmlChar in the parser context

◆ xmlPushInput()

int xmlPushInput ( xmlParserCtxt * ctxt,
xmlParserInput * input )

Push an input stream onto the stack.

Deprecated
Internal function, don't use.
Parameters
ctxtan XML parser context
inputan XML parser input fragment (entity, XML fragment ...).
Returns
-1 in case of error or the index in the input stack

◆ xmlSkipBlankChars()

int xmlSkipBlankChars ( xmlParserCtxt * ctxt)

Skip whitespace in the input stream.

Deprecated
Internal function, do not use.
Parameters
ctxtthe XML parser context
Returns
the number of space chars skipped

◆ xmlSplitQName()

xmlChar * xmlSplitQName ( xmlParserCtxt * ctxt,
const xmlChar * name,
xmlChar ** prefixOut )

Parse an UTF8 encoded XML qualified name string.

Deprecated
Don't use.
Parameters
ctxtan XML parser context
namean XML parser context
prefixOuta xmlChar **
Returns
the local part, and prefix is updated to get the Prefix if any.

◆ xmlStringCurrentChar()

int xmlStringCurrentChar ( xmlParserCtxt * ctxt,
const xmlChar * cur,
int * len )

The current char value, if using UTF-8 this may actually span multiple bytes in the input buffer.

Deprecated
Internal function, do not use.
Parameters
ctxtthe XML parser context
curpointer to the beginning of the char
lenpointer to the length of the char read
Returns
the current char value and its length

◆ xmlStringDecodeEntities()

xmlChar * xmlStringDecodeEntities ( xmlParserCtxt * ctxt,
const xmlChar * str,
int what,
xmlChar end,
xmlChar end2,
xmlChar end3 )
Deprecated
Internal function, don't use.
Parameters
ctxtthe parser context
strthe input string
whatcombination of XML_SUBSTITUTE_REF and XML_SUBSTITUTE_PEREF
endan end marker xmlChar, 0 if none
end2an end marker xmlChar, 0 if none
end3an end marker xmlChar, 0 if none
Returns
A newly allocated string with the substitution done. The caller must deallocate it !

◆ xmlStringLenDecodeEntities()

xmlChar * xmlStringLenDecodeEntities ( xmlParserCtxt * ctxt,
const xmlChar * str,
int len,
int what,
xmlChar end,
xmlChar end2,
xmlChar end3 )
Deprecated
Internal function, don't use.
Parameters
ctxtthe parser context
strthe input string
lenthe string length
whatcombination of XML_SUBSTITUTE_REF and XML_SUBSTITUTE_PEREF
endan end marker xmlChar, 0 if none
end2an end marker xmlChar, 0 if none
end3an end marker xmlChar, 0 if none
Returns
A newly allocated string with the substitution done. The caller must deallocate it !

◆ xmlSwitchEncoding()

int xmlSwitchEncoding ( xmlParserCtxt * ctxt,
xmlCharEncoding enc )

Use encoding specified by enum to decode input data.

This overrides the encoding found in the XML declaration.

This function can also be used to override the encoding of chunks passed to xmlParseChunk.

Parameters
ctxtthe parser context
encthe encoding value (number)
Returns
0 in case of success, -1 otherwise

◆ xmlSwitchEncodingName()

int xmlSwitchEncodingName ( xmlParserCtxt * ctxt,
const char * encoding )

Use specified encoding to decode input data.

This overrides the encoding found in the XML declaration.

This function can also be used to override the encoding of chunks passed to xmlParseChunk.

Since
2.13.0
Parameters
ctxtthe parser context
encodingthe encoding name
Returns
0 in case of success, -1 otherwise

◆ xmlSwitchInputEncoding()

int xmlSwitchInputEncoding ( xmlParserCtxt * ctxt,
xmlParserInput * input,
xmlCharEncodingHandler * handler )

Use encoding handler to decode input data.

Deprecated
Internal function, don't use.
Parameters
ctxtthe parser context, only for error reporting
inputthe input stream
handlerthe encoding handler
Returns
0 in case of success, -1 otherwise

◆ xmlSwitchToEncoding()

int xmlSwitchToEncoding ( xmlParserCtxt * ctxt,
xmlCharEncodingHandler * handler )

Use encoding handler to decode input data.

This function can be used to enforce the encoding of chunks passed to xmlParseChunk.

Parameters
ctxtthe parser context
handlerthe encoding handler
Returns
0 in case of success, -1 otherwise