Changeset 71 for trunk/include/helpers/xml.h
- Timestamp:
- May 22, 2001, 7:18:41 PM (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/helpers/xml.h
r64 r71 43 43 ********************************************************************/ 44 44 45 typedef enum _DOMERROR 46 { 47 // validity errors: 45 // ERROR_XML_FIRST is defined in expat\expat.h; 46 // the range up to ERROR_XML_FIRST + 24 is used 47 // by expat 48 48 49 // START MATCHING ERROR MESSAGES (xmlDescribeError) 49 ERROR_DOM_UNDECLARED_ELEMENT = ERROR_EXPAT_AFTER_LAST, 50 // validity errors: 51 #define ERROR_DOM_UNDECLARED_ELEMENT (ERROR_XML_FIRST + 24) 50 52 // invalidity: element is undeclared 51 ERROR_DOM_ROOT_ELEMENT_MISNAMED,52 ERROR_DOM_INVALID_ROOT_ELEMENT,53 ERROR_DOM_INVALID_SUBELEMENT,53 #define ERROR_DOM_ROOT_ELEMENT_MISNAMED (ERROR_XML_FIRST + 25) 54 #define ERROR_DOM_INVALID_ROOT_ELEMENT (ERROR_XML_FIRST + 26) 55 #define ERROR_DOM_INVALID_SUBELEMENT (ERROR_XML_FIRST + 27) 54 56 // subelement may not appear in its parent element 55 ERROR_DOM_DUPLICATE_ELEMENT_DECL,57 #define ERROR_DOM_DUPLICATE_ELEMENT_DECL (ERROR_XML_FIRST + 28) 56 58 // more than one declaration for an element type 57 ERROR_DOM_DUPLICATE_ATTRIBUTE_DECL,59 #define ERROR_DOM_DUPLICATE_ATTRIBUTE_DECL (ERROR_XML_FIRST + 29) 58 60 // more than one declaration for an attribute type 59 ERROR_DOM_UNDECLARED_ATTRIBUTE,60 ERROR_ELEMENT_CANNOT_HAVE_CONTENT,61 #define ERROR_DOM_UNDECLARED_ATTRIBUTE (ERROR_XML_FIRST + 30) 62 #define ERROR_ELEMENT_CANNOT_HAVE_CONTENT (ERROR_XML_FIRST + 31) 61 63 // element was declared "empty" and contains text anyway, 62 64 // or was declared "children" and contains something other 63 65 // than whitespace 64 ERROR_DOM_INVALID_ATTRIB_VALUE,65 ERROR_DOM_REQUIRED_ATTRIBUTE_MISSING,66 ERROR_DOM_SUBELEMENT_IN_EMPTY_ELEMENT,66 #define ERROR_DOM_INVALID_ATTRIB_VALUE (ERROR_XML_FIRST + 32) 67 #define ERROR_DOM_REQUIRED_ATTRIBUTE_MISSING (ERROR_XML_FIRST + 33) 68 #define ERROR_DOM_SUBELEMENT_IN_EMPTY_ELEMENT (ERROR_XML_FIRST + 34) 67 69 // END MATCHING ERROR MESSAGES (xmlDescribeError) 68 70 69 71 // error categories: 70 ERROR_DOM_PARSING,71 ERROR_DOM_VALIDITY,72 #define ERROR_DOM_PARSING (ERROR_XML_FIRST + 35) 73 #define ERROR_DOM_VALIDITY (ERROR_XML_FIRST + 36) 72 74 73 75 // additional DOM errors 74 ERROR_DOM_NODETYPE_NOT_SUPPORTED,76 #define ERROR_DOM_NODETYPE_NOT_SUPPORTED (ERROR_XML_FIRST + 37) 75 77 // invalid node type in xmlCreateDomNode 76 ERROR_DOM_NO_DOCUMENT,78 #define ERROR_DOM_NO_DOCUMENT (ERROR_XML_FIRST + 38) 77 79 // cannot find document node 78 ERROR_DOM_NO_ELEMENT,79 ERROR_DOM_DUPLICATE_DOCTYPE,80 ERROR_DOM_DOCTYPE_ROOT_NAMES_MISMATCH,80 #define ERROR_DOM_NO_ELEMENT (ERROR_XML_FIRST + 39) 81 #define ERROR_DOM_DUPLICATE_DOCTYPE (ERROR_XML_FIRST + 40) 82 #define ERROR_DOM_DOCTYPE_ROOT_NAMES_MISMATCH (ERROR_XML_FIRST + 41) 81 83 // DOCTYPE is given and root element name does not match doctype name 82 ERROR_DOM_INTEGRITY,83 ERROR_DOM_DUPLICATE_ATTRIBUTE,84 #define ERROR_DOM_INTEGRITY (ERROR_XML_FIRST + 42) 85 #define ERROR_DOM_DUPLICATE_ATTRIBUTE (ERROR_XML_FIRST + 43) 84 86 85 87 // @@@todo these 86 ERROR_DOM_VALIDATE_INVALID_ELEMENT, 87 ERROR_DOM_ELEMENT_DECL_OUTSIDE_DOCTYPE, 88 ERROR_DOM_ATTLIST_DECL_OUTSIDE_DOCTYPE 89 } DOMERROR; 88 #define ERROR_DOM_VALIDATE_INVALID_ELEMENT (ERROR_XML_FIRST + 44) 89 #define ERROR_DOM_ELEMENT_DECL_OUTSIDE_DOCTYPE (ERROR_XML_FIRST + 45) 90 #define ERROR_DOM_ATTLIST_DECL_OUTSIDE_DOCTYPE (ERROR_XML_FIRST + 46) 90 91 91 92 const char* xmlDescribeError(int code); … … 130 131 /* 131 132 *@@ NODEBASE: 132 * "content model" node. With the DOM content models, 133 * this represents an entry in a DTD or XML schema. 133 * root class of all nodes used in the 134 * DOM tree. 135 * 136 * The first item is a TREE to make this insertable 137 * into string maps via the functions in tree.c. 138 * 139 * A NODEBASE is also the first member of a DOMNODE 140 * so this is effectively a simulation of inheritance 141 * in plain C... DOMNODE inherits from NODEBASE, 142 * and some other types inherit from DOMNODE. 143 * 144 * This contains the node name, which is also used 145 * by the DOMNODE's (e.g. for element names). 146 * However, only DOMNODE defines the node value 147 * string. 134 148 * 135 149 *@@added V0.9.9 (2001-02-14) [umoeller] … … 138 152 typedef struct _NODEBASE 139 153 { 140 TREE Tree; 141 142 NODEBASETYPE ulNodeType; 154 TREE Tree; // tree.c 155 156 NODEBASETYPE ulNodeType; // class type; this is precious, 157 // all xml* functions make assumptions 158 // from this value 143 159 144 160 XSTRING strNodeName; … … 189 205 * Overview of member fields usage: 190 206 + 191 + ulNodeType | strNodeName | strNodeValue | llChildren | llAttributes 207 + ulNodeType | strNodeName | strNodeValue | llChildren | AttributesMap 208 + (NODEBASE) | (NODEBASE) | (DOMNODE) | (DOMNODE) | (DOMNODE) 192 209 + ======================================================================= 193 210 + | | | | … … 409 426 // one of: 410 427 // -- XML_CQUANT_NONE --> all fields below are NULL 411 // -- XML_CQUANT_OPT, 412 // -- XML_CQUANT_REP, 413 // -- XML_CQUANT_PLUS 428 // -- XML_CQUANT_OPT, question mark 429 // -- XML_CQUANT_REP, asterisk 430 // -- XML_CQUANT_PLUS plus sign 414 431 415 432 struct _CMELEMENTPARTICLE *pParentParticle; // or NULL if this is in the … … 596 613 /* ****************************************************************** 597 614 * 598 * DOM APIs615 * DOM parser APIs 599 616 * 600 617 ********************************************************************/ … … 690 707 const char *pcszAttribName); 691 708 709 /* ****************************************************************** 710 * 711 * DOM build 712 * 713 ********************************************************************/ 714 715 APIRET xmlCreateDocument(const char *pcszRootElementName, 716 PDOMDOCUMENTNODE *ppDocument, 717 PDOMNODE *ppRootElement); 718 719 APIRET xmlWriteDocument(PDOMDOCUMENTNODE pDocument, 720 const char *pcszEncoding, 721 const char *pcszDoctype, 722 PXSTRING pxstr); 692 723 #endif 693 724
Note:
See TracChangeset
for help on using the changeset viewer.