diff --git a/src/xml2json.c b/src/xml2json.c index ac9e014b..e234e7b4 100644 --- a/src/xml2json.c +++ b/src/xml2json.c @@ -19,6 +19,7 @@ #include "xml2json.h" #include "json.h" +#include "util.h" /* For XMLSTR() */ #include "cfgfile.h" @@ -108,6 +109,16 @@ static void handle_textchildnode(json_renderer_t *renderer, xmlDocPtr doc, xmlNo } } +static void handle_booleanchildnode(json_renderer_t *renderer, xmlDocPtr doc, xmlNodePtr node, xmlNodePtr parent, struct xml2json_cache *cache) +{ + xmlChar *value = xmlNodeListGetString(doc, node->xmlChildrenNode, 1); + if (value) { + json_renderer_write_key(renderer, (const char *)node->name, JSON_RENDERER_FLAGS_NONE); + json_renderer_write_boolean(renderer, util_str_to_bool((const char*)value)); + xmlFree(value); + } +} + static int handle_node_modules(json_renderer_t *renderer, xmlDocPtr doc, xmlNodePtr node, xmlNodePtr parent, struct xml2json_cache *cache) { if (node->type == XML_ELEMENT_NODE && strcmp((const char *)node->name, "modules") == 0) {