aboutsummaryrefslogtreecommitdiffstats
path: root/main/xml.c
diff options
context:
space:
mode:
authoreliel <eliel@f38db490-d61c-443f-a65b-d21fe96a405b>2009-05-18 13:46:10 +0000
committereliel <eliel@f38db490-d61c-443f-a65b-d21fe96a405b>2009-05-18 13:46:10 +0000
commitc0315134afc09c6ac6e6ca75cd35d5bc3d7dab68 (patch)
tree9303983e8d91d3b48065a8d3e394cd9209399c75 /main/xml.c
parenta459eef0fe1b5acb9df206670e9ba57850533dde (diff)
Merged revisions 194982 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk ........ r194982 | eliel | 2009-05-16 16:01:22 -0400 (Sat, 16 May 2009) | 20 lines Allow to include sections of other parts of the xml documentation. Avoid duplicating xml documentation by allowing to include other parts of the xml documentation using XInclude. Example: <xi:include xpointer="xpointer(/docs/function[@name='CHANNEL']/synopsis)" /> (Insert this line to include the synopsis of the CHANNEL function xml documentation). It is also possible to include documentation from other files in the 'documentation/' directory using the href="" attribute inside a xinclude element. (closes issue #15107) Reported by: lmadsen (issue #14444) Reported by: ewieling ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.2@195093 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/xml.c')
-rw-r--r--main/xml.c9
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) {