Переглянути джерело

Some fixes needed to can have valid XHTML 1.0 Strict output.

git-svn-id: http://svn.linuxfromscratch.org/LFS/branches/new-xsl@8101 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689
Manuel Canales Esparcia 18 роки тому
батько
коміт
83066785cb
3 змінених файлів з 113 додано та 12 видалено
  1. 30 7
      lfs-nochunks.xsl
  2. 28 5
      lfs.css
  3. 55 0
      xhtml/lfs-mixed.xsl

+ 30 - 7
lfs-nochunks.xsl

@@ -95,8 +95,8 @@
   </xsl:template>
 
     <!-- The CSS Stylesheet:
-           Note: there is a few diferences with lfs.css code releated
-                 to h* values. -->
+           Note: there is some diferences with lfs.css code releated
+                 to h* values, admonitions and no navigational code. -->
     <!-- The original template is in {docbook-xsl}/xhtml/docbook.xsl -->
   <xsl:template name='user.head.content'>
     <style type="text/css">
@@ -488,28 +488,51 @@ ul {
   margin-top: -.6em;
 }
 
-ul[compact="compact"] {
+ul.compact {
   list-style: none;
 }
 
-.blfs ul[compact="compact"] {
+.blfs ul.compact {
   list-style: disc;
 }
 
-ul[compact="compact"] li {
+ul.compact li {
   margin: 0em;
   padding: 0em;
 }
 
-ul[compact="compact"] li p {
+ul.compact li p {
   padding: 0.3em;
   margin: 0em;
 }
 
-.blfs ul[compact="compact"] li p {
+.blfs ul.compact li p {
   background-color: #f0fff0;
 }
 
+/* orderedlist */
+ol {
+  list-style: decimal;
+}
+
+ol ol {
+  list-style: lower-alpha;
+}
+
+ol ol ol {
+  list-style: lower-roman;
+}
+
+ol.compact li {
+  margin: 0em;
+  padding: 0em;
+}
+
+ol.compact li p {
+  padding: 0.3em;
+  margin: 0em;
+}
+
 
 /* Indented blocks */
 p, blockquote {

+ 28 - 5
lfs.css

@@ -452,28 +452,51 @@ ul {
   margin-top: -.6em;
 }
 
-ul[compact="compact"] {
+ul.compact {
   list-style: none;
 }
 
-.blfs ul[compact="compact"] {
+.blfs ul.compact {
   list-style: disc;
 }
 
-ul[compact="compact"] li {
+ul.compact li {
   margin: 0em;
   padding: 0em;
 }
 
-ul[compact="compact"] li p {
+ul.compact li p {
   padding: 0.3em;
   margin: 0em;
 }
 
-.blfs ul[compact="compact"] li p {
+.blfs ul.compact li p {
   background-color: #f0fff0;
 }
 
+/* orderedlist */
+ol {
+  list-style: decimal;
+}
+
+ol ol {
+  list-style: lower-alpha;
+}
+
+ol ol ol {
+  list-style: lower-roman;
+}
+
+ol.compact li {
+  margin: 0em;
+  padding: 0em;
+}
+
+ol.compact li p {
+  padding: 0.3em;
+  margin: 0em;
+}
+
 
 /* Indented blocks */
 p, blockquote {

+ 55 - 0
xhtml/lfs-mixed.xsl

@@ -80,6 +80,61 @@
     </xsl:choose>
   </xsl:template>
 
+    <!-- itemizadlist:
+           @compact is not allowed in XHTML 1.0 Strict DTD. Changing it
+           to @class. -->
+    <!-- The original template is in {docbook-xsl}/xhtml/lists.xsl -->
+  <xsl:template match="itemizedlist">
+    <div>
+      <xsl:apply-templates select="." mode="class.attribute"/>
+      <xsl:call-template name="anchor"/>
+      <xsl:if test="title">
+        <xsl:call-template name="formal.object.heading"/>
+      </xsl:if>
+      <xsl:apply-templates select="*[not(self::listitem or self::title
+                              or self::titleabbrev)]
+                              |comment()[not(preceding-sibling::listitem)]
+                              |processing-instruction()[not(preceding-sibling::listitem)]"/>
+      <ul>
+        <xsl:if test="@spacing='compact'">
+          <xsl:attribute name="class">
+            <xsl:value-of select="@spacing"/>
+          </xsl:attribute>
+        </xsl:if>
+        <xsl:apply-templates select="listitem |comment()[preceding-sibling::listitem]
+                                |processing-instruction()[preceding-sibling::listitem]"/>
+      </ul>
+    </div>
+  </xsl:template>
+
+    <!-- orderedlist:
+           @start, @type, and @compact sre not allowed in XHTML 1.0 Strict DTD.
+           @start and @type can be replaced by CSS code.
+           Changing @compact to @class. -->
+    <!-- The original template is in {docbook-xsl}/xhtml/lists.xsl -->
+  <xsl:template match="orderedlist">
+    <div>
+      <xsl:apply-templates select="." mode="class.attribute"/>
+      <xsl:call-template name="anchor"/>
+      <xsl:if test="title">
+        <xsl:call-template name="formal.object.heading"/>
+      </xsl:if>
+      <xsl:apply-templates select="*[not(self::listitem or self::title
+                              or self::titleabbrev)]
+                              |comment()[not(preceding-sibling::listitem)]
+                              |processing-instruction()[not(preceding-sibling::listitem)]"/>
+       <ol>
+        <xsl:if test="@spacing='compact'">
+          <xsl:attribute name="class">
+            <xsl:value-of select="@spacing"/>
+          </xsl:attribute>
+        </xsl:if>
+        <xsl:apply-templates select="listitem |comment()[preceding-sibling::listitem]
+                                |processing-instruction()[preceding-sibling::listitem]"/>
+      </ol>
+    </div>
+  </xsl:template>
+
     <!-- seg in segementedlist:
            Added a span around seg text to can match it with CSS code. -->
     <!-- The original template is in {docbook-xsl}/xhtml/lists.xsl -->