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 Parser * | Parser_init (void) |
| 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 '_', ':'. | |
| struct char_info |
Definition at line 87 of file ixmlparser.cpp.
| Class Members | ||
|---|---|---|
| unsigned short | l | |
| unsigned short | h | |
The size of the letter table array.
Definition at line 180 of file ixmlparser.cpp.
The name char table array size.
Definition at line 245 of file ixmlparser.cpp.
|
static |
Frees one ElementStack item.
| [in] | pItem | The element stack item to free. |
Definition at line 250 of file ixmlparser.cpp.
Here is the caller graph for this function:
|
static |
Frees namespaceURI item.
| [in] | pNsURI | The name space URI item to free. |
Definition at line 271 of file ixmlparser.cpp.
Here is the caller graph for this function:
|
static |
Frees all temporary memory allocated by xmlparser.
| [in] | xmlParser | The XML parser. |
Definition at line 286 of file ixmlparser.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Skips document type declaration.
| [in,out] | pstr | The pointer to the skipped point. |
Definition at line 328 of file ixmlparser.cpp.
Here is the caller graph for this function:
|
static |
Skips all characters in the string until it finds the skip key. Then it skips the skip key and returns.
| [in,out] | pstrSrc | The pointer to the skipped point. |
| [in] | strSkipKey | The skip key. |
Definition at line 370 of file ixmlparser.cpp.
Here is the caller graph for this function:
|
static |
Skip UTF-8 byte order mark.
| [in] | xmlParser | The XML parser. |
Definition at line 395 of file ixmlparser.cpp.
Here is the caller graph for this function:
|
static |
Skip white spaces.
| [in] | xmlParser | The XML parser. |
Definition at line 407 of file ixmlparser.cpp.
Here is the caller graph for this function:
|
static |
Skips XML declarations.
| [in,out] | xmlParser | The XML parser. |
Definition at line 420 of file ixmlparser.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Skips all characters in the string until it finds the skip key. Then it skips the skip key and returns.
| [in,out] | pstrSrc | The pointer to the skipped point. |
Definition at line 439 of file ixmlparser.cpp.
Here is the caller graph for this function:
|
static |
Skip comment, PI and white space.
| [in] | xmlParser | The XML parser. |
Definition at line 463 of file ixmlparser.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Skip prolog.
| [in,out] | xmlParser | The XML parser. |
Definition at line 497 of file ixmlparser.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Set the last element to be the given string.
| [in] | xmlParser | The XML parser. |
| [in] | s | The string to copy from. |
Definition at line 536 of file ixmlparser.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Clear token buffer.
| [in] | xmlParser | The XML parser. |
Definition at line 554 of file ixmlparser.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
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.
| [in] | ss | The pointer to the character to encode. |
| [out] | len | The number of octets of the UTF-8 encoding of this character. |
Definition at line 566 of file ixmlparser.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Will determine whether character c is in the table of tbl (either Letter table or NameChar table).
| [in] | c | Character to check. |
| [in] | tbl | Table to use. |
| [in] | sz | Size of the table. |
Definition at line 633 of file ixmlparser.cpp.
Here is the caller graph for this function:
|
static |
Check whether c (int) is in LetterTable or NameCharTable.
| [in] | c | The character to check. |
| [in] | bNameChar | 1 if you also want to check in the NameChar table. |
Definition at line 661 of file ixmlparser.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
see XML 1.0 (2nd Edition) 2.2.
| [in] | c | The character to check. |
Definition at line 681 of file ixmlparser.cpp.
Here is the caller graph for this function:
|
static |
Returns next char value and its length.
| [in] | src | . |
| [in,out] | cLen | . |
Definition at line 691 of file ixmlparser.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Appends c to token buffer.
| [in] | xmlParser | The XML parser. |
| [in] | c | The character to append. |
Definition at line 829 of file ixmlparser.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Encodes a character to its UTF-8 character string, and return its length.
| [in] | c | The character to encode. |
| [out] | s | The resultant UTF-8 encoded string. |
Definition at line 846 of file ixmlparser.cpp.
Here is the caller graph for this function:
|
static |
Appends string s to token buffer.
| [in] | xmlParser | The XML parser. |
| [in] | s | The string to append. |
Definition at line 907 of file ixmlparser.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Copy string in src into xml parser token buffer.
| [in] | xmlParser | The XML parser. |
| [in] | src | The string to copy from. |
| [in] | len | The lenght to copy. |
Definition at line 924 of file ixmlparser.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Return the length of next token in tokenBuff.
| [in] | xmlParser | The XML parser. |
Definition at line 989 of file ixmlparser.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Version of strdup() that handles NULL input.
| [in] | s | String to be duplicated. |
Definition at line 1069 of file ixmlparser.cpp.
Here is the caller graph for this function:Processes the STag as defined by XML spec.
| [in] | xmlParser | The XML parser. |
| [in] | node | The Node to process. |
Definition at line 1083 of file ixmlparser.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Parser_skipPI.
| [in,out] | pSrc | The pointer to the skipped point. |
Definition at line 1147 of file ixmlparser.cpp.
Here is the caller graph for this function:
|
static |
Processes CDSection as defined by XML spec.
| [in] | pSrc | . |
| [in] | node | The Node to process. |
Definition at line 1180 of file ixmlparser.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:Processes the CONTENT as defined in XML spec.
| [in] | xmlParser | The XML parser. |
| [in] | node | The Node to process. |
Definition at line 1234 of file ixmlparser.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:Process ETag as defined by XML spec.
| [in] | xmlParser | The XML parser. |
| [in] | node | The Node to process. |
| [out] | bETag | . |
Definition at line 1354 of file ixmlparser.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Unimplemented function.
Return the namespce as defined as prefix.
| [in] | xmlParser | The XML parser. |
| [in] | prefix | The prefix. |
Definition at line 1440 of file ixmlparser.cpp.
Here is the caller graph for this function:
|
static |
Add a namespace definition.
| [in] | xmlParser | The XML parser. |
Definition at line 1467 of file ixmlparser.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:Add namespace definition.
| [in] | xmlParser | The XML parser. |
| [in] | newNode | The Node to process. |
Definition at line 1507 of file ixmlparser.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:Processes attribute.
| [in] | xmlParser | The XML parser. |
| [in] | node | The Node to process. |
Definition at line 1634 of file ixmlparser.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:Get the next node.
| [in] | xmlParser | The XML parser. |
| [out] | node | The XML parser. |
| [out] | bETag | The XML parser. |
Definition at line 1788 of file ixmlparser.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Decides whether element's prefix is already defined.
| [in] | xmlParser | The XML parser. |
| [in] | newNode | The Node to process. |
| [in,out] | nsURI | The name space URI. |
Definition at line 1895 of file ixmlparser.cpp.
Here is the caller graph for this function:
|
static |
Set element's namespace.
| [in] | newElement | The Element Node to process. |
| [in] | nsURI | The name space string. |
Definition at line 1932 of file ixmlparser.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:Reports whether the new attribute is the same as an existing one.
| [in] | xmlParser | The XML parser. |
| [in] | newAttrNode | The node attribute to compare. |
Definition at line 1961 of file ixmlparser.cpp.
Here is the caller graph for this function:
|
static |
Processes the attribute name.
| [in] | rootDoc | The XML document. |
| [in] | xmlParser | The XML parser. |
| [in] | newNode | The Node to process. |
Definition at line 1987 of file ixmlparser.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:Push a new element onto element stack.
| [in] | xmlParser | The XML parser. |
| [in] | newElement | The element node to push. |
Definition at line 2025 of file ixmlparser.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Reports whether there is a top level element in the parser.
| [in] | xmlParser | The XML parser. |
Definition at line 2085 of file ixmlparser.cpp.
Here is the caller graph for this function:
|
static |
Decide whether the current element has default namespace.
| [in] | xmlParser | The XML parser. |
| [in,out] | nsURI | The name space URI. |
Definition at line 2095 of file ixmlparser.cpp.
Here is the caller graph for this function:
|
static |
Processes element name.
| [in] | rootDoc | The XML document. |
| [in] | xmlParser | The XML parser. |
| [in] | newNode | The Node to process. |
Definition at line 2119 of file ixmlparser.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:Check if a new node->nodeName matches top of element stack.
| [in] | xmlParser | The XML parser. |
| [in] | newNode | The node. |
Definition at line 2196 of file ixmlparser.cpp.
Here is the caller graph for this function:
|
static |
Remove element from element stack.
| [in] | xmlParser | The XML parser. |
Definition at line 2216 of file ixmlparser.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:Verifies endof element tag is the same as the openning element tag.
| [in] | xmlParser | The XML parser. |
| [in] | newNode | The Node to process. |
Definition at line 2241 of file ixmlparser.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Parses the xml file and returns the DOM document tree.
| [out] | retDoc | The XML document. |
| [in] | xmlParser | The XML parser. |
Definition at line 2276 of file ixmlparser.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| int Parser_isValidXmlName | ( | const DOMString | name | ) |
Check to see whether name is a valid xml name.
| [in] | name | The string to be checked. |
Definition at line 2401 of file ixmlparser.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| 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.
| [in] | c | The character to become the error character. |
Definition at line 2422 of file ixmlparser.cpp.
Here is the caller graph for this function:
|
static |
Initializes a xml parser.
Definition at line 2439 of file ixmlparser.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Read a xml file or buffer contents into xml parser.
| [in] | xmlParser | The XML parser. |
| [in] | xmlFileName | The file name or the buffer to copy, according to the parameter "file". |
| [in] | file | 1 if you want to read from a file, 0 if xmlFileName is the buffer to copy to the parser. |
Definition at line 2457 of file ixmlparser.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| int Parser_LoadDocument | ( | IXML_Document ** | retDoc, |
| const char * | xmlFileName, | ||
| int | file | ||
| ) |
Parses a xml file and return the DOM tree.
| [out] | retDoc | The output document tree. |
| [in] | xmlFileName | The file name or the buffer to copy, according to the parameter "file". |
| [in] | file | 1 if you want to read from a file, 0 if xmlFileName is the buffer to copy to the parser. |
Definition at line 2519 of file ixmlparser.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| void Parser_freeNodeContent | ( | IXML_Node * | nodeptr | ) |
Fees a node contents.
| [in] | nodeptr | The Node to process. |
Definition at line 2547 of file ixmlparser.cpp.
Here is the caller graph for this function:| int Parser_setNodePrefixAndLocalName | ( | IXML_Node * | node | ) |
Set the node prefix and localName as defined by the nodeName in the form of ns:name.
| [in,out] | node | The Node to process. |
Definition at line 2577 of file ixmlparser.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
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 103 of file ixmlparser.cpp.
|
static |
The NameChar table contains CombiningChar, Extender, Digit, '-', '.', less '_', ':'.
NameChar ::= Digit | '-' | '.' | CombiningChar | Extender See XML 1.0 2nd Edition
Definition at line 189 of file ixmlparser.cpp.