diff options
Diffstat (limited to 'main/xml.c')
-rw-r--r-- | main/xml.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/main/xml.c b/main/xml.c index 9a0c66d90..fe00bfbf6 100644 --- a/main/xml.c +++ b/main/xml.c @@ -29,6 +29,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") #if defined(HAVE_LIBXML2) #include <libxml/parser.h> #include <libxml/tree.h> +#include <libxml/xinclude.h> /* libxml2 ast_xml implementation. */ @@ -55,11 +56,17 @@ struct ast_xml_doc *ast_xml_open(char *filename) } doc = xmlReadFile(filename, NULL, XML_PARSE_RECOVER); + if (doc) { + /* process xinclude elements. */ + if (xmlXIncludeProcess(doc) <= 0) { + xmlFreeDoc(doc); + return NULL; + } + } return (struct ast_xml_doc *) doc; } - void ast_xml_close(struct ast_xml_doc *doc) { if (!doc) { |