10 #define __ZEDA_XML_H__ 15 #include <libxml/parser.h> 20 #define zXMLInit() LIBXML_TEST_VERSION 24 #define zXMLCheckStr(str1,str2) ( strcmp( (char*)(str1), (str2) ) == 0 ) 26 #define zXMLGetString(node) ( (char *)xmlNodeListGetString( (node)->doc, node, 1 ) ) 27 #define zXMLGetInt(node) atoi( zXMLGetString( node ) ) 28 #define zXMLGetContent(node) ( (char *)xmlNodeGetContent( node ) ) 32 #define zXMLForEachNode(node,np) \ 33 for( (np)=(node); (np); (np)=(np)->next ) 35 #define zXMLCheckElement(node,str) \ 36 ( (node)->type == XML_ELEMENT_NODE && zXMLCheckStr( (node)->name, str ) ) 38 #define zXMLCheckElementAndExec(node,name,op) \ 39 if( zXMLCheckElement(node,name) ){ if( !op ) return false; } 42 #define zXMLFindNodeAttr(node,name) ( (char *)xmlGetProp( node, (xmlChar*)name ) ) 43 #define zXMLAddNodeAttr(node,name,val) xmlNewProp( node, (xmlChar *)name, (xmlChar *)val ) 44 #define zXMLReplaceNodeAttr(node,name,val) xmlSetProp( node, (xmlChar *)name, (xmlChar *)val ) 48 #define zXMLGetAttrVal(attr) ( (char *)xmlNodeListGetString( (attr)->doc, (attr)->children, 1 ) ) 49 #define zXMLGetAttrInt(attr) atoi( zXMLGetAttrVal( attr ) ) 50 #define zXMLGetAttrDouble(attr) atof( zXMLGetAttrVal( attr ) ) 52 #define zXMLForEachAttr(node,attr) \ 53 for( (attr)=(node)->properties; (attr); (attr)=(attr)->next ) 55 #define zXMLCheckAttr(attr,str) zXMLCheckStr( (attr)->name, str ) 57 #define zXMLCheckAttrAndExec(attr,str,op) \ 58 if( zXMLCheckStr( (attr)->name, str ) ){ (op); } bool zXMLCheckAttrVal(xmlAttr *attr, char *name, char *str)
#define __END_DECLS
Definition: zeda_defs.h:30
xmlNode * zXMLFindNodeElement(xmlNode *node, char *name)
#define __BEGIN_DECLS
Definition: zeda_defs.h:26
#define __EXPORT
Definition: zeda_compat.h:32