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
00031
00032 #ifndef _IXMLPARSER_H
00033 #define _IXMLPARSER_H
00034
00035 #include "ixml.h"
00036 #include "ixmlmembuf.h"
00037
00038
00039 #define QUOT """
00040 #define LT "<"
00041 #define GT ">"
00042 #define APOS "'"
00043 #define AMP "&"
00044 #define ESC_HEX "&#x"
00045 #define ESC_DEC "&#"
00046
00047 typedef struct _IXML_NamespaceURI
00048 {
00049 char *nsURI;
00050 char *prefix;
00051 struct _IXML_NamespaceURI *nextNsURI;
00052 } IXML_NamespaceURI;
00053
00054
00055 typedef struct _IXML_ElementStack
00056 {
00057 char *element;
00058 char *prefix;
00059 char *namespaceUri;
00060 IXML_NamespaceURI *pNsURI;
00061 struct _IXML_ElementStack *nextElement;
00062 } IXML_ElementStack;
00063
00064
00065 typedef enum
00066 {
00067 eELEMENT,
00068 eATTRIBUTE,
00069 eCONTENT,
00070 } PARSER_STATE;
00071
00072 typedef struct _Parser
00073 {
00074 char *dataBuffer;
00075 char *curPtr;
00076 char *savePtr;
00077 ixml_membuf lastElem;
00078 ixml_membuf tokenBuf;
00079
00080 IXML_Node *pNeedPrefixNode;
00081 IXML_ElementStack *pCurElement;
00082 IXML_Node *currentNodePtr;
00083 PARSER_STATE state;
00084
00085 BOOL bHasTopLevel;
00086
00087 } Parser;
00088
00089
00090
00091 int Parser_LoadDocument( IXML_Document **retDoc, const char * xmlFile, BOOL file);
00092 BOOL Parser_isValidXmlName( const DOMString name);
00093 int Parser_setNodePrefixAndLocalName(IXML_Node *newIXML_NodeIXML_Attr);
00094 void Parser_freeNodeContent( IXML_Node *IXML_Nodeptr);
00095
00096 void Parser_setErrorChar( char c );
00097
00098 void ixmlAttr_free(IXML_Attr *attrNode);
00099 void ixmlAttr_init(IXML_Attr *attrNode);
00100
00101 int ixmlElement_setTagName(IXML_Element *element, const char *tagName);
00102
00103 void ixmlNamedNodeMap_init(IXML_NamedNodeMap *nnMap);
00104 int ixmlNamedNodeMap_addToNamedNodeMap(IXML_NamedNodeMap **nnMap, IXML_Node *add);
00105
00106 void ixmlNode_init(IXML_Node *IXML_Nodeptr);
00107 BOOL ixmlNode_compare(IXML_Node *srcIXML_Node, IXML_Node *destIXML_Node);
00108
00109 void ixmlNode_getElementsByTagName( IXML_Node *n, const char *tagname, IXML_NodeList **list);
00110 void ixmlNode_getElementsByTagNameNS( IXML_Node *IXML_Node, const char *namespaceURI,
00111 const char *localName, IXML_NodeList **list);
00112
00113 int ixmlNode_setNodeProperties(IXML_Node* node, IXML_Node *src);
00114 int ixmlNode_setNodeName( IXML_Node* node, const DOMString qualifiedName);
00115
00116 void ixmlNodeList_init(IXML_NodeList *nList);
00117 int ixmlNodeList_addToNodeList(IXML_NodeList **nList, IXML_Node *add);
00118
00119 #endif // _IXMLPARSER_H