4 #include <opensrf/osrf_json.h>
5 #include <libxml/parser.h>
6 #include <libxml/tree.h>
8 jsonObject* xmlDocToJSON(xmlDocPtr doc);
11 jsonObject* _xmlToJSON(xmlNodePtr node, jsonObject*);
13 /* debug function, prints each node and content */
14 void recurse_doc( xmlNodePtr node );
17 /* turns an XML doc into a char*.
18 User is responsible for freeing the returned char*
19 if(full), then we return the whole doc (xml declaration, etc.)
20 else we return the doc from the root node down
22 char* xmlDocToString(xmlDocPtr doc, int full);
25 /* Takes an xmlChar** from a SAX callback and returns the value
26 for the attribute with name 'name'
28 char* xmlSaxAttr( const xmlChar** atts, char* name );
31 Sets the xml attributes from atts to the given dom node
33 int xmlAddAttrs( xmlNodePtr node, const xmlChar** atts );