ixmlparser.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033 #ifndef IXMLPARSER_H
00034 #define IXMLPARSER_H
00035
00036
00042 #include "ixml.h"
00043 #include "ixmlmembuf.h"
00044
00045
00046
00047 #define QUOT """
00048 #define LT "<"
00049 #define GT ">"
00050 #define APOS "'"
00051 #define AMP "&"
00052 #define ESC_HEX "&#x"
00053 #define ESC_DEC "&#"
00054
00055
00056 typedef struct _IXML_NamespaceURI
00057 {
00058 char *nsURI;
00059 char *prefix;
00060 struct _IXML_NamespaceURI *nextNsURI;
00061 } IXML_NamespaceURI;
00062
00063
00064 typedef struct _IXML_ElementStack
00065 {
00066 char *element;
00067 char *prefix;
00068 char *namespaceUri;
00069 IXML_NamespaceURI *pNsURI;
00070 struct _IXML_ElementStack *nextElement;
00071 } IXML_ElementStack;
00072
00073
00074 typedef enum
00075 {
00076 eELEMENT,
00077 eATTRIBUTE,
00078 eCONTENT,
00079 } PARSER_STATE;
00080
00081
00082 typedef struct _Parser
00083 {
00085 char *dataBuffer;
00087 char *curPtr;
00089 char *savePtr;
00090 ixml_membuf lastElem;
00091 ixml_membuf tokenBuf;
00092 IXML_Node *pNeedPrefixNode;
00093 IXML_ElementStack *pCurElement;
00094 IXML_Node *currentNodePtr;
00095 PARSER_STATE state;
00096 BOOL bHasTopLevel;
00097 } Parser;
00098
00099
00103 BOOL Parser_isValidXmlName(
00105 const DOMString name);
00106
00107
00119 void Parser_setErrorChar(
00121 char c);
00122
00123
00127 void Parser_freeNodeContent(
00129 IXML_Node *IXML_Nodeptr);
00130
00131 int Parser_LoadDocument(IXML_Document **retDoc, const char * xmlFile, BOOL file);
00132
00133 int Parser_setNodePrefixAndLocalName(IXML_Node *newIXML_NodeIXML_Attr);
00134
00135
00136 void ixmlAttr_init(IXML_Attr *attrNode);
00137
00147 int ixmlElement_setTagName(
00149 IXML_Element *element,
00151 const char *tagName);
00152
00153
00157 void ixmlNamedNodeMap_init(
00159 IXML_NamedNodeMap *nnMap);
00160
00161
00167 int ixmlNamedNodeMap_addToNamedNodeMap(
00168
00169 IXML_NamedNodeMap **nnMap,
00170
00171 IXML_Node *add);
00172
00176 int ixmlNodeList_addToNodeList(
00178 IXML_NodeList **nList,
00180 IXML_Node *add);
00181
00182
00186 void ixmlNode_init(
00188 IN IXML_Node *nodeptr);
00189
00190
00199 BOOL ixmlNode_compare(
00201 IXML_Node *srcNode,
00203 IXML_Node *destNode);
00204
00205
00211 void ixmlNode_getElementsByTagName(
00213 IXML_Node *n,
00215 const char *tagname,
00217 IXML_NodeList **list);
00218
00219
00225 void ixmlNode_getElementsByTagNameNS(
00227 IXML_Node *n,
00229 const char *namespaceURI,
00231 const char *localName,
00233 IXML_NodeList **list);
00234
00235
00241 int ixmlNode_setNodeName(
00243 IXML_Node *node,
00245 const DOMString qualifiedName);
00246
00247
00253 int ixmlNode_setNodeProperties(
00255 IXML_Node *destNode,
00257 IXML_Node *src);
00258
00259
00263 void ixmlNodeList_init(
00265 IXML_NodeList *nList);
00266
00267
00268 #endif
00269