Fix documentation replication issues

This prevents XML documentation duplication by expanding channel and
bridge snapshot tags into channel and bridge snapshot parameter sets
with a given prefix or defaulting to no prefix. This also prevents
documentation from becoming fractured and out of date by keeping all
variations of the documentation in template form such that it only
needs to be updated once and keeps maintenance to a minimum.

Review: https://reviewboard.asterisk.org/r/2708/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@395985 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Kinsey Moore
2013-08-01 17:07:52 +00:00
parent 5601b0f50c
commit 03090a88ba
33 changed files with 303 additions and 779 deletions

View File

@@ -29,6 +29,7 @@
#include "asterisk/xml.h"
#include "asterisk/logger.h"
#include "asterisk/utils.h"
#include "asterisk/autoconfig.h"
ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
@@ -38,6 +39,10 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#include <libxml/xinclude.h>
#include <libxml/xpath.h>
/* libxml2 ast_xml implementation. */
#ifdef HAVE_LIBXSLT
#include <libxslt/xsltInternals.h>
#include <libxslt/transform.h>
#endif /* HAVE_LIBXSLT */
int ast_xml_init(void)
@@ -63,13 +68,32 @@ 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) {
if (!doc) {
return NULL;
}
/* process xinclude elements. */
if (xmlXIncludeProcess(doc) < 0) {
xmlFreeDoc(doc);
return NULL;
}
#ifdef HAVE_LIBXSLT
{
xsltStylesheetPtr xslt = xsltLoadStylesheetPI(doc);
if (xslt) {
xmlDocPtr tmpdoc = xsltApplyStylesheet(xslt, doc, NULL);
xsltFreeStylesheet(xslt);
xmlFreeDoc(doc);
return NULL;
if (!tmpdoc) {
return NULL;
}
doc = tmpdoc;
}
}
#else /* no HAVE_LIBXSLT */
ast_log(LOG_NOTICE, "XSLT support not found. XML documentation may be incomplete.\n");
#endif /* HAVE_LIBXSLT */
return (struct ast_xml_doc *) doc;
}