home *** CD-ROM | disk | FTP | other *** search
/ Internet Magazine 2003 October / INTERNET108.ISO / pc / software / windows / building / xmlspy / xmlspyentcomplete5.exe / Data1.cab / _B965DBFAE14D4D17823B07F740729D75 < prev    next >
Encoding:
Extensible Markup Language  |  2002-08-26  |  42.3 KB  |  1,032 lines

  1. <xsl:stylesheet version="1.0" exclude-result-prefixes="msxsl local doc" extension-element-prefixes="msxsl" xmlns:doc="urn:schemas-uspto-gov:document" xmlns:local="#local-functions" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  2.  
  3.  
  4.  
  5. <!--
  6. *********************************************************************
  7. *  John Dunning: 2001-01-26                                         *
  8. *  DTD Version:  1.2.8                                              *
  9. *    Distribution :  2000-10-16                                     *
  10. *    Stylesheet revision date:  2001-01-29                          *
  11. *                                                                   *
  12. *  this is the "driver" file for an XSL transformation;             *
  13. *  all specification-specific template rules are in this file;      *
  14. *  component files are "included" below                             *
  15. *********************************************************************
  16. -->
  17.  
  18.  
  19. <xsl:output method="html" indent="yes" omit-xml-declaration="yes"/>
  20.  
  21. <xsl:preserve-space elements="*"/>
  22.  
  23. <xsl:template match="*">
  24.     <xsl:apply-templates/> 
  25. </xsl:template>
  26.  
  27. <!-- **** strip [ ] off version attribute for display **** -->
  28.     <xsl:variable name="version" select="//spec.version/@version"/>
  29.     <xsl:variable name="ver" select="substring-after($version,'[')"/>
  30.     <xsl:variable name="ver2" select="substring-before($ver,']')"/>
  31.  
  32.  
  33. <xsl:template match="/">
  34.     <html>
  35.         <head>
  36.             <xsl:call-template name="css_styles"/>
  37.         </head>
  38.     <body>
  39.         <basefont face="Arial Unicode MS, Lucida Sans Unicode, Arial, Times New Roman" size="2">
  40.                 <xsl:apply-templates select="//spec.title-block"/>
  41.                 <xsl:apply-templates select="//specification-block"/>
  42.             </basefont>
  43.             </body>
  44.         </html>
  45. </xsl:template>
  46.  
  47.     <xsl:template match="specification-block">
  48.         <div style="margin-left: +35pt;">
  49.             <xsl:apply-templates/>
  50.         </div>
  51.     </xsl:template>
  52.     
  53.  
  54.     <xsl:template match="spec.title-block">
  55.         <h1 align="center">
  56.             <xsl:value-of select="spec.title/@text"/>
  57.         </h1>
  58.         <table width="100%" cellpadding="0" cellspacing="0" border="0">
  59.             <tr>
  60.                 <td class="table_data">
  61.                     <xsl:value-of select="$ver2"/>
  62.                 </td>
  63.                 <td/>
  64.             </tr>
  65.             <tr>
  66.                 <td class="table_data">
  67.                     Stylesheet Version  1.0</td>
  68.                 <td/>
  69.             </tr>
  70.         </table>
  71.         <p/>
  72.     </xsl:template>
  73.  
  74.  
  75.     <xsl:template match="application-filing-date">
  76.             of <xsl:value-of select="."/>
  77.     </xsl:template>
  78.  
  79.     <xsl:template match="application-number">
  80.             application <xsl:value-of select="."/>
  81.     </xsl:template>
  82.  
  83.     <xsl:template match="application-reference">
  84.             <xsl:apply-templates/>
  85.     </xsl:template>
  86.     
  87.     <xsl:template match="continuity-statement">
  88.         <div class="left_para">
  89.         <table border="0" width="100%">
  90.             <tr>
  91.                 <td width="8%" valign="top">
  92.                 </td>
  93.                 <td width="85%">
  94.                     <span class="para_text">
  95.                         <xsl:apply-templates/>
  96.                     </span>
  97.                 </td>
  98.                 <td width="*"/>
  99.             </tr>
  100.         </table>
  101.         </div>
  102.      </xsl:template>
  103.  
  104.     <xsl:template match="copyright">
  105.         <div class="left_para">
  106.         <table border="0" width="100%">
  107.             <tr>
  108.                 <td width="8%" valign="top">
  109.                 </td>
  110.                 <td width="85%">
  111.                     <span class="para_text">
  112.                         <xsl:apply-templates/>
  113.                     </span>
  114.                 </td>
  115.                 <td width="*"/>
  116.             </tr>
  117.         </table>
  118.         </div>
  119.     </xsl:template>
  120.     
  121.     <xsl:template match="cross-reference">
  122.         <u><xsl:apply-templates/></u>
  123.     </xsl:template>
  124.     
  125.     <xsl:template match="paragraph">
  126.         <div class="left_para">
  127.         <table border="0" width="100%">
  128.             <tr>
  129.                 <td width="8%" valign="top">
  130.                     <span class="para_text">
  131.                         [<xsl:value-of select="local:FormatParagraphID(.)"/>]    
  132.                     </span>
  133.                 </td>
  134.                 <td width="85%">
  135.                     <span class="para_text">
  136.                         ┬á┬á┬á┬á┬á
  137.                         <xsl:apply-templates/>
  138.                     </span>
  139.                 </td>
  140.                 <td width="*"/>
  141.             </tr>
  142.         </table>
  143.         </div>
  144.         </xsl:template>
  145.  
  146.  
  147.      <xsl:template match="program-listing-deposit">    
  148.           <h3 style="margin-top: 3px;                     margin-bottom: 3px;">
  149.                   <xsl:value-of select="./heading"/>
  150.           </h3>
  151.         <div class="left_para">
  152.         <table border="0" width="100%">
  153.             <tr>
  154.                 <td width="8%" valign="top">
  155.                 ┬á
  156.                 </td>
  157.                 <td width="85%">
  158.                     <span class="para_text">
  159.                             <xsl:apply-templates select="./program-listing"/>
  160.                     </span>
  161.                 </td>
  162.                 <td width="*"/>
  163.             </tr>
  164.         </table>
  165.         </div>
  166.     </xsl:template>
  167.  
  168.     <xsl:template match="program-reference">
  169.         <div style="text-decoration:    underline;                     line-height: 200%">
  170.                 <xsl:value-of select="@text"/>
  171.                [<xsl:value-of select="@id"/>]
  172.                 <xsl:apply-templates/>
  173.         </div>
  174.     </xsl:template>
  175.  
  176.  
  177.     <xsl:template match="referenced-applications">
  178.         <div class="left_para">
  179.         <table border="0" width="100%">
  180.             <tr>
  181.                 <td width="8%" valign="top">
  182.                 </td>
  183.                 <td width="85%">
  184.                     <span class="para_text">
  185.                    <b>Referenced-applications</b><br/>
  186.                         <xsl:apply-templates/>
  187.                     </span>
  188.                 </td>
  189.                 <td width="*"/>
  190.             </tr>
  191.         </table>
  192.         </div>
  193.     </xsl:template>
  194.  
  195.     <xsl:template match="unknown-symbol">
  196.         <span style="background-color: red;                          font-size: 26pt;">
  197.                          Unknown Symbol<!-- the text to display-->
  198.         </span>
  199.     </xsl:template>
  200.  
  201.     
  202.     <msxsl:script implements-prefix="local">
  203.     
  204.  
  205.    function FormatParagraphID(nodeList)   {
  206.    try    {
  207.         var myNode = nodeList.item(0);
  208.         var paragraphID = (myNode.getAttribute("number"));
  209.            y =   myNode.getAttribute("number")
  210.            if (y == null)
  211.                return (" ")
  212.         else
  213.             for(var p = paragraphID.length; p < 4; p++)
  214.             {
  215.                 paragraphID = "0" + paragraphID;    
  216.             }    
  217.             return paragraphID;
  218.        }
  219.     catch(e) {
  220.         return "";
  221.         }
  222.     }
  223.     
  224.  
  225.     function formatLabel(nodeList) {
  226.     try {
  227.            var myNode = nodeList.item(0);
  228.         var label = myNode.getAttribute("label");
  229.         var labelClose = label.indexOf("]");        
  230.         var startLabel = label.substring(1,labelClose);
  231.         return startLabel;
  232.         }
  233.     catch(e) {
  234.         return "";
  235.         }
  236.     }
  237.  
  238.   </msxsl:script>
  239.  
  240.  
  241. <xsl:template match="abstract-of-disclosure | subdoc-abstract" doc:public="yes" doc:description="In specification, inserts the title-of-invention above the abstract.  If there is no heading above the abstract, a heading of "Abstract" is inserted.">
  242.         <div class="break_before_after">
  243.             <xsl:if test="//specification">
  244.                 <xsl:apply-templates mode="abstract_title" select="//title-of-invention"/>
  245.             </xsl:if>
  246.             <xsl:choose>
  247.                 <xsl:when test="not(heading)">
  248.                     <table width="90%" border="0">
  249.                     <tr><td width="9%" class="table_data">(57)</td>
  250.                         <td><h3>Abstract</h3></td>
  251.                     </tr>
  252.                     </table>
  253.                 </xsl:when>
  254.                 <xsl:otherwise>
  255.                     <xsl:apply-templates mode="abstract_heading" select="./heading"/>
  256.                 </xsl:otherwise>
  257.             </xsl:choose>
  258.             <xsl:apply-templates mode="abstract_para" select="./paragraph"/>
  259.         </div>
  260.         <xsl:apply-templates mode="drawing-section" select="//subdoc-drawings"/>
  261.     </xsl:template><xsl:template mode="abstract_title" match="title-of-invention" doc:public="yes" doc:description="modal template for printing title-of-invention before the abstract paragraph">
  262.           <h1 align="CENTER" class="title">
  263.             <xsl:apply-templates mode="abstract_heading"/>
  264.         </h1>
  265.     </xsl:template><xsl:template mode="abstract_heading" match="heading">
  266.         <h3 align="center">
  267.             <xsl:apply-templates mode="abstract_para"/>
  268.         </h3>
  269.     </xsl:template><xsl:template mode="abstract_para" match="paragraph">
  270.           <div class="left_para">
  271.             <table border="0" width="100%">
  272.                 <tr>
  273.                     <td width="8%" valign="top">
  274.                         <div class="para_text"/>
  275.                     </td>
  276.                     <td width="85%">
  277.                         <div class="para_text">
  278.                                <xsl:if test="//patent-application-publication">
  279.                                 <!-- [<xsl:value-of select="@id"/>] -->
  280.                             </xsl:if>
  281.                             ┬á┬á┬á                
  282.                             <xsl:apply-templates/>
  283.                         </div>
  284.                     </td>
  285.                     <td/>
  286.                     </tr>
  287.                 </table>
  288.         </div>
  289.     </xsl:template><xsl:template mode="drawing-section" match="*" doc:public="yes" doc:description="Used by patent-application-publication to print <image>s after the abstract and before the rest of the document.">
  290.         <xsl:apply-templates mode="linker" select="//subdoc-drawings"/>
  291.         <xsl:apply-templates/>
  292.     </xsl:template><xsl:template mode="linker" match="//subdoc-drawings" doc:public="yes" doc:description="creates a hyperlink anchor at the subdoc-drawings section.">
  293.         <a name="{@id}"/>
  294.     </xsl:template>
  295. <xsl:template match="address" doc:public="yes" doc:description="Creates a table to format child elements of address.">
  296.         <table width="60%" border="0">
  297.             <tr>
  298.                 <xsl:if test="./military-address">
  299.                     <td class="table_data"><xsl:value-of select="."/></td>
  300.                 </xsl:if>
  301.                 <td class="table_data"><xsl:value-of select="./address-1"/></td>
  302.             </tr>
  303.             <tr>
  304.                 <td class="table_data"><xsl:value-of select="./address-2"/></td>
  305.             </tr>
  306.             <tr>
  307.                 <td class="table_data"><xsl:value-of select="./city"/>,
  308.                     <xsl:text> </xsl:text>
  309.                     <xsl:value-of select="./state"/> 
  310.                     <xsl:text> </xsl:text>
  311.                     <xsl:value-of select="./postalcode"/>,
  312.                     <xsl:text> </xsl:text>
  313.                     <xsl:value-of select="./country/country-code"/>
  314.                 </td>
  315.             </tr>
  316.  
  317.             <xsl:for-each select="./email">
  318.             <tr>
  319.                 <td class="table_data"><xsl:value-of select="."/></td>
  320.             </tr>
  321.             </xsl:for-each>
  322.         
  323.             <xsl:for-each select="./telephone">
  324.                 <tr>
  325.                     <td class="table_data">  <xsl:value-of select="."/></td>
  326.                 </tr>
  327.             </xsl:for-each>
  328.     
  329.             <xsl:for-each select="./fax">
  330.                 <tr>
  331.                     <td class="table_data"><xsl:value-of select="."/></td>
  332.                 </tr>
  333.             </xsl:for-each>
  334.         </table>
  335.     </xsl:template>
  336. <xsl:template match="appendix-data">
  337.         <xsl:apply-templates/>
  338.     </xsl:template><xsl:template match="object-reference">
  339.         <div class="left_para">
  340.         <table border="0" width="90%">
  341.             <tr>
  342.                 <td width="8%" valign="top">┬á </td>
  343.                 <td width="85%">
  344.                     <span class="para_text">
  345.                         <xsl:apply-templates/>
  346.                     </span>
  347.                 </td>
  348.                 <td width="*"/>
  349.             </tr>
  350.         </table>
  351.         </div>
  352.     </xsl:template><xsl:template match="object-id | object-contents | object-description">
  353.             <xsl:text> </xsl:text>
  354.             <xsl:apply-templates/>
  355.     </xsl:template>
  356. <xsl:template match="biological-deposit">
  357.         <xsl:apply-templates/>
  358.     </xsl:template><xsl:template match="deposit-term | depository | deposit-accession-number | deposit-description">
  359.         <xsl:text> </xsl:text>
  360.         <xsl:apply-templates/>
  361.     </xsl:template><xsl:template match="deposit-date">
  362.         <xsl:param name="deposit-year" doc:public="yes" doc:description="assigns the year portion of the <deposit-date> element to a parameter to allow YYYY-MM-DD date formatting.">
  363.             <xsl:value-of select="substring(deposit-date,1,4)"/>
  364.         </xsl:param>
  365.         <xsl:param name="deposit-month" doc:public="yes" doc:description="assigns the month portion of the <deposit-date> element to a parameter to allow YYYY-MM-DD date formatting.">
  366.             <xsl:value-of select="substring(deposit-date,5,2)"/>
  367.         </xsl:param>
  368.         <xsl:param name="deposit-day" doc:public="yes" doc:description="assigns the date portion of the <deposit-date> element to a parameter to allow YYYY-MM-DD date formatting.">
  369.             <xsl:value-of select="substring(deposit-date,7,2)"/>
  370.         </xsl:param>
  371.         <xsl:value-of select="$deposit-year"/>-<xsl:value-of select="$deposit-month"/>-<xsl:value-of select="$deposit-day"/>
  372.     </xsl:template>
  373. <xsl:template match="table-cwu">
  374.         <div style="page-break-inside: avoid; "> 
  375.             [<xsl:value-of select="@id"/>]
  376.             <xsl:apply-templates select="table | Table"/>
  377.         </div>
  378.     </xsl:template><xsl:template match="table | Table">
  379.             <span class="table_head">
  380.                 <xsl:value-of select="./heading"/>
  381.             </span>
  382.  
  383.         <table width="100%" cellpadding="0" cellspacing="0" border="0">
  384.             <tr><td>
  385.                 <xsl:apply-templates select="tgroup | TGroup"/>
  386.             </td></tr>
  387.         </table>
  388.     </xsl:template><xsl:template match="tgroup | TGroup" doc:public="yes" doc:description="This template nests tables within each other, since CALS allows multiple <tgroup>s within one <table> and HTML does not; each <tgroup> from the source document becomes a new table.  See           HTML 4.0, section 11.2.3: "The THEAD, TFOOT, and TBODY sections must contain the same number of columns".">
  389.  
  390.     <table cellpadding="0" cellspacing="0">
  391.     
  392.         <xsl:attribute name="rules">
  393.             <xsl:value-of select="ancestor-or-self::table[1]/@frame | ancestor-or-self::Table[1]/@frame"/>
  394.         </xsl:attribute>
  395.         
  396.         <!-- this will hide the box around a table -->
  397.         <!--xsl:if test="ancestor::table[1]/@frame='none'">
  398.             <xsl:attribute name="border">0</xsl:attribute>
  399.         </xsl:if-->
  400.  
  401.         <colgroup>
  402.             <xsl:apply-templates select="colspec"/>
  403.         </colgroup>
  404.         <thead>
  405.             <xsl:apply-templates select="thead"/>
  406.         </thead>
  407.             <xsl:apply-templates select="tbody | TBody"/>
  408.     </table>
  409.     </xsl:template><xsl:template match="tbody | TBody">
  410.         <tbody valign="{@valign}">
  411.             <xsl:apply-templates/>
  412.         </tbody>
  413.     </xsl:template><xsl:template match="thead">
  414.         <xsl:apply-templates/>
  415.     </xsl:template><xsl:template match="colspec">
  416.             <xsl:for-each select="descendant-or-self::colspec">    
  417.                 <col width="{@colwidth}" align="{@align}"/>
  418.                     <xsl:apply-templates/>
  419.             </xsl:for-each>
  420.     </xsl:template><xsl:template match="row | Row">
  421.         <tr>
  422.             <xsl:apply-templates select="entry | Entry"/>
  423.         </tr>
  424.     </xsl:template><xsl:template match="entry | Entry" doc:public="yes" doc:description="This template performs an evaluation to test                                         whether <spanspec> or the "nameend" attribute was used and span table data accordingly">
  425. <xsl:param name="rowname" select="@spanname" doc:public="yes" doc:description="the @spanname of the <entry>; used in evaluation to lookup @nameend of <spanspec>"/>
  426.         <td class="table_data">
  427.             <xsl:if test="@align">
  428.                 <xsl:attribute name="align">
  429.                     <xsl:value-of select="@align"/>
  430.                 </xsl:attribute>
  431.             </xsl:if>
  432.               <xsl:choose>
  433.                 <xsl:when test="@spanname">
  434.                     <xsl:attribute name="colspan">
  435.                         <xsl:value-of select="../../../spanspec[@spanname=$rowname]/@nameend"/>
  436.                     </xsl:attribute>
  437.                 </xsl:when>
  438.                 <xsl:when test="@nameend">
  439.                     <xsl:attribute name="colspan">
  440.                         <xsl:value-of select="@nameend"/>
  441.                     </xsl:attribute>
  442.                 </xsl:when>
  443.             </xsl:choose>
  444.     
  445.         <!-- ***** insert   between <td> and </td> if no content (preserves width) ***** -->
  446.                 <xsl:if test="not(child::*)">
  447.                   ┬á
  448.                 </xsl:if>
  449.                 <xsl:apply-templates/>
  450.             </td>
  451.         </xsl:template>
  452. <xsl:template match="citation">
  453.         <xsl:apply-templates/>
  454.     </xsl:template><xsl:template match="cited-patent-literature">
  455.         <div>
  456.         <xsl:text> </xsl:text>
  457.             <xsl:apply-templates/>
  458.         </div>
  459.     </xsl:template><xsl:template match="cited-non-patent-literature | classification-ipc-edition | ipc | uspc-freeform">
  460.         <xsl:choose>
  461.             <xsl:when test="//specification">
  462.                 <b>    <xsl:apply-templates/>    </b>
  463.             </xsl:when>
  464.             <xsl:when test="//patent-application-publication">
  465.                 <xsl:apply-templates/>
  466.             </xsl:when>
  467.         </xsl:choose>
  468.     </xsl:template><xsl:template match="relevant-section">
  469.         <b> <xsl:apply-templates/>    </b>
  470.     </xsl:template>
  471. <xsl:template match="claims">
  472.         <div class="break_before">
  473.             <xsl:apply-templates/>
  474.         </div>
  475.     </xsl:template><xsl:template match="claim" doc:public="yes" doc:description="specification shows @number; pap shows @id.">
  476.         <div class="left_para">
  477.             <table border="0" width="100%">
  478.             <tr>
  479.                 <td width="8%" valign="top">
  480.                 <a name="{@id}"/>
  481.                 <xsl:choose>
  482.                     <xsl:when test="//specification"><!-- if its the spec -->
  483.                         <div class="text">
  484.                             [c<xsl:value-of select="@number"/>]
  485.                         </div>
  486.                         <td width="70%" valign="top" class="text">
  487.                             <xsl:apply-templates/>
  488.                         </td>
  489.                     </xsl:when>
  490.                     <xsl:when test="//patent-application-publication">
  491.                         <td width="12%" valign="top" align="right" class="para_text" colspan="1">
  492.                             [<xsl:value-of select="substring-after(@id,'CLM-')"/>]
  493.                         </td>
  494.                         <td width="70%" valign="top" class="para_text">
  495.                             <xsl:apply-templates/>
  496.                         </td>
  497.                     </xsl:when>
  498.                 </xsl:choose>
  499.                 </td>
  500.                 <td width="*"/>
  501.                 </tr>
  502.                 </table>
  503.          </div>
  504.      </xsl:template><xsl:template match="claim/claim-text[1]">
  505.         <span style="claim_text">
  506.             <xsl:apply-templates/>
  507.         </span>
  508.     </xsl:template><xsl:template match="claim-text[not(ancestor::dependent-claim-reference)]">
  509.         <div class="claim_text">
  510.             <xsl:apply-templates/>
  511.         </div>
  512.     </xsl:template><xsl:template match="dependent-claim-reference">
  513.             <b><a href="#{@depends_on}"><xsl:apply-templates/></a></b>
  514.     </xsl:template><xsl:template match="markush-group">
  515.         <ul>
  516.             <xsl:apply-templates/>
  517.         </ul>
  518.     </xsl:template><xsl:template match="markush-item">
  519.         <li>
  520.             <xsl:apply-templates/>
  521.         </li>
  522.     </xsl:template>
  523. <xsl:template match="uspc">
  524.         <xsl:value-of select=".//class"/>
  525.         <xsl:text> </xsl:text>
  526.         <xsl:value-of select=".//subclass"/>
  527.     </xsl:template><xsl:template name="classifications_ipc">
  528.     <xsl:choose>
  529.         <xsl:when test="name(technical-information)">
  530.                 <td class="table_data"><b><xsl:value-of select=".//classification-ipc/classification-ipc-primary/ipc"/></b>
  531.                 <xsl:for-each select="descendant::classification-ipc-secondary">;            
  532.                     <xsl:value-of select="."/>                
  533.                 </xsl:for-each>
  534.                 </td>
  535.                 <td class="table_data"><xsl:value-of select=".//classification-ipc/classification-ipc-edition"/></td>
  536.         </xsl:when>
  537.         <xsl:otherwise>
  538.             <b><xsl:value-of select="./classification-ipc-primary/ipc"/></b>
  539.             <xsl:for-each select="descendant::classification-ipc-secondary">;            
  540.                 <xsl:value-of select="."/>                
  541.             </xsl:for-each>
  542.             <xsl:text> </xsl:text><xsl:value-of select="./classification-ipc-edition"/>
  543.         </xsl:otherwise>
  544.     </xsl:choose>
  545.     </xsl:template><xsl:template name="classifications_us">
  546.     <xsl:choose>
  547.         <xsl:when test="name(technical-information)">
  548.                 <td class="table_data">
  549.                 <b><xsl:value-of select=".//classification-us-primary/uspc/class"/>/<xsl:value-of select=".//classification-us-primary/uspc/subclass"/></b>
  550.                 <xsl:for-each select="descendant::classification-us-secondary/uspc">;
  551.                     <xsl:call-template name="us_secondary"/>
  552.                 </xsl:for-each>
  553.                 </td>
  554.                 <xsl:for-each select="descendant::classification-us-secondary/uspc-freeform">
  555.                     <xsl:call-template name="uspc_freeform"/>
  556.                 </xsl:for-each>
  557.         </xsl:when>
  558.         <xsl:otherwise>
  559.                 <b><xsl:value-of select=".//classification-us-primary/uspc/class"/>/<xsl:value-of select=".//classification-us-primary/uspc/subclass"/></b>
  560.                 <xsl:for-each select=".//classification-us-secondary/uspc">;
  561.                     <xsl:call-template name="us_secondary"/>
  562.                 </xsl:for-each>
  563.                 <xsl:for-each select=".//classification-us-secondary/uspc-freeform">
  564.                     <xsl:call-template name="uspc_freeform"/>
  565.                 </xsl:for-each>
  566.         </xsl:otherwise>
  567.     </xsl:choose>
  568.     </xsl:template><xsl:template name="uspc_freeform">
  569.         <tr><td/><td/><td/>
  570.             <td class="table_data"><xsl:value-of select="."/></td>
  571.         </tr>    
  572.     </xsl:template><xsl:template name="us_secondary">
  573.             <xsl:value-of select="class"/>/<xsl:value-of select="subclass"/>                                
  574.     </xsl:template>
  575. <xsl:template match="bold">
  576.         <b> <xsl:apply-templates/> </b>
  577.     </xsl:template><xsl:template match="email">
  578.         <span class="mono"> <xsl:apply-templates/> </span>
  579.     </xsl:template><xsl:template match="emphasis | italic">
  580.         <i> <xsl:apply-templates/> </i>
  581.     </xsl:template><xsl:template match="footnote">
  582.         <font size="-2"><xsl:apply-templates/></font>
  583.     </xsl:template><xsl:template match="heading">
  584.         <h3><xsl:apply-templates/></h3>
  585.     </xsl:template><xsl:template match="highlight| in-line-formula | literal">
  586.         <xsl:apply-templates/>
  587.     </xsl:template><xsl:template match="list-item">
  588.         <div class="list_item">
  589.             <xsl:apply-templates/>        
  590.         </div>    
  591.      </xsl:template><xsl:template match="paragraph">
  592.         <div class="left_para">
  593.         <table border="0" width="100%">
  594.             <tr>
  595.                 <td width="8%" valign="top" class="para_text">
  596.                     <xsl:text> </xsl:text>
  597.                 </td>
  598.             <xsl:choose>
  599.                 <xsl:when test="//patent-application-publication">    
  600.                     <td width="85%" class="para_text">
  601.                         <xsl:if test="@id">
  602.                             [<xsl:value-of select="substring-after(@id,'P-')"/>]    
  603.                             ┬á┬á┬á                
  604.                          </xsl:if>
  605.                         <xsl:apply-templates/>
  606.                     </td>
  607.                  </xsl:when>
  608.                  <xsl:otherwise>
  609.                     <td width="85%" class="para_text">
  610.                         [<xsl:value-of select="@id"/>]    
  611.                         ┬á┬á┬á                
  612.                         <xsl:apply-templates/>
  613.                     </td>
  614.                  </xsl:otherwise>
  615.                 </xsl:choose>
  616.                 <td width="*"/>
  617.             </tr>
  618.         </table>
  619.         </div>
  620.      </xsl:template><xsl:template match="program-listing">
  621.         <div style="margin-bottom:  1pc;                     font-size: 10pt;">
  622.              <pre>
  623.                  <xsl:apply-templates/>
  624.              </pre>
  625.         </div>
  626.     </xsl:template><xsl:template match="section">
  627.         <div style="margin-bottom:  1pc;                     margin-left:    +10pt;">
  628.                <xsl:apply-templates/>
  629.         </div>
  630.     </xsl:template><xsl:template match="smallcaps">
  631.         <span style="font-variant: small-caps;">
  632.             <xsl:apply-templates/>
  633.         </span>
  634.     </xsl:template><xsl:template match="subscript">
  635.         <span style="vertical-align: sub;">
  636.             <xsl:apply-templates/>
  637.         </span>
  638.     </xsl:template><xsl:template match="superscript">
  639.         <span style="vertical-align: super;">
  640.             <xsl:apply-templates/>
  641.         </span>
  642.     </xsl:template><xsl:template match="text()">
  643.         <xsl:value-of select="."/>
  644.     </xsl:template><xsl:template match="title-of-invention">
  645.         <h1 class="title">
  646.             <xsl:apply-templates/>
  647.         </h1>
  648.     </xsl:template>
  649. <xsl:template match="correspondence-address" doc:public="yes" doc:description="inserts different boilerplate text according to doctype.">
  650.     <br/>
  651.         <xsl:choose>
  652.             <xsl:when test="//bibd.transmittal">
  653.                 <b>Correspondence Address (Publish):</b>
  654.             </xsl:when>        
  655.             <xsl:when test="//patent-application-publication">
  656.                 <b>Correspondence Name and Address:</b>
  657.                 <br/>
  658.                 <xsl:apply-templates/>
  659.             </xsl:when>
  660.         </xsl:choose>
  661. </xsl:template><xsl:template match="name-1 | name-2">
  662.         <xsl:apply-templates/>
  663. </xsl:template>
  664. <xsl:template name="css_styles" doc:description="Inserts a <style> element containing a list of CSS styles used by USPTO stylesheets into the <head> section of the resulting HTML document.">
  665. <style type="text/css">
  666.             a     {text-decoration: none;color:blue;}
  667.             
  668.             a:visited {color: blue; }
  669.             
  670.             
  671.             .bar {font-family: Code 39;
  672.                   font-size: 16pt;}
  673.  
  674.             .break_avoid {page-break-inside: avoid;}
  675.             
  676.             .break_before {page-break-before: always;}
  677.             
  678.             .break_before_after {page-break-before: always;
  679.                                  page-break-after: always;}
  680.  
  681.             .claim_text {margin-left: +30pt;
  682.                          font-size: 10pt;
  683.                              line-height: 200%;}
  684.  
  685.             .grant_claim_text {margin-left: +60pt;
  686.                                    line-height: 200%;}
  687.  
  688.             .head {    font-size: 12pt;
  689.                     font-weight: bold;
  690.                       margin-top: 2em;
  691.                       margin-bottom: 2em;}
  692.                       
  693.             heading {margin-top: 3px;
  694.                      margin-bottom: 3px;
  695.                      text-transform: uppercase;}
  696.                      
  697.  
  698.              h3         {margin-top: 3px;
  699.                      margin-bottom: 3px;
  700.                      font-weight: normal;
  701.                      text-align: center;
  702.                      text-transform: uppercase;}
  703.  
  704.                      
  705.                       
  706.             .headinfo_large {font-size: 12pt;}
  707.                              
  708.             .headinfo_reg   {font-size: 10pt;
  709.                              font-weight: bold;}
  710.  
  711.  
  712.             .left_para {margin-top: 8px;
  713.                         margin-bottom: 8px;
  714.                         margin-left: -30pt;}
  715.                         
  716.                         
  717.             .list_item {list-style-type: none;
  718.                          display: list-item;
  719.                          margin-left: +30pt;
  720.                            line-height: 200%;}
  721.                            
  722.             .mono       {line-height: 200%;
  723.                         font-family: monospace;}
  724.  
  725.             paragraph {font-size: 10pt;
  726.                        line-height: 200%;}
  727.             
  728.             .para_text {line-height: 200%;
  729.                         font-size: 10pt;
  730.                         margin-top: 8px;
  731.                         margin-bottom: 8px;}
  732.  
  733.             .smallcaps     {text-transform: uppercase;
  734.                          font-size: 9pt; }            
  735.             
  736.             .smalltitle {display: block;
  737.                     text-align: center;
  738.                     text-transform: uppercase;
  739.                     font-size:16pt;
  740.                     font-weight:bold;
  741.                     margin-top:3mm;
  742.                     margin-bottom: 3mm;}
  743.  
  744.             .table_head {font-size: 12pt;
  745.                          font-weight: bold; 
  746.                          margin-top: 2em; 
  747.                          margin-bottom: 2em;}
  748.  
  749.             .table_data {font-size: 10pt;
  750.                        vertical-align: top;}
  751.  
  752.             .text  {line-height: 200%;
  753.                     font-size: 10pt;}
  754.                     
  755.             .title {display: block;
  756.                     text-align: center;
  757.                     font-size:26pt;
  758.                     font-family:serif;
  759.                     font-weight:bold;
  760.                     margin-top:3mm;
  761.                     margin-bottom: 3mm;}
  762.  
  763. </style>
  764. </xsl:template>
  765. <xsl:template match="chemistry-cwu | math-cwu | sequence-cwu">
  766.        <span class="break_avoid">
  767.             <xsl:apply-templates/>
  768.         </span>
  769.     </xsl:template>
  770. <xsl:template match="document-id">
  771.         <xsl:apply-templates select="country-code"/>
  772.         <xsl:text> </xsl:text>
  773.         <xsl:apply-templates select="doc-number"/>
  774.         <xsl:text> </xsl:text>
  775.         <xsl:apply-templates select="kind-code"/>
  776.         <xsl:text> </xsl:text>
  777.         <xsl:apply-templates select="document-date"/>
  778.         <xsl:text> </xsl:text>
  779.     </xsl:template><xsl:template match="country-code | doc-number | kind-code">
  780.         <xsl:value-of select="."/>
  781.     </xsl:template><xsl:template match="document-date" doc:public="yes" doc:description="uses <xsl:param> elements to present <document-date> in YYYY-MM-DD format">
  782.             <xsl:param name="document-year" doc:public="yes" doc:description="assigns the year portion of the <document-date> element to a parameter to allow YYYY-MM-DD date formatting.">
  783.                 <xsl:value-of select="substring(.//document-date,1,4)"/>
  784.             </xsl:param>
  785.             <xsl:param name="document-month" doc:public="yes" doc:description="assigns the month portion of the <document-date> element to a parameter to allow YYYY-MM-DD date formatting.">
  786.                 <xsl:value-of select="substring(.//document-date,5,2)"/>
  787.             </xsl:param>
  788.             <xsl:param name="document-day" doc:public="yes" doc:description="assigns the date portion of the <document-date> element to a parameter to allow YYYY-MM-DD date formatting.">
  789.                 <xsl:value-of select="substring(.//document-date,7,2)"/>
  790.             </xsl:param>
  791.             <xsl:value-of select="$document-year"/>-<xsl:value-of select="$document-month"/>-<xsl:value-of select="$document-day"/>
  792.     </xsl:template>
  793. <xsl:template match="artwork">
  794.         <xsl:call-template name="tiff_embedder"/>
  795.     </xsl:template><xsl:template match="figure">
  796.         <div class="break_before">
  797.              <xsl:apply-templates/>
  798.         </div>
  799.     </xsl:template><xsl:template match="drawing-reference-character">
  800.         <xsl:apply-templates/>
  801.     </xsl:template><xsl:template match="image" name="tiff_embedder" doc:public="yes" doc:description="performs a series of tests; 1) tests whether its a TIFF or JPG; JPG is wrapped in <img> HTML tags,      TIFFs in <embed> HTML tags; 2) if image height is greater than 1 inch, it breaks the line;     3) if no height/width attributes are present, sets tiff viewer to 800X600">
  802.             <xsl:choose>
  803.                   <xsl:when test="local:tagit(.)='1'"><!-- its a TIFF -->
  804.                     <!-- if image is larger than 1 inch, line break_before -->
  805.                      <xsl:if test="local:chooseDiv(.)='0'">
  806.                        <div>
  807.                           <embed toolbar="off" fit="best" align="top">
  808.                              <xsl:choose>
  809.                                 <xsl:when test="@height">                                        
  810.                                     <xsl:attribute name="height">
  811.                                          <xsl:value-of select="local:getHeight(.)"/>
  812.                                     </xsl:attribute>
  813.                                  </xsl:when>
  814.                                  <xsl:otherwise>
  815.                                     <xsl:attribute name="height">800</xsl:attribute>
  816.                                  </xsl:otherwise>
  817.                               </xsl:choose>
  818.                               <xsl:choose>
  819.                                  <xsl:when test="@width">
  820.                                     <xsl:attribute name="width">
  821.                                         <xsl:value-of select="local:getWidth(.)"/>
  822.                                      </xsl:attribute>
  823.                                  </xsl:when>
  824.                                  <xsl:otherwise>
  825.                                     <xsl:attribute name="width">600</xsl:attribute>
  826.                                  </xsl:otherwise>
  827.                                </xsl:choose>
  828.                                 <xsl:attribute name="src">
  829.                                      <xsl:value-of select="local:LookupEntity(.)"/>
  830.                                 </xsl:attribute>
  831.                            </embed>
  832.                         </div>
  833.                     </xsl:if>
  834.                     <!-- otherwise, image is inline (less than 1 inch high) -->
  835.                    <xsl:if test="local:chooseDiv(.)='1'">
  836.                         <embed toolbar="off" fit="best" align="top">
  837.                            <xsl:choose>
  838.                                <xsl:when test="@height">                                        
  839.                                    <xsl:attribute name="height">
  840.                                       <xsl:value-of select="round(local:getHeight(.))"/>
  841.                                    </xsl:attribute>
  842.                                 </xsl:when>
  843.                                 <xsl:otherwise>
  844.                                     <xsl:attribute name="height">800</xsl:attribute>
  845.                                 </xsl:otherwise>
  846.                            </xsl:choose>
  847.                            <xsl:choose>
  848.                                 <xsl:when test="@width">
  849.                                     <xsl:attribute name="width">
  850.                                       <xsl:value-of select="round(local:getWidth(.))"/>
  851.                                      </xsl:attribute>
  852.                                  </xsl:when>
  853.                                  <xsl:otherwise>
  854.                                      <xsl:attribute name="width">600</xsl:attribute>
  855.                                  </xsl:otherwise>
  856.                             </xsl:choose>
  857.                                  <xsl:attribute name="src">
  858.                                       <xsl:value-of select="local:LookupEntity(.)"/>
  859.                                  </xsl:attribute>
  860.                          </embed>
  861.                     </xsl:if>
  862.                   </xsl:when>
  863.                   <xsl:otherwise><!-- otherwise, it's a .jpg, place in <img> -->
  864.                       <img>
  865.                          <xsl:attribute name="src">
  866.                              <xsl:value-of select="local:LookupEntity(.)"/>
  867.                           </xsl:attribute>
  868.                       </img>
  869.                   </xsl:otherwise>
  870.              </xsl:choose>
  871.     </xsl:template>
  872. <xsl:template match="name">
  873.         <xsl:if test=".//name-prefix">
  874.             <xsl:value-of select="name-prefix"/>
  875.             <xsl:text>┬á</xsl:text>
  876.         </xsl:if>
  877.  
  878.         <xsl:value-of select="given-name"/>
  879.         <xsl:text>┬á</xsl:text>
  880.         
  881.         <xsl:if test=".//middle-name">
  882.             <xsl:value-of select="middle-name"/>
  883.             <xsl:text>┬á</xsl:text>
  884.         </xsl:if>
  885.     
  886.         <xsl:value-of select="family-name"/>
  887.         
  888.         <xsl:if test=".//name-suffix">
  889.             <xsl:text>┬á</xsl:text>
  890.             <xsl:value-of select="name-suffix"/>
  891.         </xsl:if>
  892.     </xsl:template>
  893. <xsl:template match="federal-research-statement">
  894.         <div style="margin-bottom:  1pc;                     margin-left:    +10pt;">
  895.                <xsl:apply-templates/>
  896.         </div>
  897.     </xsl:template><xsl:template match="paragraph-federal-research-statement">
  898.         <div class="left_para">
  899.          <table width="100%">
  900.              <tr>
  901.                  <td width="8%" valign="top">
  902.                 ┬á
  903.                 </td>
  904.                 <td width="85%">
  905.                     <div class="para_text">
  906.                         <xsl:apply-templates/>
  907.                     </div>
  908.                 </td>
  909.                 <td width="*"/>
  910.              </tr>
  911.          </table>
  912.          </div>
  913.     </xsl:template><xsl:template match="number | grant-number | contract-number | us-agency">
  914.         <xsl:text> </xsl:text>
  915.         <xsl:apply-templates/>
  916.     </xsl:template>
  917. <xsl:template match="party">
  918.     <div>
  919.         <xsl:apply-templates select="name"/>
  920.     </div>
  921.         <xsl:value-of select=".//organization-name"/>
  922.         <xsl:apply-templates select="address"/>
  923.     </xsl:template><xsl:template match="citizenship">
  924.         <xsl:text> </xsl:text>
  925.         <xsl:apply-templates/>
  926.     </xsl:template><xsl:template match="organization-name">
  927.         <div>
  928.             <xsl:apply-templates/>
  929.         </div>
  930.     </xsl:template>
  931. <xsl:template match="residence">
  932.     <table width="60%" border="0">
  933.         <xsl:apply-templates/>
  934.     </table>
  935. </xsl:template><xsl:template match="residence-us | residence-non-us">
  936.     <xsl:apply-templates/>
  937. </xsl:template><xsl:template match="residence//city">
  938.     <tr><td class="table_data">Residence City:</td>
  939.         <td class="table_data">
  940.             <xsl:apply-templates/>
  941.         </td>
  942.     </tr>
  943. </xsl:template><xsl:template match="residence//state">
  944.     <tr><td class="table_data">Residence State:</td>
  945.         <td class="table_data">
  946.             <xsl:apply-templates/>
  947.         </td>
  948.     </tr>
  949. </xsl:template><xsl:template match="residence//country-code">
  950.     <tr><td class="table_data">Residence Country:</td>
  951.         <td class="table_data">
  952.             <xsl:value-of select="."/>
  953.         </td>
  954.     </tr>
  955. </xsl:template><xsl:template match="residence//military-service">
  956.     <tr><td class="table_data">Military Service:</td>
  957.         <td class="table_data">
  958.             <xsl:apply-templates/>
  959.         </td>
  960.     </tr>
  961. </xsl:template><xsl:template match="residence//citizenship">
  962.     <tr><td class="table_data">Citizenship:</td>
  963.         <td class="table_data">
  964.             <xsl:apply-templates/>
  965.         </td>
  966.     </tr>
  967. </xsl:template>
  968. <xsl:template match="sequence-listing-old-rules | sequence-listing-new-rules">
  969.         <xsl:apply-templates/>
  970.     </xsl:template><xsl:template match="*">
  971.         <xsl:apply-templates/>
  972.     </xsl:template><xsl:template match="s-1 | s100">
  973.         <div>
  974.             <xsl:apply-templates/>
  975.         </div>
  976.     </xsl:template><xsl:template match="s-1-iii | s160">
  977.         <xsl:text>Number of Sequences: </xsl:text>
  978.             <xsl:value-of select="."/>
  979.     </xsl:template><xsl:template match="s-2 | s210">
  980.         <xsl:text>Sequence ID: </xsl:text>
  981.         <xsl:choose>
  982.             <xsl:when test="self::s-2">
  983.                 <xsl:value-of select="@seq-no"/>
  984.                 <xsl:apply-templates/>
  985.             </xsl:when>
  986.             <xsl:when test="self::s210">
  987.                 <xsl:value-of select="."/>
  988.             </xsl:when>
  989.         </xsl:choose>
  990.     </xsl:template><xsl:template match="s-2-i-a | s211">
  991.         <br/>
  992.         <xsl:text>Length of Sequence: </xsl:text>
  993.         <xsl:value-of select="."/>
  994.     </xsl:template><xsl:template match="s-2-i-b | s212">
  995.         <br/>        
  996.         <xsl:text>Sequence Type: </xsl:text>
  997.         <xsl:value-of select="."/>
  998.     </xsl:template><xsl:template match="s-2-i-c">
  999.         <br/>
  1000.         <xsl:text>Strandedness: </xsl:text>        
  1001.         <xsl:apply-templates/>
  1002.     </xsl:template><xsl:template match="s-2-i-d">
  1003.         <br/>
  1004.         <xsl:text>Topology: </xsl:text>
  1005.         <xsl:apply-templates/>
  1006.     </xsl:template><xsl:template match="s-2-ii-mt">
  1007.         <br/>
  1008.         <xsl:text>Molecule Type: </xsl:text>
  1009.         <xsl:apply-templates/>
  1010.     </xsl:template><xsl:template match="s-2-vi-a | s213">
  1011.         <br/>
  1012.         <xsl:text>Scientific Name: </xsl:text>
  1013.         <xsl:value-of select="."/>
  1014.     </xsl:template><xsl:template match="s-2-ix-a | s221">
  1015.         <br/>
  1016.         <xsl:text>Name/Key: </xsl:text>
  1017.             <xsl:apply-templates/>
  1018.     </xsl:template><xsl:template match="s-2-ix-b | s222">
  1019.         <br/>
  1020.         <xsl:text>Location: </xsl:text>
  1021.             <xsl:apply-templates/>
  1022.     </xsl:template><xsl:template match="s-2-ix-d | s223">
  1023.         <br/>
  1024.         <xsl:text>Other Information: </xsl:text>
  1025.             <xsl:apply-templates/>
  1026.     </xsl:template><xsl:template match="s-2-xi | s400">
  1027.     <pre style="font-size: 10pt;">
  1028.             <xsl:value-of select="."/>
  1029.     </pre>
  1030.     </xsl:template>
  1031.  
  1032. </xsl:stylesheet>