UPnPsdk 0.1
Universal Plug and Play +, Software Development Kit
 
Loading...
Searching...
No Matches
ixmlparser.cpp File Reference
#include <ixml/ixmlparser.hpp>
#include <ixml/ixmldebug.hpp>
#include <UPnPsdk/port.hpp>
#include <cassert>
#include <cstddef>
#include <cstdio>
#include <cstring>
+ Include dependency graph for ixmlparser.cpp:

Go to the source code of this file.

Classes

struct  char_info
 char_info More...
 

Macros

#define LETTERTABLESIZE   (sizeof(Letter) / sizeof(Letter[0]))
 The size of the letter table array.
 
#define NAMECHARTABLESIZE   (sizeof(NameChar) / sizeof(NameChar[0]))
 The name char table array size.
 

Typedefs

typedef struct char_info char_info_t
 char_info
 

Functions

static void Parser_freeElementStackItem (IXML_ElementStack *pItem)
 Frees one ElementStack item.
 
static void Parser_freeNsURI (IXML_NamespaceURI *pNsURI)
 Frees namespaceURI item.
 
static void Parser_free (Parser *xmlParser)
 Frees all temporary memory allocated by xmlparser.
 
static int Parser_skipDocType (char **pstr)
 Skips document type declaration.
 
static int Parser_skipString (char **pstrSrc, const char *strSkipKey)
 Skips all characters in the string until it finds the skip key. Then it skips the skip key and returns.
 
static void Parser_skipBom (Parser *xmlParser)
 Skip UTF-8 byte order mark.
 
static void Parser_skipWhiteSpaces (Parser *xmlParser)
 Skip white spaces.
 
static int Parser_skipXMLDecl (Parser *xmlParser)
 Skips XML declarations.
 
static int Parser_skipComment (char **pstrSrc)
 Skips all characters in the string until it finds the skip key. Then it skips the skip key and returns.
 
static int Parser_skipMisc (Parser *xmlParser)
 Skip comment, PI and white space.
 
static int Parser_skipProlog (Parser *xmlParser)
 Skip prolog.
 
static int Parser_setLastElem (Parser *xmlParser, const char *s)
 Set the last element to be the given string.
 
static void Parser_clearTokenBuf (Parser *xmlParser)
 Clear token buffer.
 
static int Parser_UTF8ToInt (const char *ss, ptrdiff_t *len)
 In UTF-8, characters are encoded using sequences of 1 to 6 octets. This functions will return a UTF-8 character value and its octets number.
 
static int Parser_isCharInTable (int c, char_info_t *tbl, int sz)
 Will determine whether character c is in the table of tbl (either Letter table or NameChar table).
 
static int Parser_isNameChar (int c, int bNameChar)
 Check whether c (int) is in LetterTable or NameCharTable.
 
static int Parser_isXmlChar (int c)
 see XML 1.0 (2nd Edition) 2.2.
 
static int Parser_getChar (const char *src, ptrdiff_t *cLen)
 Returns next char value and its length.
 
static int Parser_appendTokBufChar (Parser *xmlParser, char c)
 Appends c to token buffer.
 
static int Parser_intToUTF8 (int c, utf8char s)
 Encodes a character to its UTF-8 character string, and return its length.
 
static int Parser_appendTokBufStr (Parser *xmlParser, const char *s)
 Appends string s to token buffer.
 
static int Parser_copyToken (Parser *xmlParser, const char *src, ptrdiff_t len)
 Copy string in src into xml parser token buffer.
 
static ptrdiff_t Parser_getNextToken (Parser *xmlParser)
 Return the length of next token in tokenBuff.
 
static char * safe_strdup (const char *s)
 Version of strdup() that handles NULL input.
 
static int Parser_processSTag (Parser *xmlParser, IXML_Node *node)
 Processes the STag as defined by XML spec.
 
static int Parser_skipPI (char **pSrc)
 Parser_skipPI.
 
static int Parser_processCDSect (char **pSrc, IXML_Node *node)
 Processes CDSection as defined by XML spec.
 
static int Parser_processContent (Parser *xmlParser, IXML_Node *node)
 Processes the CONTENT as defined in XML spec.
 
static int Parser_processETag (Parser *xmlParser, IXML_Node *node, int *bETag)
 Process ETag as defined by XML spec.
 
static char * Parser_getNameSpace (Parser *xmlParser, const char *prefix)
 Unimplemented function.
 
static int Parser_addNamespace (Parser *xmlParser)
 Add a namespace definition.
 
static int Parser_xmlNamespace (Parser *xmlParser, IXML_Node *newNode)
 Add namespace definition.
 
static int Parser_processAttribute (Parser *xmlParser, IXML_Node *node)
 Processes attribute.
 
static int Parser_getNextNode (Parser *xmlParser, IXML_Node *node, int *bETag)
 Get the next node.
 
static int Parser_ElementPrefixDefined (Parser *xmlParser, IXML_Node *newNode, char **nsURI)
 Decides whether element's prefix is already defined.
 
static int Parser_setElementNamespace (IXML_Element *newElement, const char *nsURI)
 Set element's namespace.
 
static int isDuplicateAttribute (Parser *xmlParser, IXML_Node *newAttrNode)
 Reports whether the new attribute is the same as an existing one.
 
static int Parser_processAttributeName (IXML_Document *rootDoc, Parser *xmlParser, IXML_Node *newNode)
 Processes the attribute name.
 
static int Parser_pushElement (Parser *xmlParser, IXML_Node *newElement)
 Push a new element onto element stack.
 
static int isTopLevelElement (Parser *xmlParser)
 Reports whether there is a top level element in the parser.
 
static int Parser_hasDefaultNamespace (Parser *xmlParser, char **nsURI)
 Decide whether the current element has default namespace.
 
static int Parser_processElementName (IXML_Document *rootDoc, Parser *xmlParser, IXML_Node *newNode)
 Processes element name.
 
static int Parser_isValidEndElement (Parser *xmlParser, IXML_Node *newNode)
 Check if a new node->nodeName matches top of element stack.
 
static void Parser_popElement (Parser *xmlParser)
 Remove element from element stack.
 
static int Parser_eTagVerification (Parser *xmlParser, IXML_Node *newNode)
 Verifies endof element tag is the same as the openning element tag.
 
static int Parser_parseDocument (IXML_Document **retDoc, Parser *xmlParser)
 Parses the xml file and returns the DOM document tree.
 
int Parser_isValidXmlName (const DOMString name)
 Check to see whether name is a valid xml name.
 
void Parser_setErrorChar (char c)
 Sets the error character.
 
static ParserParser_init ()
 Initializes a xml parser.
 
static int Parser_readFileOrBuffer (Parser *xmlParser, const char *xmlFileName, int file)
 Read a xml file or buffer contents into xml parser.
 
int Parser_LoadDocument (IXML_Document **retDoc, const char *xmlFileName, int file)
 Parses a xml file and return the DOM tree.
 
void Parser_freeNodeContent (IXML_Node *nodeptr)
 Fees a node contents.
 
int Parser_setNodePrefixAndLocalName (IXML_Node *node)
 Set the node prefix and localName as defined by the nodeName in the form of ns:name.
 

Variables

static char_info_t Letter []
 The letter table contains all characters in XML 1.0 plus ":", "_" and ideographic.
 
static char_info_t NameChar []
 The NameChar table contains CombiningChar, Extender, Digit, '-', '.', less '_', ':'.
 

Class Documentation

◆ char_info

struct char_info

char_info

Definition at line 78 of file ixmlparser.cpp.

Class Members
unsigned short l
unsigned short h

Macro Definition Documentation

◆ LETTERTABLESIZE

#define LETTERTABLESIZE   (sizeof(Letter) / sizeof(Letter[0]))

The size of the letter table array.

Definition at line 171 of file ixmlparser.cpp.

◆ NAMECHARTABLESIZE

#define NAMECHARTABLESIZE   (sizeof(NameChar) / sizeof(NameChar[0]))

The name char table array size.

Definition at line 236 of file ixmlparser.cpp.

Function Documentation

◆ Parser_freeElementStackItem()

static void Parser_freeElementStackItem ( IXML_ElementStack pItem)
static

Frees one ElementStack item.

Parameters
[in]pItemThe element stack item to free.

Definition at line 241 of file ixmlparser.cpp.

+ Here is the caller graph for this function:

◆ Parser_freeNsURI()

static void Parser_freeNsURI ( IXML_NamespaceURI pNsURI)
static

Frees namespaceURI item.

Parameters
[in]pNsURIThe name space URI item to free.

Definition at line 262 of file ixmlparser.cpp.

+ Here is the caller graph for this function:

◆ Parser_free()

static void Parser_free ( Parser xmlParser)
static

Frees all temporary memory allocated by xmlparser.

Parameters
[in]xmlParserThe XML parser.

Definition at line 277 of file ixmlparser.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Parser_skipDocType()

static int Parser_skipDocType ( char **  pstr)
static

Skips document type declaration.

Parameters
[in,out]pstrThe pointer to the skipped point.

Definition at line 319 of file ixmlparser.cpp.

+ Here is the caller graph for this function:

◆ Parser_skipString()

static int Parser_skipString ( char **  pstrSrc,
const char *  strSkipKey 
)
static

Skips all characters in the string until it finds the skip key. Then it skips the skip key and returns.

Parameters
[in,out]pstrSrcThe pointer to the skipped point.
[in]strSkipKeyThe skip key.

Definition at line 361 of file ixmlparser.cpp.

+ Here is the caller graph for this function:

◆ Parser_skipBom()

static void Parser_skipBom ( Parser xmlParser)
static

Skip UTF-8 byte order mark.

Parameters
[in]xmlParserThe XML parser.

Definition at line 386 of file ixmlparser.cpp.

+ Here is the caller graph for this function:

◆ Parser_skipWhiteSpaces()

static void Parser_skipWhiteSpaces ( Parser xmlParser)
static

Skip white spaces.

Parameters
[in]xmlParserThe XML parser.

Definition at line 398 of file ixmlparser.cpp.

+ Here is the caller graph for this function:

◆ Parser_skipXMLDecl()

static int Parser_skipXMLDecl ( Parser xmlParser)
static

Skips XML declarations.

Parameters
[in,out]xmlParserThe XML parser.

Definition at line 410 of file ixmlparser.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Parser_skipComment()

static int Parser_skipComment ( char **  pstrSrc)
static

Skips all characters in the string until it finds the skip key. Then it skips the skip key and returns.

Parameters
[in,out]pstrSrcThe pointer to the skipped point.

Definition at line 429 of file ixmlparser.cpp.

+ Here is the caller graph for this function:

◆ Parser_skipMisc()

static int Parser_skipMisc ( Parser xmlParser)
static

Skip comment, PI and white space.

Parameters
[in]xmlParserThe XML parser.

Definition at line 453 of file ixmlparser.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Parser_skipProlog()

static int Parser_skipProlog ( Parser xmlParser)
static

Skip prolog.

Parameters
[in,out]xmlParserThe XML parser.

Definition at line 487 of file ixmlparser.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Parser_setLastElem()

static int Parser_setLastElem ( Parser xmlParser,
const char *  s 
)
static

Set the last element to be the given string.

Parameters
[in]xmlParserThe XML parser.
[in]sThe string to copy from.

Definition at line 526 of file ixmlparser.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Parser_clearTokenBuf()

static void Parser_clearTokenBuf ( Parser xmlParser)
static

Clear token buffer.

Parameters
[in]xmlParserThe XML parser.

Definition at line 544 of file ixmlparser.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Parser_UTF8ToInt()

static int Parser_UTF8ToInt ( const char *  ss,
ptrdiff_t *  len 
)
static

In UTF-8, characters are encoded using sequences of 1 to 6 octets. This functions will return a UTF-8 character value and its octets number.

Returns
The UTF-8 character converted to an int (32 bits).
Parameters
[in]ssThe pointer to the character to encode.
[out]lenThe number of octets of the UTF-8 encoding of this character.

Definition at line 556 of file ixmlparser.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Parser_isCharInTable()

static int Parser_isCharInTable ( int  c,
char_info_t tbl,
int  sz 
)
static

Will determine whether character c is in the table of tbl (either Letter table or NameChar table).

Returns
1 or 0.
Parameters
[in]cCharacter to check.
[in]tblTable to use.
[in]szSize of the table.

Definition at line 623 of file ixmlparser.cpp.

+ Here is the caller graph for this function:

◆ Parser_isNameChar()

static int Parser_isNameChar ( int  c,
int  bNameChar 
)
static

Check whether c (int) is in LetterTable or NameCharTable.

Parameters
[in]cThe character to check.
[in]bNameChar1 if you also want to check in the NameChar table.

Definition at line 651 of file ixmlparser.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Parser_isXmlChar()

static int Parser_isXmlChar ( int  c)
static

see XML 1.0 (2nd Edition) 2.2.

Parameters
[in]cThe character to check.

Definition at line 671 of file ixmlparser.cpp.

+ Here is the caller graph for this function:

◆ Parser_getChar()

static int Parser_getChar ( const char *  src,
ptrdiff_t *  cLen 
)
static

Returns next char value and its length.

Parameters
[in]src.
[in,out]cLen.

Definition at line 681 of file ixmlparser.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Parser_appendTokBufChar()

static int Parser_appendTokBufChar ( Parser xmlParser,
char  c 
)
static

Appends c to token buffer.

Parameters
[in]xmlParserThe XML parser.
[in]cThe character to append.

Definition at line 797 of file ixmlparser.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Parser_intToUTF8()

static int Parser_intToUTF8 ( int  c,
utf8char  s 
)
static

Encodes a character to its UTF-8 character string, and return its length.

Returns
The length of the encoded string in bytes.
Parameters
[in]cThe character to encode.
[out]sThe resultant UTF-8 encoded string.

Definition at line 814 of file ixmlparser.cpp.

+ Here is the caller graph for this function:

◆ Parser_appendTokBufStr()

static int Parser_appendTokBufStr ( Parser xmlParser,
const char *  s 
)
static

Appends string s to token buffer.

Parameters
[in]xmlParserThe XML parser.
[in]sThe string to append.

Definition at line 875 of file ixmlparser.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Parser_copyToken()

static int Parser_copyToken ( Parser xmlParser,
const char *  src,
ptrdiff_t  len 
)
static

Copy string in src into xml parser token buffer.

Parameters
[in]xmlParserThe XML parser.
[in]srcThe string to copy from.
[in]lenThe lenght to copy.

Definition at line 892 of file ixmlparser.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Parser_getNextToken()

static ptrdiff_t Parser_getNextToken ( Parser xmlParser)
static

Return the length of next token in tokenBuff.

Parameters
[in]xmlParserThe XML parser.

Definition at line 957 of file ixmlparser.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ safe_strdup()

static char * safe_strdup ( const char *  s)
static

Version of strdup() that handles NULL input.

Returns
The same as strdup().
Parameters
[in]sString to be duplicated.

Definition at line 1037 of file ixmlparser.cpp.

+ Here is the caller graph for this function:

◆ Parser_processSTag()

static int Parser_processSTag ( Parser xmlParser,
IXML_Node node 
)
static

Processes the STag as defined by XML spec.

Parameters
[in]xmlParserThe XML parser.
[in]nodeThe Node to process.

Definition at line 1051 of file ixmlparser.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Parser_skipPI()

static int Parser_skipPI ( char **  pSrc)
static

Parser_skipPI.

Parameters
[in,out]pSrcThe pointer to the skipped point.

Definition at line 1115 of file ixmlparser.cpp.

+ Here is the caller graph for this function:

◆ Parser_processCDSect()

static int Parser_processCDSect ( char **  pSrc,
IXML_Node node 
)
static

Processes CDSection as defined by XML spec.

Returns
Parameters
[in]pSrc.
[in]nodeThe Node to process.

Definition at line 1148 of file ixmlparser.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Parser_processContent()

static int Parser_processContent ( Parser xmlParser,
IXML_Node node 
)
static

Processes the CONTENT as defined in XML spec.

Parameters
[in]xmlParserThe XML parser.
[in]nodeThe Node to process.

Definition at line 1198 of file ixmlparser.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Parser_processETag()

static int Parser_processETag ( Parser xmlParser,
IXML_Node node,
int *  bETag 
)
static

Process ETag as defined by XML spec.

Parameters
[in]xmlParserThe XML parser.
[in]nodeThe Node to process.
[out]bETag.

Definition at line 1318 of file ixmlparser.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Parser_getNameSpace()

static char * Parser_getNameSpace ( Parser xmlParser,
const char *  prefix 
)
static

Unimplemented function.

Returns
IXML_SUCCESS.

Return the namespce as defined as prefix.

Parameters
[in]xmlParserThe XML parser.
[in]prefixThe prefix.

Definition at line 1404 of file ixmlparser.cpp.

+ Here is the caller graph for this function:

◆ Parser_addNamespace()

static int Parser_addNamespace ( Parser xmlParser)
static

Add a namespace definition.

Parameters
[in]xmlParserThe XML parser.

Definition at line 1431 of file ixmlparser.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Parser_xmlNamespace()

static int Parser_xmlNamespace ( Parser xmlParser,
IXML_Node newNode 
)
static

Add namespace definition.

Parameters
[in]xmlParserThe XML parser.
[in]newNodeThe Node to process.

Definition at line 1471 of file ixmlparser.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Parser_processAttribute()

static int Parser_processAttribute ( Parser xmlParser,
IXML_Node node 
)
static

Processes attribute.

Returns
IXML_SUCCESS or failure code.
Parameters
[in]xmlParserThe XML parser.
[in]nodeThe Node to process.

Definition at line 1598 of file ixmlparser.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Parser_getNextNode()

static int Parser_getNextNode ( Parser xmlParser,
IXML_Node node,
int *  bETag 
)
static

Get the next node.

Returns
IXML_SUCCESS and the next node or IXML_FILE_DONE or an error.
Parameters
[in]xmlParserThe XML parser.
[out]nodeThe XML parser.
[out]bETagThe XML parser.

Definition at line 1752 of file ixmlparser.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Parser_ElementPrefixDefined()

static int Parser_ElementPrefixDefined ( Parser xmlParser,
IXML_Node newNode,
char **  nsURI 
)
static

Decides whether element's prefix is already defined.

Parameters
[in]xmlParserThe XML parser.
[in]newNodeThe Node to process.
[in,out]nsURIThe name space URI.

Definition at line 1859 of file ixmlparser.cpp.

+ Here is the caller graph for this function:

◆ Parser_setElementNamespace()

static int Parser_setElementNamespace ( IXML_Element newElement,
const char *  nsURI 
)
static

Set element's namespace.

Parameters
[in]newElementThe Element Node to process.
[in]nsURIThe name space string.

Definition at line 1896 of file ixmlparser.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isDuplicateAttribute()

static int isDuplicateAttribute ( Parser xmlParser,
IXML_Node newAttrNode 
)
static

Reports whether the new attribute is the same as an existing one.

Returns
1 if the new attribute is the same as an existing one.
Parameters
[in]xmlParserThe XML parser.
[in]newAttrNodeThe node attribute to compare.

Definition at line 1920 of file ixmlparser.cpp.

+ Here is the caller graph for this function:

◆ Parser_processAttributeName()

static int Parser_processAttributeName ( IXML_Document rootDoc,
Parser xmlParser,
IXML_Node newNode 
)
static

Processes the attribute name.

Returns
IXML_SUCCESS if successful, otherwise or an error code.
Parameters
[in]rootDocThe XML document.
[in]xmlParserThe XML parser.
[in]newNodeThe Node to process.

Definition at line 1946 of file ixmlparser.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Parser_pushElement()

static int Parser_pushElement ( Parser xmlParser,
IXML_Node newElement 
)
static

Push a new element onto element stack.

Returns
Parameters
[in]xmlParserThe XML parser.
[in]newElementThe element node to push.

Definition at line 1984 of file ixmlparser.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isTopLevelElement()

static int isTopLevelElement ( Parser xmlParser)
static

Reports whether there is a top level element in the parser.

Returns
1 if there is a top level element in the parser.
Parameters
[in]xmlParserThe XML parser.

Definition at line 2044 of file ixmlparser.cpp.

+ Here is the caller graph for this function:

◆ Parser_hasDefaultNamespace()

static int Parser_hasDefaultNamespace ( Parser xmlParser,
char **  nsURI 
)
static

Decide whether the current element has default namespace.

Parameters
[in]xmlParserThe XML parser.
[in,out]nsURIThe name space URI.

Definition at line 2054 of file ixmlparser.cpp.

+ Here is the caller graph for this function:

◆ Parser_processElementName()

static int Parser_processElementName ( IXML_Document rootDoc,
Parser xmlParser,
IXML_Node newNode 
)
static

Processes element name.

Returns
IXML_SUCCESS if successful, otherwise or an error code.
Parameters
[in]rootDocThe XML document.
[in]xmlParserThe XML parser.
[in]newNodeThe Node to process.

Definition at line 2078 of file ixmlparser.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Parser_isValidEndElement()

static int Parser_isValidEndElement ( Parser xmlParser,
IXML_Node newNode 
)
static

Check if a new node->nodeName matches top of element stack.

Returns
1 if matches.
Parameters
[in]xmlParserThe XML parser.
[in]newNodeThe node.

Definition at line 2155 of file ixmlparser.cpp.

+ Here is the caller graph for this function:

◆ Parser_popElement()

static void Parser_popElement ( Parser xmlParser)
static

Remove element from element stack.

Parameters
[in]xmlParserThe XML parser.

Definition at line 2175 of file ixmlparser.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Parser_eTagVerification()

static int Parser_eTagVerification ( Parser xmlParser,
IXML_Node newNode 
)
static

Verifies endof element tag is the same as the openning element tag.

Parameters
[in]xmlParserThe XML parser.
[in]newNodeThe Node to process.

Definition at line 2200 of file ixmlparser.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Parser_parseDocument()

static int Parser_parseDocument ( IXML_Document **  retDoc,
Parser xmlParser 
)
static

Parses the xml file and returns the DOM document tree.

Returns
Parameters
[out]retDocThe XML document.
[in]xmlParserThe XML parser.

Definition at line 2235 of file ixmlparser.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Parser_isValidXmlName()

int Parser_isValidXmlName ( const DOMString  name)

Check to see whether name is a valid xml name.

Parameters
[in]nameThe string to be checked.

Definition at line 2359 of file ixmlparser.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Parser_setErrorChar()

void Parser_setErrorChar ( char  c)

Sets the error character.

If 'c' is 0 (default), the parser is strict about XML encoding: invalid UTF-8 sequences or "&" entities are rejected, and the parsing aborts.

If 'c' is not 0, the parser is relaxed: invalid UTF-8 characters are replaced by this character, and invalid "&" entities are left untranslated. The parsing is then allowed to continue.

Parameters
[in]cThe character to become the error character.

Definition at line 2380 of file ixmlparser.cpp.

+ Here is the caller graph for this function:

◆ Parser_init()

static Parser * Parser_init ( )
static

Initializes a xml parser.

Returns
The parser object or NULL if there is not enough memory.

Definition at line 2395 of file ixmlparser.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Parser_readFileOrBuffer()

static int Parser_readFileOrBuffer ( Parser xmlParser,
const char *  xmlFileName,
int  file 
)
static

Read a xml file or buffer contents into xml parser.

Parameters
[in]xmlParserThe XML parser.
[in]xmlFileNameThe file name or the buffer to copy, according to the parameter "file".
[in]file1 if you want to read from a file, 0 if xmlFileName is the buffer to copy to the parser.

Definition at line 2413 of file ixmlparser.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Parser_LoadDocument()

int Parser_LoadDocument ( IXML_Document **  retDoc,
const char *  xmlFileName,
int  file 
)

Parses a xml file and return the DOM tree.

Parameters
[out]retDocThe output document tree.
[in]xmlFileNameThe file name or the buffer to copy, according to the parameter "file".
[in]file1 if you want to read from a file, 0 if xmlFileName is the buffer to copy to the parser.

Definition at line 2475 of file ixmlparser.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Parser_freeNodeContent()

void Parser_freeNodeContent ( IXML_Node nodeptr)

Fees a node contents.

Parameters
[in]nodeptrThe Node to process.

Definition at line 2503 of file ixmlparser.cpp.

+ Here is the caller graph for this function:

◆ Parser_setNodePrefixAndLocalName()

int Parser_setNodePrefixAndLocalName ( IXML_Node node)

Set the node prefix and localName as defined by the nodeName in the form of ns:name.

Parameters
[in,out]nodeThe Node to process.

Definition at line 2533 of file ixmlparser.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ Letter

char_info_t Letter[]
static

The letter table contains all characters in XML 1.0 plus ":", "_" and ideographic.

This table contains all the characters that an element name can start with. See XML 1.0 (2nd Edition) for more details.

Definition at line 94 of file ixmlparser.cpp.

◆ NameChar

char_info_t NameChar[]
static

The NameChar table contains CombiningChar, Extender, Digit, '-', '.', less '_', ':'.

NameChar ::= Digit | '-' | '.' | CombiningChar | Extender See XML 1.0 2nd Edition

Definition at line 180 of file ixmlparser.cpp.