[asterisk-commits] eliel: branch eliel/data_retrieval r195018 - in /team/eliel/data_retrieval: ....

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sat May 16 15:29:34 CDT 2009


Author: eliel
Date: Sat May 16 15:29:26 2009
New Revision: 195018

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=195018
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:
    team/eliel/data_retrieval/   (props changed)
    team/eliel/data_retrieval/Makefile
    team/eliel/data_retrieval/doc/appdocsxml.dtd
    team/eliel/data_retrieval/main/xml.c

Propchange: team/eliel/data_retrieval/
------------------------------------------------------------------------------
    automerge = *

Propchange: team/eliel/data_retrieval/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Sat May 16 15:29:26 2009
@@ -1,1 +1,1 @@
-/trunk:1-194950
+/trunk:1-195008

Modified: team/eliel/data_retrieval/Makefile
URL: http://svn.asterisk.org/svn-view/asterisk/team/eliel/data_retrieval/Makefile?view=diff&rev=195018&r1=195017&r2=195018
==============================================================================
--- team/eliel/data_retrieval/Makefile (original)
+++ team/eliel/data_retrieval/Makefile Sat May 16 15:29:26 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: team/eliel/data_retrieval/doc/appdocsxml.dtd
URL: http://svn.asterisk.org/svn-view/asterisk/team/eliel/data_retrieval/doc/appdocsxml.dtd?view=diff&rev=195018&r1=195017&r2=195018
==============================================================================
--- team/eliel/data_retrieval/doc/appdocsxml.dtd (original)
+++ team/eliel/data_retrieval/doc/appdocsxml.dtd Sat May 16 15:29:26 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: team/eliel/data_retrieval/main/xml.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/eliel/data_retrieval/main/xml.c?view=diff&rev=195018&r1=195017&r2=195018
==============================================================================
--- team/eliel/data_retrieval/main/xml.c (original)
+++ team/eliel/data_retrieval/main/xml.c Sat May 16 15:29:26 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,6 +56,13 @@
 	}
 
 	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;
 }




More information about the asterisk-commits mailing list