]> git.mjollnir.org Git - moodle.git/commitdiff
XMLDB generated docs: XHTML strictify output, and strip trailing whitespace.
authortjhunt <tjhunt>
Thu, 5 Mar 2009 03:09:33 +0000 (03:09 +0000)
committertjhunt <tjhunt>
Thu, 5 Mar 2009 03:09:33 +0000 (03:09 +0000)
admin/xmldb/actions/generate_documentation/generate_documentation.class.php
admin/xmldb/actions/generate_documentation/xmldb.xsl

index f45dcb6b6193b4335cc85f60d1fb8c54ca66067e..436ec41948a98f36170d1ec19d6ebe081dec94a2 100644 (file)
@@ -67,21 +67,21 @@ class generate_documentation extends XMLDBAction {
         if(!file_exists($path) || !is_readable($path)) {
             return false;
         }
-        
+
     /// Add link back to home
         $b = ' <p class="centerpara buttons">';
         $b .= '&nbsp;<a href="index.php?action=main_view#lastused">[' . $this->str['backtomainview'] . ']</a>';
         $b .= '</p>';
         $this->output=$b;
-        
+
         if(class_exists('XSLTProcessor')) {
         /// Transform XML file and display it
             $doc = new DOMDocument();
             $xsl = new XSLTProcessor();
-            
+
             $doc->load(dirname(__FILE__).'/xmldb.xsl');
             $xsl->importStyleSheet($doc);
-            
+
             $doc->load($path);
             $this->output.=$xsl->transformToXML($doc);
             $this->output.=$b;
index 5197eae3f47e36a020f3fa6f1fbb67175a314c2d..9236adf8eb5f7ff0f267300ed6087206f31cbeed 100644 (file)
@@ -1,6 +1,8 @@
 <?xml version="1.0" encoding="utf-8"?>
 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
 
+<xsl:output omit-xml-declaration="yes"/>
+
 <!-- Top level: disclaimer/intro -->
 <xsl:template match="/">
   <p>This documentation is generated automatically from the XMLDB database
@@ -18,7 +20,7 @@
 
 <!-- Fields (if any): table with field, type, comment -->
 <xsl:template match="FIELDS[FIELD]">
-  <table class="generaltable boxaligncenter" style="margin:1em 0" cellspacing="1" cellpadding="5" width="100%"> 
+  <table class="generaltable boxaligncenter" style="margin:1em 0" cellspacing="1" cellpadding="5" width="100%">
     <tr>
       <th class="header c0" scope="col">Field</th>
       <th class="header c1" scope="col">Type</th>
   </tr>
 </xsl:template>
 
-<!-- Keys (if any): table with key, type, field(s), reference, and comment --> 
+<!-- Keys (if any): table with key, type, field(s), reference, and comment -->
 <xsl:template match="KEYS[KEY]">
   <h4>Keys</h4>
-  <table class="generaltable boxaligncenter" cellspacing="1" cellpadding="5" width="100%"> 
-    <tr>      
+  <table class="generaltable boxaligncenter" cellspacing="1" cellpadding="5" width="100%">
+    <tr>
       <th class="header c0" scope="col">Name</th>
       <th class="header c1" scope="col">Type</th>
       <th class="header c2" scope="col">Field(s)</th>
       <th class="header c3" scope="col">Reference</th>
-      <!-- If no keys have comments (which is usually sensible since it's 
-         completely obvious what they are) then the comment column is not 
-         included -->      
+      <!-- If no keys have comments (which is usually sensible since it's
+         completely obvious what they are) then the comment column is not
+         included -->
       <xsl:if test="*[normalize-space(@COMMENT)!='']">
         <th class="header c4 lastcol" scope="col">Description</th>
       </xsl:if>
     </td>
     <xsl:if test="../*[normalize-space(@COMMENT)!='']">
       <td class="cell c4 lastcol"><xsl:call-template name="display-comment"/></td>
-    </xsl:if>    
+    </xsl:if>
   </tr>
 </xsl:template>
 
 <!-- Indexes -->
 <xsl:template match="INDEXES[INDEX]">
   <h4>Indexes</h4>
-  <table class="generaltable boxaligncenter" cellspacing="1" cellpadding="5" width="100%"> 
+  <table class="generaltable boxaligncenter" cellspacing="1" cellpadding="5" width="100%">
     <tr>
       <th class="header c0" scope="col">Name</th>
       <th class="header c1" scope="col">Type</th>
     <td class="cell c2"><xsl:value-of select="@FIELDS"/></td>
     <xsl:if test="../*[normalize-space(@COMMENT)!='']">
       <td class="cell c4 lastcol"><xsl:call-template name="display-comment"/></td>
-    </xsl:if>    
+    </xsl:if>
   </tr>
 </xsl:template>
 
         <xsl:value-of select="@COMMENT"/>
       </xsl:otherwise>
     </xsl:choose>
-  </xsl:if> 
+  </xsl:if>
 </xsl:template>
 
 </xsl:stylesheet>