[asterisk-commits] eliel: branch 1.6.2 r195093 - in /branches/1.6.2: ./ doc/ main/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon May 18 08:46:14 CDT 2009


Author: eliel
Date: Mon May 18 08:46:10 2009
New Revision: 195093

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=195093
Log:
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
........

Modified:
    branches/1.6.2/   (props changed)
    branches/1.6.2/Makefile
    branches/1.6.2/doc/appdocsxml.dtd
    branches/1.6.2/main/xml.c

Propchange: branches/1.6.2/
------------------------------------------------------------------------------
Binary property 'trunk-merged' - no diff available.

Modified: branches/1.6.2/Makefile
URL: http://svn.asterisk.org/svn-view/asterisk/branches/1.6.2/Makefile?view=diff&rev=195093&r1=195092&r2=195093
==============================================================================
--- branches/1.6.2/Makefile (original)
+++ branches/1.6.2/Makefile Mon May 18 08:46:10 2009
@@ -497,7 +497,7 @@
 	@echo -n "Building Documentation For: "
 	@echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" > $@
 	@echo "<!DOCTYPE docs SYSTEM \"appdocsxml.dtd\">" >> $@
-	@echo "<docs>" >> $@
+	@echo "<docs xmlns:xi=\"http://www.w3.org/2001/XInclude\">" >> $@
 	@for x in $(MOD_SUBDIRS); do \
 		echo -n "$$x " ; \
 		for i in $$x/*.c; do \

Modified: branches/1.6.2/doc/appdocsxml.dtd
URL: http://svn.asterisk.org/svn-view/asterisk/branches/1.6.2/doc/appdocsxml.dtd?view=diff&rev=195093&r1=195092&r2=195093
==============================================================================
--- branches/1.6.2/doc/appdocsxml.dtd (original)
+++ branches/1.6.2/doc/appdocsxml.dtd Mon May 18 08:46:10 2009
@@ -1,4 +1,15 @@
-  <!ELEMENT docs (application|function|agi)* >
+  <!ELEMENT docs (application|function|agi)*>
+  <!ATTLIST docs xmlns:xi CDATA #FIXED "http://www.w3.org/2001/XInclude">
+
+  <!ELEMENT xi:include (xi:fallback?) >
+  <!ATTLIST xi:include 
+  xmlns:xi	CDATA       #FIXED    "http://www.w3.org/2001/XInclude"
+  href		CDATA       #IMPLIED
+  parse		(xml|text)  "xml"
+  xpointer	CDATA       #IMPLIED
+  encoding	CDATA       #IMPLIED 
+  accept	CDATA       #IMPLIED
+  accept-language CDATA  #IMPLIED >
 
   <!ELEMENT application (synopsis?,syntax?,description?,see-also?)>
   <!ATTLIST application name CDATA #REQUIRED>
@@ -12,19 +23,19 @@
   <!ATTLIST agi name CDATA #REQUIRED>
   <!ATTLIST agi language CDATA #REQUIRED>
 
-  <!ELEMENT see-also (ref*)>
+  <!ELEMENT see-also (ref|xi:include)*>
 
-  <!ELEMENT ref (#PCDATA)*>
+  <!ELEMENT ref (#PCDATA)>
   <!ATTLIST ref type (application|function|astcli|link|manpage|filename|agi) #REQUIRED>
 
   <!ELEMENT synopsis (#PCDATA)>
 
-  <!ELEMENT syntax (parameter*)>
+  <!ELEMENT syntax (parameter|xi:include)*>
   <!ATTLIST syntax argsep CDATA ",">
 
-  <!ELEMENT description (para|note|warning|variablelist|enumlist)*>
+  <!ELEMENT description (para|note|warning|variablelist|enumlist|xi:include)*>
 
-  <!ELEMENT parameter (optionlist|enumlist|argument|para|note|warning|parameter)*>
+  <!ELEMENT parameter (optionlist|enumlist|argument|para|note|warning|parameter|xi:include)*>
   <!ATTLIST parameter name CDATA "">
   <!ATTLIST parameter required (yes|no|true|false) "false">
   <!ATTLIST parameter multiple (yes|no|true|false) "false">
@@ -34,24 +45,24 @@
   <!ATTLIST parameter argsep CDATA ",">
 
   <!ELEMENT optionlist (option+)>
-  <!ELEMENT option (argument|para|note|warning|variablelist|enumlist)*>
+  <!ELEMENT option (argument|para|note|warning|variablelist|enumlist|xi:include)*>
   <!ATTLIST option name CDATA #REQUIRED>
   <!ATTLIST option argsep CDATA ",">
   <!ATTLIST option implies CDATA "">
   <!ATTLIST option hasparams CDATA "">
 
   <!ELEMENT enumlist (enum+)>
-  <!ELEMENT enum (para|note|warning|parameter|enumlist)*>
+  <!ELEMENT enum (para|note|warning|parameter|enumlist|xi:include)*>
   <!ATTLIST enum name CDATA "">
 
-  <!ELEMENT argument (para|note|warning|variablelist|argument)*>
+  <!ELEMENT argument (para|note|warning|variablelist|argument|xi:include)*>
   <!ATTLIST argument name CDATA #REQUIRED>
   <!ATTLIST argument multiple (yes|no|true|false) "false">
   <!ATTLIST argument required (yes|no|true|false) "false">
   <!ATTLIST argument hasparams (yes|no|true|false|optional) "false">
   <!ATTLIST argument argsep CDATA ",">
 
-  <!ELEMENT para (#PCDATA|astcli|literal|emphasis|filename|directory|replaceable|variable)*>
+  <!ELEMENT para (#PCDATA|astcli|literal|emphasis|filename|directory|replaceable|variable|xi:include)*>
   <!ELEMENT literal (#PCDATA)>
   <!ELEMENT emphasis (#PCDATA)>
   <!ELEMENT filename (#PCDATA)>
@@ -59,11 +70,11 @@
   <!ELEMENT directory (#PCDATA)>
   <!ELEMENT astcli (#PCDATA)>
  
-  <!ELEMENT note (para+)>
-  <!ELEMENT warning (para+)>
+  <!ELEMENT note (para+|xi:include*)>
+  <!ELEMENT warning (para+|xi:include*)>
 
-  <!ELEMENT variablelist (variable+)>
-  <!ELEMENT variable (#PCDATA|value|para)*>
+  <!ELEMENT variablelist (variable+|xi:include*)>
+  <!ELEMENT variable (#PCDATA|value|para|xi:include)*>
   <!ATTLIST variable name CDATA "">
 
   <!ELEMENT value (#PCDATA)>

Modified: branches/1.6.2/main/xml.c
URL: http://svn.asterisk.org/svn-view/asterisk/branches/1.6.2/main/xml.c?view=diff&rev=195093&r1=195092&r2=195093
==============================================================================
--- branches/1.6.2/main/xml.c (original)
+++ branches/1.6.2/main/xml.c Mon May 18 08:46:10 2009
@@ -29,6 +29,7 @@
 #if defined(HAVE_LIBXML2)
 #include <libxml/parser.h>
 #include <libxml/tree.h>
+#include <libxml/xinclude.h>
 /* libxml2 ast_xml implementation. */
 
 
@@ -55,10 +56,16 @@
 	}
 
 	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)
 {




More information about the asterisk-commits mailing list