httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sl...@apache.org
Subject cvs commit: httpd-2.0/docs/manual/style/xsl common.xsl
Date Tue, 10 Jun 2003 20:17:51 GMT
slive       2003/06/10 13:17:51

  Modified:    docs/manual/style common.dtd
               docs/manual/style/latex TODO html.xsl
               docs/manual/style/xsl common.xsl
  Log:
  Transform <columnspec><column width=".2">... hints to help latex
  size tables properly.  Also change the html tranforms to ignore this
  and add the elements to the dtd.
  
  Revision  Changes    Path
  1.17      +6 -1      httpd-2.0/docs/manual/style/common.dtd
  
  Index: common.dtd
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/docs/manual/style/common.dtd,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -d -b -u -r1.16 -r1.17
  --- common.dtd	12 Apr 2003 15:03:02 -0000	1.16
  +++ common.dtd	10 Jun 2003 20:17:51 -0000	1.17
  @@ -96,7 +96,7 @@
   <!ELEMENT note (#PCDATA | title | %inlinetags; | %blocktags;)*>
   <!ATTLIST note type CDATA #IMPLIED>
   
  -<!ELEMENT table (tr)+>
  +<!ELEMENT table (columnspec | tr)+>
   <!ATTLIST table summary     CDATA  #IMPLIED
                   width       CDATA  #IMPLIED
                   bgcolor     CDATA  #IMPLIED
  @@ -104,6 +104,11 @@
                   cellpadding CDATA  #IMPLIED
                   border      CDATA  #IMPLIED
                   style       CDATA  #IMPLIED>
  +
  +<!ELEMENT columnspec (column)+>
  +
  +<!ELEMENT column EMPTY>
  +<!ATTLIST column width CDATA #IMPLIED>
   
   <!ELEMENT tr (th | td)+>
   <!ATTLIST tr valign CDATA #IMPLIED >
  
  
  
  1.4       +0 -29     httpd-2.0/docs/manual/style/latex/TODO
  
  Index: TODO
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/docs/manual/style/latex/TODO,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -d -b -u -r1.3 -r1.4
  --- TODO	5 Jun 2003 16:09:57 -0000	1.3
  +++ TODO	10 Jun 2003 20:17:51 -0000	1.4
  @@ -9,35 +9,6 @@
      since you can just take the existing LaTeX as an example, and combine
      it with the xslt stuff under style/xsl/.]
   
  -- Fix tables
  -
  -  Perhaps we need to add some xml hints about the size of different
  -  columns in the source files.
  -
  -  Here is a proposal:
  -
  -  xml:
  -  <table>
  -  <columnspec><column width=".2"/><column width=".2"/><column width=".6"/>
  -  </columnspec>
  -  <tr><td>1</td><td>2</td><td>3</td></tr>
  -  </table>
  -
  -  latex:
  -  \begin{tabular}{lll} % number of "l"s matches the number of <column>s.
  -  \begin{minipage}{.2\linewidth}
  -  1
  -  \end{minipage} &
  -  \begin{minipage}{.2\linewidth}
  -  2
  -  \end{minipage} &
  -  \begin{minipage}{.6\linewidth}
  -  3
  -  \end{minipage} \\ % And continue in the same way if there are more rows
  -  \end{tabular}
  -
  -  This should be enough to get an xsl expert started.
  -
   - Images
   
     A quick search makes me believe that pdftex will not handle gifs.
  
  
  
  1.3       +23 -12    httpd-2.0/docs/manual/style/latex/html.xsl
  
  Index: html.xsl
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/docs/manual/style/latex/html.xsl,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -d -b -u -r1.2 -r1.3
  --- html.xsl	5 Jun 2003 15:16:27 -0000	1.2
  +++ html.xsl	10 Jun 2003 20:17:51 -0000	1.3
  @@ -116,23 +116,34 @@
   </xsl:template>
   
   <xsl:template match="table">
  -<xsl:text>\begin{tabular}{ll}</xsl:text>
  -<xsl:for-each select="tr">
  -  <xsl:for-each select="td">
  -    <xsl:text>\begin{minipage}{.5\linewidth}</xsl:text>
  -    <xsl:apply-templates/>
  -    <xsl:text>\end{minipage}</xsl:text>
  -    <xsl:if test="not(last())">
  -      <xsl:text> &amp; </xsl:text>
  -    </xsl:if>
  -  </xsl:for-each>
  -  <xsl:text>\\
  -</xsl:text>
  +<xsl:text>\begin{tabular}{</xsl:text>
  +<xsl:for-each select="columnspec/column">
  +  <xsl:text>l</xsl:text>
   </xsl:for-each>
  +<xsl:text>}</xsl:text>
  +<xsl:apply-templates select="tr"/>
   <xsl:text>\end{tabular}
   </xsl:text>
   </xsl:template>
   
  +
  +<xsl:template match="tr">
  +  <xsl:apply-templates select="td"/>
  +  <xsl:text>\\
  +</xsl:text>
  +</xsl:template>
  +
  +<xsl:template match="td">
  +    <xsl:variable name="pos" select="position()"/>
  +    <xsl:text>\begin{minipage}{</xsl:text>
  +    <xsl:value-of select="../../columnspec/column[$pos]/@width"/>
  +    <xsl:text>\linewidth}</xsl:text>
  +    <xsl:apply-templates/>
  +    <xsl:text>\end{minipage}</xsl:text>
  +    <xsl:if test="not(position()=last())">
  +      <xsl:text> &amp; </xsl:text>
  +    </xsl:if>
  +</xsl:template>
   
   <!--
      This is a horrible hack, but it seems to mostly work.  It does a
  
  
  
  1.37      +10 -0     httpd-2.0/docs/manual/style/xsl/common.xsl
  
  Index: common.xsl
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/docs/manual/style/xsl/common.xsl,v
  retrieving revision 1.36
  retrieving revision 1.37
  diff -u -d -b -u -r1.36 -r1.37
  --- common.xsl	4 Jun 2003 09:57:18 -0000	1.36
  +++ common.xsl	10 Jun 2003 20:17:51 -0000	1.37
  @@ -1036,4 +1036,14 @@
   </xsl:template>
   <!-- /helper.uri.fix -->
   
  +
  +<!-- ==================================================================== -->
  +<!-- Ignore table hints used for latex                                    -->
  +<!-- ==================================================================== -->
  +<xsl:template match="columnspec">
  +</xsl:template>
  +
  +<xsl:template match="column">
  +</xsl:template>
  +
   </xsl:stylesheet>
  
  
  

Mime
View raw message