]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Use custom conversions for compliance.xml for Forrest web site creation.
authorWilliam Victor Mote <vmote@apache.org>
Tue, 18 Mar 2003 09:15:36 +0000 (09:15 +0000)
committerWilliam Victor Mote <vmote@apache.org>
Tue, 18 Mar 2003 09:15:36 +0000 (09:15 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@196116 13f79535-47bb-0310-9956-ffa450edef68

src/documentation/resources/stylesheets/compliance2fo.xsl [new file with mode: 0644]
src/documentation/resources/stylesheets/compliance2html.xsl [new file with mode: 0644]
src/documentation/sitemap.xmap

diff --git a/src/documentation/resources/stylesheets/compliance2fo.xsl b/src/documentation/resources/stylesheets/compliance2fo.xsl
new file mode 100644 (file)
index 0000000..74d4d82
--- /dev/null
@@ -0,0 +1,276 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- $Id$ -->
+
+<xsl:stylesheet
+    version="1.0"
+    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+    xmlns:fo="http://www.w3.org/1999/XSL/Format">
+
+<xsl:preserve-space elements="*"/>
+
+<xsl:template match="/compliance">
+       <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
+
+<!--
+
+               <fo:layout-master-set>
+                       <fo:simple-page-master master-name="simple"
+                                                                               page-height="29.7cm"
+                                                                               page-width="21cm"
+                                                                               margin-top="1.5cm"
+                                                                               margin-bottom="1.5cm"
+                                                                               margin-left="2.5cm"
+                                                                               margin-right="2.5cm">
+                               <fo:region-body margin-top="1.5cm"/>
+                               <fo:region-before extent="1.5cm"/>
+                               <fo:region-after extent="1.5cm"/>
+                       </fo:simple-page-master>
+               </fo:layout-master-set>
+               <fo:page-sequence master-reference="simple"
+                           font-family="serif"
+                           font-size="11pt">
+                       <fo:static-content flow-name="xsl-region-before">
+                               <fo:block text-align="end"
+                                                       font-size="10pt"
+                                                       font-family="serif"
+                                                       line-height="14pt" >
+                                       XSL-FO Compliance - p. <fo:page-number/>
+                               </fo:block>
+                       </fo:static-content>
+                       <fo:flow flow-name="xsl-region-body">
+        <xsl:apply-templates select="head"/>
+        <xsl:apply-templates select="body"/>
+                       </fo:flow>
+               </fo:page-sequence>
+-->
+       </fo:root>
+</xsl:template>
+<!--
+
+<xsl:template match="head">
+  <fo:block
+      font-size="18pt"
+      text-align="center">
+    <xsl:value-of select="/compliance/head/title"/>
+  </fo:block>
+</xsl:template>
+
+<xsl:template match="body">
+  <xsl:apply-templates select="standard"/>
+</xsl:template>
+
+<xsl:template match="standard">
+  <fo:block
+      font-size="16pt"
+      text-align="left">
+    <xsl:value-of select="@name"/>
+  </fo:block>
+  <xsl:apply-templates select="explanatory"/>
+  <xsl:apply-templates select="level-1"/>
+</xsl:template>
+
+<xsl:template match="level-1">
+  <fo:block
+      font-size="16pt"
+      text-align="left">
+    <xsl:value-of select="@name"/>
+  </fo:block>
+  <xsl:apply-templates select="explanatory"/>
+  <fo:table width="16mm">
+    <fo:table-header>
+      <fo:table-row>
+        <fo:table-cell number-rows-spanned="2">
+          <xsl:value-of select="@compliance-item-desc"/>
+        </fo:table-cell>
+        <fo:table-cell number-cols-spanned="3">
+          Support
+        </fo:table-cell>
+        <fo:table-cell number-rows-spanned="2">
+          Comments
+        </fo:table-cell>
+      </fo:table-row>
+      <fo:table-row>
+        <fo:table-cell>
+          <xsl:value-of select="/compliance/body/standard/@compliance-level-1-desc"/>
+        </fo:table-cell>
+        <fo:table-cell>
+          <xsl:value-of select="/compliance/body/standard/@compliance-level-2-desc"/>
+        </fo:table-cell>
+        <fo:table-cell>
+          <xsl:value-of select="/compliance/body/standard/@compliance-level-3-desc"/>
+        </fo:table-cell>
+      </fo:table-row>
+    </fo:table-header>
+    <xsl:apply-templates select="level-2"/>
+  </fo:table>
+</xsl:template>
+
+<xsl:template match="explanatory">
+  <xsl:for-each select="p">
+    <fo:block>
+      <xsl:apply-templates/>
+    </fo:block>
+  </xsl:for-each>
+</xsl:template>
+
+<xsl:template match="level-2">
+  <fo:table-row>
+    <fo:table-cell number-cols-spanned="5">
+      <xsl:value-of select="@name"/>
+    </fo:table-cell>
+  </fo:table-row>
+  <xsl:apply-templates select="level-3"/>
+</xsl:template>
+
+<xsl:template match="level-3">
+  <fo:table-row>
+    <fo:table-cell>
+      <xsl:value-of select="@name"/>
+    </fo:table-cell>
+    <fo:table-cell>
+      <xsl:attribute name="class">
+        <xsl:choose>
+          <xsl:when test="@comply='yes'">
+            <xsl:text>yes</xsl:text>
+          </xsl:when>
+          <xsl:when test="@comply='no'">
+            <xsl:choose>
+              <xsl:when test="@compliance-level > 1">
+                <xsl:text>yes</xsl:text>
+              </xsl:when>
+              <xsl:otherwise>
+                <xsl:text>no</xsl:text>
+              </xsl:otherwise>
+            </xsl:choose>
+          </xsl:when>
+          <xsl:when test="@comply='partial'">
+            <xsl:choose>
+              <xsl:when test="@compliance-level > 1">
+                <xsl:text>yes</xsl:text>
+              </xsl:when>
+              <xsl:otherwise>
+                <xsl:text>partial</xsl:text>
+              </xsl:otherwise>
+            </xsl:choose>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:text></xsl:text>
+          </xsl:otherwise>
+        </xsl:choose>
+      </xsl:attribute>
+      <xsl:choose>
+        <xsl:when test="@compliance-level=1">
+          <xsl:value-of select="@comply"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:text>.</xsl:text>
+        </xsl:otherwise>
+      </xsl:choose>
+    </fo:table-cell>
+    <fo:table-cell>
+      <xsl:attribute name="class">
+        <xsl:choose>
+          <xsl:when test="@comply='yes'">
+            <xsl:text>yes</xsl:text>
+          </xsl:when>
+          <xsl:when test="@comply='no'">
+            <xsl:choose>
+              <xsl:when test="@compliance-level > 2">
+                <xsl:text>yes</xsl:text>
+              </xsl:when>
+              <xsl:otherwise>
+                <xsl:text>no</xsl:text>
+              </xsl:otherwise>
+            </xsl:choose>
+          </xsl:when>
+          <xsl:when test="@comply='partial'">
+            <xsl:choose>
+              <xsl:when test="@compliance-level > 2">
+                <xsl:text>yes</xsl:text>
+              </xsl:when>
+              <xsl:otherwise>
+                <xsl:text>partial</xsl:text>
+              </xsl:otherwise>
+            </xsl:choose>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:text></xsl:text>
+          </xsl:otherwise>
+        </xsl:choose>
+      </xsl:attribute>
+      <xsl:choose>
+        <xsl:when test="@compliance-level=2">
+          <xsl:value-of select="@comply"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:text>.</xsl:text>
+        </xsl:otherwise>
+      </xsl:choose>
+    </fo:table-cell>
+    <fo:table-cell>
+      <xsl:attribute name="class">
+        <xsl:choose>
+          <xsl:when test="@comply='yes'">
+            <xsl:text>yes</xsl:text>
+          </xsl:when>
+          <xsl:when test="@comply='no'">
+            <xsl:choose>
+              <xsl:when test="@compliance-level > 3">
+                <xsl:text>yes</xsl:text>
+              </xsl:when>
+              <xsl:otherwise>
+                <xsl:text>no</xsl:text>
+              </xsl:otherwise>
+            </xsl:choose>
+          </xsl:when>
+          <xsl:when test="@comply='partial'">
+            <xsl:choose>
+              <xsl:when test="@compliance-level > 3">
+                <xsl:text>yes</xsl:text>
+              </xsl:when>
+              <xsl:otherwise>
+                <xsl:text>partial</xsl:text>
+              </xsl:otherwise>
+            </xsl:choose>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:text></xsl:text>
+          </xsl:otherwise>
+        </xsl:choose>
+      </xsl:attribute>
+      <xsl:choose>
+        <xsl:when test="@compliance-level=3">
+          <xsl:value-of select="@comply"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:text>.</xsl:text>
+        </xsl:otherwise>
+      </xsl:choose>
+    </fo:table-cell>
+    <xsl:choose>
+      <xsl:when test="count(comment) > 0">
+        <fo:table-cell align="left">
+          <fo:list>
+            <xsl:for-each select="comment">
+              <fo:list-item>
+                <xsl:value-of select="."/>
+             </fo:list-item>
+           </xsl:for-each>
+          </fo:list>
+        </fo:table-cell>
+      </xsl:when>
+      <xsl:otherwise>
+        <fo:table-cell align="center">
+          <xsl:text>.</xsl:text>
+        </fo:table-cell>
+      </xsl:otherwise>
+    </xsl:choose>
+  </fo:table-row>
+</xsl:template>
+
+-->
+
+</xsl:stylesheet>
+
+<!-- Last Line of $RCSfile$ -->
\ No newline at end of file
diff --git a/src/documentation/resources/stylesheets/compliance2html.xsl b/src/documentation/resources/stylesheets/compliance2html.xsl
new file mode 100644 (file)
index 0000000..23035e4
--- /dev/null
@@ -0,0 +1,245 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- $Id$ -->
+
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+<xsl:preserve-space elements="*"/>
+
+<xsl:template match="/compliance">
+<!-- Forrest/Cocoon will place the output from this stylesheet inside of a
+     larger html document. The output here is all within one <div> tag. -->
+  <div class="content">
+  <xsl:apply-templates select="head"/>
+  <xsl:apply-templates select="body"/>
+  </div>
+</xsl:template>
+
+<xsl:template match="head">
+      <head>
+      <meta http-equiv="Content-Language" content="en-us"/>
+      <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"/>
+      <link type="text/css" href="skin/page.css" rel="stylesheet"/>
+      <style>
+      &lt;!--
+      .yes         { background-color: #99CCFF }
+      .no          { background-color: #FF99CC }
+      .partial     { background-color: #C0C0C0 }
+      .category    { background-color: #FFCC66;
+                     font-size: 1.2em }
+      --&gt;
+      </style>
+      </head>
+</xsl:template>
+
+<xsl:template match="body">
+  <body>
+  <h1>
+  <xsl:value-of select="/compliance/head/title"/>
+  </h1>
+  <xsl:apply-templates select="standard"/>
+  </body>
+</xsl:template>
+
+<xsl:template match="standard">
+  <h2><xsl:value-of select="@name"/></h2>
+  <xsl:apply-templates select="explanatory"/>
+  <xsl:apply-templates select="level-1"/>
+</xsl:template>
+
+<xsl:template match="level-1">
+  <h3><xsl:value-of select="@name"/></h3>
+  <xsl:apply-templates select="explanatory"/>
+  <table border="1">
+  <tr>
+    <th rowspan="2">
+      <p><xsl:value-of select="@compliance-item-desc"/></p>
+    </th>
+    <th align="center" colspan="3">
+      Support
+    </th>
+    <th rowspan="2">
+      Comments
+    </th>
+  </tr>
+  <tr>
+    <th align="center">
+      <xsl:value-of select="/compliance/body/standard/@compliance-level-1-desc"/>
+    </th>
+    <th align="center">
+      <xsl:value-of select="/compliance/body/standard/@compliance-level-2-desc"/>
+    </th>
+    <th align="center">
+      <xsl:value-of select="/compliance/body/standard/@compliance-level-3-desc"/>
+    </th>
+  </tr>
+  <xsl:apply-templates select="level-2"/>
+  </table>
+</xsl:template>
+
+<xsl:template match="explanatory">
+  <xsl:for-each select="p">
+    <p>
+      <xsl:apply-templates/>
+    </p>
+  </xsl:for-each>
+</xsl:template>
+
+<xsl:template match="level-2">
+  <tr>
+    <td colspan="5" class="category">
+    <xsl:value-of select="@name"/>
+    </td>
+  </tr>
+  <xsl:apply-templates select="level-3"/>
+</xsl:template>
+
+<xsl:template match="level-3">
+  <tr>
+    <td>
+      <xsl:value-of select="@name"/>
+    </td>
+    <td align="center">
+      <xsl:attribute name="class">
+        <xsl:choose>
+          <xsl:when test="@comply='yes'">
+            <xsl:text>yes</xsl:text>
+          </xsl:when>
+          <xsl:when test="@comply='no'">
+            <xsl:choose>
+              <xsl:when test="@compliance-level > 1">
+                <xsl:text>yes</xsl:text>
+              </xsl:when>
+              <xsl:otherwise>
+                <xsl:text>no</xsl:text>
+              </xsl:otherwise>
+            </xsl:choose>
+          </xsl:when>
+          <xsl:when test="@comply='partial'">
+            <xsl:choose>
+              <xsl:when test="@compliance-level > 1">
+                <xsl:text>yes</xsl:text>
+              </xsl:when>
+              <xsl:otherwise>
+                <xsl:text>partial</xsl:text>
+              </xsl:otherwise>
+            </xsl:choose>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:text></xsl:text>
+          </xsl:otherwise>
+        </xsl:choose>
+      </xsl:attribute>
+      <xsl:choose>
+        <xsl:when test="@compliance-level=1">
+          <xsl:value-of select="@comply"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:text>.</xsl:text>
+        </xsl:otherwise>
+      </xsl:choose>
+    </td>
+    <td align="center">
+      <xsl:attribute name="class">
+        <xsl:choose>
+          <xsl:when test="@comply='yes'">
+            <xsl:text>yes</xsl:text>
+          </xsl:when>
+          <xsl:when test="@comply='no'">
+            <xsl:choose>
+              <xsl:when test="@compliance-level > 2">
+                <xsl:text>yes</xsl:text>
+              </xsl:when>
+              <xsl:otherwise>
+                <xsl:text>no</xsl:text>
+              </xsl:otherwise>
+            </xsl:choose>
+          </xsl:when>
+          <xsl:when test="@comply='partial'">
+            <xsl:choose>
+              <xsl:when test="@compliance-level > 2">
+                <xsl:text>yes</xsl:text>
+              </xsl:when>
+              <xsl:otherwise>
+                <xsl:text>partial</xsl:text>
+              </xsl:otherwise>
+            </xsl:choose>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:text></xsl:text>
+          </xsl:otherwise>
+        </xsl:choose>
+      </xsl:attribute>
+      <xsl:choose>
+        <xsl:when test="@compliance-level=2">
+          <xsl:value-of select="@comply"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:text>.</xsl:text>
+        </xsl:otherwise>
+      </xsl:choose>
+    </td>
+    <td align="center">
+      <xsl:attribute name="class">
+        <xsl:choose>
+          <xsl:when test="@comply='yes'">
+            <xsl:text>yes</xsl:text>
+          </xsl:when>
+          <xsl:when test="@comply='no'">
+            <xsl:choose>
+              <xsl:when test="@compliance-level > 3">
+                <xsl:text>yes</xsl:text>
+              </xsl:when>
+              <xsl:otherwise>
+                <xsl:text>no</xsl:text>
+              </xsl:otherwise>
+            </xsl:choose>
+          </xsl:when>
+          <xsl:when test="@comply='partial'">
+            <xsl:choose>
+              <xsl:when test="@compliance-level > 3">
+                <xsl:text>yes</xsl:text>
+              </xsl:when>
+              <xsl:otherwise>
+                <xsl:text>partial</xsl:text>
+              </xsl:otherwise>
+            </xsl:choose>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:text></xsl:text>
+          </xsl:otherwise>
+        </xsl:choose>
+      </xsl:attribute>
+      <xsl:choose>
+        <xsl:when test="@compliance-level=3">
+          <xsl:value-of select="@comply"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:text>.</xsl:text>
+        </xsl:otherwise>
+      </xsl:choose>
+    </td>
+    <xsl:choose>
+      <xsl:when test="count(comment) > 0">
+        <td align="left">
+          <ul>
+            <xsl:for-each select="comment">
+              <li>
+                <xsl:value-of select="."/>
+             </li>
+           </xsl:for-each>
+          </ul>
+        </td>
+      </xsl:when>
+      <xsl:otherwise>
+        <td align="center">
+          <xsl:text>.</xsl:text>
+        </td>
+      </xsl:otherwise>
+    </xsl:choose>
+  </tr>
+</xsl:template>
+
+</xsl:stylesheet>
+
+<!-- Last Line of $RCSFile -->
\ No newline at end of file
index 41ef1e60f7e3ddef41209761fa26f7460892b857..a468d5a96cccb186c43fe2fc69385237d4321c38 100644 (file)
 
         <!-- ========================== FOP Additions ========================== -->
 
-   <map:match pattern="body-compliance.xml">
-     <map:generate type="file-nolabel" src="content/xdocs/compliance.xml"/>
-     <map:transform src="resources/stylesheets/compliance2document.xsl" label="content"/>
-     <map:call resource="skinit">
-      <map:parameter name="type" value="document2html"/>
-      <map:parameter name="path" value="compliance"/>
-     </map:call>
-   </map:match>
+         <map:match pattern="body-compliance.xml">
+           <map:generate type="file-nolabel" src="content/xdocs/compliance.xml"/>
+           <map:transform src="resources/stylesheets/compliance2html.xsl"/>
+           <map:serialize type="xml"/>
+         </map:match>
 
 <!-- ======================== End FOP Additions ======================== -->
 
 
    <map:match pattern="compliance.pdf">
     <map:generate type="file-nolabel" src="content/xdocs/compliance.xml"/>
-    <map:transform src="resources/stylesheets/compliance2document.xsl" label="content"/>
-    <map:transform src="skins/forrest-site/xslt/fo/document2fo.xsl"/>
+    <map:transform src="resources/stylesheets/compliance2fo.xsl"/>
     <map:serialize type="fo2pdf"/>
    </map:match>