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: https://origsvn.digium.com/svn/asterisk/trunk@194982 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Eliel C. Sardanons
2009-05-16 20:01:22 +00:00
parent 766972a3cd
commit 2f996a3ab4
3 changed files with 34 additions and 16 deletions

View File

@@ -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) {