dleslie     00/04/21 07:17:57

  Added:       xdocs/style/stylesheets designdoc2html.xsl
                        design2project.xsl
  Log:
  Preliminary design documentation for Xalan-J 1.1.0
  
  Revision  Changes    Path
  1.1                  xml-xalan/xdocs/style/stylesheets/designdoc2html.xsl
  
  Index: designdoc2html.xsl
  ===================================================================
  <?xml version="1.0"?>
  
  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
version="1.0">
  
    <xsl:param name="stylebook.project"/>
    <xsl:param name="copyright"/>
    <xsl:param name="id"/>
  
    <xsl:template match="/">
      <xsl:apply-templates/>
    </xsl:template>
  
    <xsl:template match="s1">
      <html>
        <head>
          <title><xsl:value-of select="@title"/></title>
        </head>
        <body text="#000000" link="#0000ff" vlink="#0000aa" alink="#ff0000"
              topmargin="4" leftmargin="4" marginwidth="4" marginheight="4"
              bgcolor="#ffffff">
           <xsl:variable name="topimage" select="string(./p/img/@src)"/>
           <h1><a href="http://xml.apache.org";><img 
src="images/{$topimage}"/></a>&#160;&#160;
           <xsl:value-of select="@title"/></h1><hr/>
               <xsl:apply-templates/>
           <hr/>
              <font size="-1" color="#0086b2"><i>
                Copyright &#169; <xsl:value-of select="$copyright"/>
              </i></font>
        </body>
      </html>
    </xsl:template>
  
    <xsl:template match="s2">
        
        <h2><xsl:value-of select="@title"/></h2>
        <xsl:apply-templates/>
    </xsl:template>
  
    <xsl:template match="s3">
        <h3><xsl:value-of select="@title"/></h3>
        <xsl:apply-templates/>
    </xsl:template>
  
    <xsl:template match="s4">
        <h4><xsl:value-of select="@title"/></h4>
        <xsl:apply-templates/>
    </xsl:template>
  
  <!-- ###################################################################### 
-->
  <!-- blocks -->
  
    <xsl:template match="p">
      <p><xsl:apply-templates/></p>
    </xsl:template>
  
    <xsl:template match="note">
      <table width="100%" cellspacing="3" cellpadding="0" border="0">
        <tr>
          <td width="20" valign="top">
            <img src="resources/note.gif" width="20" height="24" vspace="0" 
hspace="0" border="0" alt="Note"/>
          </td>
          <td valign="top">
            <font size="-1" face="arial,helvetica,sanserif" color="#000000">
              <i>
                <xsl:apply-templates/>
              </i>
            </font>
          </td>
        </tr>  
      </table>
    </xsl:template>
  
    <xsl:template match="ul">
      <ul><xsl:apply-templates/></ul>
    </xsl:template>
  
    <xsl:template match="ol">
      <ol><xsl:apply-templates/></ol>
    </xsl:template>
  
    <xsl:template match="li">
      <li><xsl:apply-templates/></li>
    </xsl:template>
    
      <!--Definition lists: gloss, term, label, item -->
    <xsl:template match="gloss">
      <dl><xsl:apply-templates/></dl>
    </xsl:template>
     <!-- <term> contains a single-word, multi-word or symbolic 
         designation which is regarded as a technical term. --> 
    <xsl:template match="term">
      <dfn><xsl:apply-templates/></dfn>
    </xsl:template>
    <xsl:template match="label" priority="1">
      <dt><xsl:apply-templates/></dt>
    </xsl:template>
    <xsl:template match="item" priority="2">
      <dd>
        <xsl:apply-templates/>
      </dd>
    </xsl:template>
  
    <xsl:template match="source">
      <p><font size="-1"><pre><xsl:apply-templates/></pre></font></p>
    </xsl:template>
  
    <xsl:template match="table">
      <table width="100%" border="0" cellspacing="2" cellpadding="2">
        <xsl:apply-templates/>
      </table>
    </xsl:template>
  
    <xsl:template match="tr">
      <tr><xsl:apply-templates/></tr>
    </xsl:template>
  
    <xsl:template match="th">
      <td bgcolor="#039acc" colspan="[EMAIL PROTECTED]" rowspan="[EMAIL 
PROTECTED]" valign="center" align="center">
        <font color="#ffffff" size="-1" face="arial,helvetica,sanserif">
          <b><xsl:apply-templates/></b>&#160;
        </font>
      </td>
    </xsl:template>
  
    <xsl:template match="td">
      <td bgcolor="#a0ddf0" colspan="[EMAIL PROTECTED]" rowspan="[EMAIL 
PROTECTED]" valign="top" align="left">
        <font color="#000000" size="-1" face="arial,helvetica,sanserif">
          <xsl:apply-templates/>&#160;
        </font>
      </td>
    </xsl:template>
  
    <xsl:template match="tn">
      <td bgcolor="#ffffff" colspan="[EMAIL PROTECTED]" rowspan="[EMAIL 
PROTECTED]">
        &#160;
      </td>
    </xsl:template>
  
  <!-- ###################################################################### 
-->
  <!-- markup -->
  
    <xsl:template match="em">
      <b><xsl:apply-templates/></b>
    </xsl:template>
  
    <xsl:template match="ref">
      <i><xsl:apply-templates/></i>
    </xsl:template>
    
    <xsl:template match="code">
      <code><font face="courier, 
monospaced"><xsl:apply-templates/></font></code>
    </xsl:template>
    
    <xsl:template match="br">
      <br/>
    </xsl:template>
    
  <!-- ###################################################################### 
-->
  <!-- links -->
  
    <xsl:template match="link">
      <xsl:if test="string-length(@anchor)=0">
        <xsl:if test="string-length(@idref)=0">
          <!--xsl:apply-templates/-->
        </xsl:if>
        <xsl:if test="string-length(@idref)>0">
          <a href="[EMAIL PROTECTED]"><xsl:apply-templates/></a>
        </xsl:if>
      </xsl:if>
  
      <xsl:if test="string-length(@anchor)>0">
        <xsl:if test="string-length(@idref)=0">
          <a href="[EMAIL PROTECTED]"><xsl:apply-templates/></a>
        </xsl:if>
        <xsl:if test="string-length(@idref)>0">
          <a href="[EMAIL PROTECTED]@anchor}"><xsl:apply-templates/></a>
        </xsl:if>
      </xsl:if>
    </xsl:template>
  
    <xsl:template match="anchor">
      <a name="[EMAIL PROTECTED]"><xsl:comment>anchor</xsl:comment></a>
    </xsl:template>
  
    <xsl:template match="jump">
      <a href="[EMAIL PROTECTED]"><xsl:apply-templates/></a>
    </xsl:template>
  
    <xsl:template match="/s1/s2//img">
      <img src="images/[EMAIL PROTECTED]"/>
    </xsl:template>
  
    <xsl:template match="resource-ref">
      <xsl:variable name="resourceFile" 
            select="document($stylebook.project)/book/resources/@source"/>
      <xsl:variable name="xref" select="@idref"/>
      <xsl:variable name="href"
            select="document($resourceFile)/resources/[EMAIL 
PROTECTED]/@location"/>
      <xsl:variable name="label"
            select="document($resourceFile)/resources/[EMAIL 
PROTECTED]/@title"/>
      <A href="{$href}" target="_top"><xsl:value-of select="$label"/></A>
    </xsl:template>
  
    <xsl:template match="human-resource-ref">
      <xsl:variable name="resourceFile" 
            select="document($stylebook.project)/book/resources/@source"/>  
      <xsl:variable name="ref"  select="@idref"/>
      <xsl:variable name="mailto"
            select="document($resourceFile)/resources/[EMAIL 
PROTECTED]/@mailto"/>
     <xsl:variable name="name"
            select="document($resourceFile)/resources/[EMAIL 
PROTECTED]/@name"/>                          
      <A href="mailto:{$mailto}";><xsl:value-of select="$name"/></A>
    </xsl:template>
  
  <!-- ###################################################################### 
-->
  
  </xsl:stylesheet>
  
  
  1.1                  xml-xalan/xdocs/style/stylesheets/design2project.xsl
  
  Index: design2project.xsl
  ===================================================================
  <?xml version="1.0"?>
  
  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
version="1.0">
  
    <xsl:template match="/">
      <xsl:apply-templates/>
    </xsl:template>
  
    <!-- match the root book element -->
    <xsl:template match="book">
      <project>
        <parameter name="copyright" value="[EMAIL PROTECTED]"/>
        <xsl:apply-templates/>
      </project>
    </xsl:template>
  
   <xsl:template match="document">
  
      <process source="[EMAIL PROTECTED]" producer="parser">
        <processor name="xslt">
          <parameter name="stylesheet" 
value="sbk:/style/stylesheets/any2project.xsl"/>
        </processor>
      </process>
  
      <create source="[EMAIL PROTECTED]" target="[EMAIL PROTECTED]" 
producer="parser" printer="html">
        <processor name="xslt">
          <parameter name="id" value="[EMAIL PROTECTED]"/>
          <parameter name="stylesheet" 
value="sbk:/style/stylesheets/designdoc2html.xsl"/>
        </processor>
      </create>
    </xsl:template>
    
  </xsl:stylesheet>
  
  

Reply via email to