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

  1. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  2.  
  3. <!--
  4. *********************************************************************
  5. *  John Dunning: 2001-01-26                                         *
  6. *  DTD: ST32-us-grant-024-xml.dtdV1.4 2001-01-31                    *
  7. *        XSL transformation for ST32 Grant DTD                      *
  8. *                                                                   *
  9. *  This stylesheet follows the basic structure of the DTD           *
  10. *  and is arranged in the following manner:                         *
  11. *       + SDOBI                                                     *
  12. *       + SDOAB                                                     *
  13. *       + SDODE                                                     *
  14. *       + SDOCL                                                     *
  15. *       + SDODR                                                     *
  16. *       + Commonly used elements (listed alphabetically)            *
  17. *********************************************************************
  18. -->
  19.  
  20. <xsl:output method="html" indent="yes" omit-xml-declaration="yes"/>
  21.  
  22. <xsl:preserve-space elements="*"/>
  23.  
  24. <xsl:variable name="doc_kind" select="//B130"/>
  25.  
  26. <!-- ***** establish context of HTML document ***** -->
  27. <xsl:template match="/">
  28.     <html>
  29.         <head>
  30.             <xsl:call-template name="css_styles"/>
  31.             <script language="JScript"><xsl:comment>
  32.  
  33.     function loadNewDoc(node){
  34.     try {
  35.         var myloc, myNewLoc, myPI, stylePI, newStylePI, r, re, styleNode;
  36.  
  37.         var mydoc = new ActiveXObject("Msxml2.DOMDocument");
  38.         var myNewDoc = new ActiveXObject("Msxml2.DOMDocument");
  39.             myNewDoc.loadXML("<FIGURE></FIGURE>");
  40.             root = myNewDoc.documentElement; // <figure/>
  41.             myloc = new String(window.location);
  42.             myNewLoc = myloc.substr(8); 
  43.  
  44.         var myImages = document.XMLDocument.getElementsByTagName("SDODR/EMI");
  45.             for (var i=0;i<myImages.length;i++){
  46.                 myNewDoc.documentElement.appendChild(myImages(i));
  47.         }
  48.  
  49.         for (var i=0;i<document.XMLDocument.documentElement.parentNode.childNodes.length;i++){
  50.             if (document.XMLDocument.documentElement.parentNode.childNodes(i).nodeName == "xml-stylesheet") {
  51.                 stylePI = document.XMLDocument.documentElement.parentNode.childNodes(i).text;
  52.  
  53.                 // test whether grant.xsl or grant_full.xsl is used;
  54.                 if (stylePI.indexOf("full") == -1)
  55.                     re = /grant/g;
  56.                     else
  57.                     re = /grant_full/g;
  58.                 r = stylePI.replace(re,"figures_detail");
  59.                 newStylePI = myNewDoc.createProcessingInstruction("xml-stylesheet",r);
  60.                 }
  61.             }
  62.             styleNode = myNewDoc.insertBefore(newStylePI,root);
  63.  
  64.         // save new file to same directory        
  65.         
  66.             var fileName = "";
  67.             var href= myNewLoc;
  68.             var s = href.split("/");
  69.             for (var i=0;i<(s.length);i++) { 
  70.             fileName=s[i]; 
  71.             }
  72.             var locLen = myNewLoc.length;
  73.             var fileLen = fileName.length;
  74.             var path = myNewLoc.substr(0,(locLen-fileLen));
  75.             
  76.         // now write to a file that can be opened in new browser
  77.         var fso = new ActiveXObject("Scripting.FileSystemObject");
  78.         var a = fso.CreateTextFile(path + "images.xml", true);
  79.         a.Write(myNewDoc.xml);
  80.         a.Close();
  81.             
  82.         var newWin = window.open(path + "images.xml");
  83.     
  84.     }
  85.     
  86.     catch(e) {
  87.         window.alert ("An error has occurred.  Please use the stylesheet 'grant_noscript.xsl'");    
  88.         }
  89.     }    
  90.  
  91.     </xsl:comment>
  92.     </script>
  93.  
  94.         </head>
  95.         <body>
  96.         <basefont face="Arial Unicode MS, Lucida Sans Unicode, Times New Roman " size="2">
  97.         <div style="margin-left: +35pt;">
  98.             <xsl:apply-templates select=".//SDOBI | .//SDOAB | .//SDODE | .//SDOCL | .//SDODR |.//SDOCR"/>
  99.         </div>
  100.         </basefont>
  101.         </body>
  102.     </html>
  103. </xsl:template>
  104.  
  105. <!-- ********************************************************** -->
  106. <!--     SUBDOC BIBLIOGRAPHIC INFORMATION                        -->
  107. <!-- ********************************************************** -->
  108.  
  109. <xsl:param name="cont"/>
  110.     <xsl:template match="SDOBI">
  111.             <xsl:param name="B140-year">
  112.                 <xsl:value-of select="substring(.//B140/DATE/PDAT,1,4)"/>
  113.             </xsl:param>
  114.             <xsl:param name="B140-month">
  115.                 <xsl:value-of select="substring(.//B140/DATE/PDAT,5,2)"/>
  116.             </xsl:param>
  117.             <xsl:param name="B140-day">
  118.                 <xsl:value-of select="substring(.//B140/DATE/PDAT,7,2)"/>
  119.             </xsl:param>
  120.  
  121.             <xsl:param name="B220-year">
  122.                 <xsl:value-of select="substring(.//B220/DATE/PDAT,1,4)"/>
  123.             </xsl:param>
  124.             <xsl:param name="B220-month">
  125.                 <xsl:value-of select="substring(.//B220/DATE/PDAT,5,2)"/>
  126.             </xsl:param>
  127.             <xsl:param name="B220-day">
  128.                 <xsl:value-of select="substring(.//B220/DATE/PDAT,7,2)"/>
  129.             </xsl:param>
  130.  
  131.         <table width="90%" border="0">
  132.             <tr>
  133.                 <!-- ***** Patent number (for barcode) ***** -->
  134.                 <td class="bar" align="right">*<xsl:value-of select=".//B190/PDAT"/><xsl:value-of select=".//B110/DNUM/PDAT"/><xsl:value-of select=".//B130/PDAT"/>*</td>        
  135.             </tr>
  136.         </table>
  137.         <table width="90%" border="0">
  138.         <colgroup>
  139.             <col width="40%"/>    <!-- (12) United States [Plant, Design] Patent -->
  140.             <col width="5%"/>    <!-- spaceholder -->
  141.             <col width="5%"/>     <!-- (10), (45) -->
  142.             <col width="15%"/>    <!-- Patent No.:, Date of Patent (labels) -->            
  143.             <col width="30%"/>    <!-- Patent No.:, Date of Patent (data) -->
  144.         </colgroup>
  145.  
  146.             <tr>
  147.                 <td class="headinfo_large" colspan="1">
  148.             <!-- ***** test for document kind, add boilerplate ***** -->
  149.             <xsl:choose>
  150.                 <xsl:when test="substring($doc_kind ,1,1)='A'">
  151.                     <font size="-1" weight="normal">(12)</font>┬á┬á<b>United States Utility Patent</b>                 
  152.                 </xsl:when>
  153.                 <xsl:when test="substring($doc_kind ,1,1)='B'">
  154.                     <font size="-1" weight="normal">(12)</font>┬á┬á<b>United States Patent</b>                 
  155.                 </xsl:when>
  156.                 <xsl:when test="substring($doc_kind ,1,1)='E'">
  157.                     <font size="-1" weight="normal">(12)</font>┬á┬á<b>United States Reissue Patent</b>                 
  158.                 </xsl:when>
  159.                 <xsl:when test="substring($doc_kind,1,1)='S'">
  160.                     <font size="-1" weight="normal">(12)</font>┬á┬á<b>United States Design Patent</b>                 
  161.                 </xsl:when>
  162.                 <xsl:when test="substring($doc_kind,1,1)='P'">
  163.                     <font size="-1" weight="normal">(12)</font>┬á┬á<b>United States Plant Patent</b>                 
  164.                 </xsl:when>
  165.                 <xsl:otherwise>
  166.                     <font size="-1" weight="normal">(12)</font>┬á┬á<b>United States Patent</b>                 
  167.                 </xsl:otherwise>
  168.             </xsl:choose>
  169.                 </td>
  170.                 <td/>
  171.                 <td class="table_data" align="right">(10)</td>
  172.                 <td class="table_data" align="right">
  173.                     <b>Patent No: </b>
  174.                 </td>
  175.                 <td class="headinfo_large" align="right">
  176.             <!-- ***** same info that's in the barcode at top ***** -->
  177.                 <!-- country -->
  178.                     <b><xsl:value-of select=".//B190/PDAT"/></b>
  179.                     <xsl:text> </xsl:text>
  180.                 <!-- Patent number -->
  181.                 <xsl:choose>
  182.                 <!-- **** can not format the number of Plant patents, as they start with 'PP' **** -->
  183.                     <xsl:when test="substring($doc_kind,1,1)='P'">
  184.                         <b><xsl:value-of select="substring(.//B110/DNUM/PDAT,1,2)"/><xsl:value-of select="format-number(substring-after(.//B110/DNUM/PDAT,'PP'),'###,###')"/></b>
  185.                     </xsl:when>
  186.                 <!-- **** can not format the number of Design patents, as they start with 'D' **** -->
  187.                     <xsl:when test="substring($doc_kind,1,1)='S'">
  188.                         <b><xsl:value-of select="substring(.//B110/DNUM/PDAT,1,1)"/><xsl:value-of select="format-number(substring-after(.//B110/DNUM/PDAT,'D'),'###,###')"/></b>
  189.                     </xsl:when>
  190.                     <xsl:otherwise>
  191.                         <b><xsl:value-of select="format-number(.//B110/DNUM/PDAT,'##,###,###')"/></b>                
  192.                     </xsl:otherwise>
  193.                 </xsl:choose>
  194.                     <xsl:text> </xsl:text>
  195.                 <!-- kind code -->
  196.                     <b><xsl:value-of select=".//B130/PDAT"/></b>
  197.                 </td>
  198.             </tr>
  199.             <tr>
  200.                 <td class="headinfo_reg">
  201.             <!-- ***** First-named inventor's family name ***** -->
  202.                     ┬á┬á┬á┬á┬á┬á
  203.                     <b><xsl:value-of select=".//B721/PARTY-US//SNM"/>
  204.                     <!-- ***** add "et al. " if more than one inventor ***** -->
  205.                     <xsl:if test="count(//B721) >1"> et al.</xsl:if>                    
  206.                     </b>
  207.                 </td>
  208.                 <td/>
  209.                 <td class="table_data" align="right">(45)</td>
  210.                 <td class="table_data" align="right"><b>Date of Patent:</b> </td>
  211.             <!-- date of patent -->
  212.                 <td class="headinfo_reg" align="right">
  213.                     <xsl:value-of select="$B140-year"/>-<xsl:value-of select="$B140-month"/>-<xsl:value-of select="$B140-day"/>
  214.                 </td>
  215.             </tr>
  216.         </table>
  217.         <hr width="100%"/>
  218.     <!-- ***** end page header ***** -->
  219.         
  220.         <!-- ***** bibliographic info ***** -->
  221.         <table width="90%" border="0">
  222.         <tr><td width="10%"/><td width="15%"/><td width="*"/></tr>
  223.             <tr><td class="table_data">(54)</td>
  224.             <!-- ***** title of invention ***** -->
  225.                 <td colspan="2" style="text-transform: uppercase">
  226.                     <b><xsl:value-of select="//B540/*"/></b></td>
  227.                 <td/>
  228.             </tr>
  229.             <xsl:choose>
  230.             <!-- ***** test number of INVENTORs ***** -->
  231.                 <xsl:when test="count(//B721) > 1 ">
  232.                     <tr><td class="table_data">(76)</td>
  233.                     <td class="table_data">
  234.                         Inventors: 
  235.                     </td>
  236.                     <td class="table_data">
  237.                         <b>
  238.                             <xsl:apply-templates select=".//B721[1]/PARTY-US/NAM"/>,                
  239.                         </b>
  240.                             <xsl:apply-templates select=".//B721[1]/PARTY-US/ADR"/>
  241.                          
  242.                     <xsl:for-each select=".//B721[1]/following-sibling::B721">;
  243.                          <b><xsl:apply-templates select=".//NAM"/></b>
  244.                          <xsl:apply-templates select=".//ADR"/>
  245.                     </xsl:for-each>
  246.                     </td>
  247.                     </tr>
  248.                 </xsl:when>
  249.                 <xsl:otherwise>
  250.                     <tr><td class="table_data">(76)</td>
  251.                     <td class="table_data">
  252.                         Inventor: 
  253.                     </td>
  254.                     <td class="table_data">
  255.                          <b><xsl:apply-templates select=".//B721/PARTY-US/NAM"/>, </b>
  256.                             <xsl:apply-templates select=".//B721/PARTY-US/ADR"/>
  257.                     </td>
  258.                     </tr>
  259.                 </xsl:otherwise>
  260.             </xsl:choose>
  261.  
  262.             <!-- ***** test number of ASSIGNEEs ***** -->
  263.             <xsl:choose>
  264.                 <xsl:when test="count(//B731) > 1 ">
  265.                     <tr><td class="table_data">(76)</td>
  266.                     <td class="table_data">
  267.                         Assignees: 
  268.                     </td>
  269.                     <td class="table_data">
  270.                         <b>
  271.                             <xsl:apply-templates select=".//B731[1]/PARTY-US/NAM"/>,                
  272.                         </b>
  273.                             <xsl:apply-templates select=".//B731[1]/PARTY-US/ADR"/>
  274.                          
  275.                     <xsl:for-each select=".//B731[1]/following-sibling::B731">;
  276.                          <b><xsl:apply-templates select=".//NAM"/></b>
  277.                          <xsl:apply-templates select=".//ADR"/>
  278.                     </xsl:for-each>
  279.                     </td>
  280.                     </tr>
  281.                 </xsl:when>
  282.                 <xsl:when test="count(//B731)='1'">
  283.                     <tr><td class="table_data">(73)</td>
  284.                     <td class="table_data">
  285.                         Assignee: 
  286.                     </td>
  287.                     <td class="table_data">
  288.                          <b><xsl:apply-templates select=".//B731/PARTY-US/NAM"/>,</b>
  289.                             <xsl:apply-templates select=".//B731/PARTY-US/ADR"/>
  290.                     </td>
  291.                     </tr>
  292.                 </xsl:when>
  293.             </xsl:choose>
  294.         <!-- ***** test for Term of Grant ***** -->
  295.             <xsl:if test="//B474">
  296.                 <tr><td class="table_data">(**)</td>
  297.                     <td class="table_data">Term:</td>
  298.                     <td class="table_data">
  299.                         <b><xsl:value-of select=".//B474"/></b>
  300.                     </td>
  301.                 </tr>
  302.             </xsl:if>
  303.         <!-- Todo: test for B474US; handle appropriately -->    
  304.             <xsl:variable name="B-210-1" select="substring(.//B210/DNUM/PDAT,1,2)"/>            
  305.             <xsl:variable name="B-210-2" select="substring(.//B210/DNUM/PDAT,3,8)"/>            
  306.  
  307.             <tr><td class="table_data">(21)</td>
  308.                 <td class="table_data">Appl. No.: </td>
  309.         <!-- ***** application number ***** -->
  310.                 <td class="table_data"><b><!--xsl:value-of select=".//B210"/-->
  311.                     <xsl:value-of select="$B-210-1"/>/<xsl:value-of select="format-number($B-210-2,'###,###')"/>
  312.                 </b></td>
  313.             </tr>
  314.             <tr><td class="table_data">(22)</td>
  315.                 <td class="table_data">Filed: </td>
  316.         <!-- ***** application-filing-date ***** -->
  317.                 <td class="table_data"><b><xsl:value-of select="$B220-year"/>-<xsl:value-of select="$B220-month"/>-<xsl:value-of select="$B220-day"/></b></td>
  318.             </tr>
  319.             
  320.             <xsl:if test=".//B861">
  321.  
  322.             <xsl:variable name="B861-year" select="substring(.//B861/DOC/DATE/PDAT,1,4)"/>
  323.             <xsl:variable name="B861-month" select="substring(.//B861/DOC/DATE/PDAT,5,2)"/>
  324.             <xsl:variable name="B861-date" select="substring(.//B861/DOC/DATE/PDAT,7,2)"/>
  325.  
  326.             <tr><td class="table_data">(22)</td>
  327.                 <td class="table_data">PCT Filed:</td>
  328.                 <td class="table_data"><b><xsl:value-of select="$B861-year"/>-<xsl:value-of select="$B861-month"/>-<xsl:value-of select="$B861-date"/></b></td>
  329.             </tr>
  330.  
  331.             <tr><td class="table_data">(86)</td>
  332.                 <td class="table_data">PCT No.: </td>
  333.             <!-- ***** application number ***** -->
  334.                 <td class="table_data"><b><xsl:value-of select=".//B861/DOC/DNUM/PDAT"/></b></td>
  335.             </tr>
  336.             </xsl:if>
  337.             
  338.             <xsl:if test=".//B863">
  339.                 <xsl:variable name="B863-year" select="substring(.//B863/DATE/PDAT,1,4)"/>
  340.                 <xsl:variable name="B863-month" select="substring(.//B863/DATE/PDAT,5,2)"/>
  341.                 <xsl:variable name="B863-date" select="substring(.//B863/DATE/PDAT,7,2)"/>
  342.  
  343.             <tr><td class="table_data"/>
  344.                 <td class="table_data">┬º 371 Date:</td>
  345.             <!-- ***** application number ***** -->
  346.                 <td class="table_data"><b><xsl:value-of select="$B863-year"/>-<xsl:value-of select="$B863-month"/>-<xsl:value-of select="$B863-date"/></b></td>
  347.             </tr>
  348.             </xsl:if>
  349.             
  350.             <xsl:if test=".//B864">
  351.                 <xsl:variable name="B864-year" select="substring(.//B864/DATE/PDAT,1,4)"/>
  352.                 <xsl:variable name="B864-month" select="substring(.//B864/DATE/PDAT,5,2)"/>
  353.                 <xsl:variable name="B864-date" select="substring(.//B864/DATE/PDAT,7,2)"/>
  354.             
  355.             <tr><td class="table_data"/>
  356.                 <td class="table_data">┬º 102(e) Date: </td>
  357.                 <!-- ***** application number ***** -->
  358.                 <td class="table_data"><b><xsl:value-of select="$B864-year"/>-<xsl:value-of select="$B864-month"/>-<xsl:value-of select="$B864-date"/></b></td>
  359.             </tr>
  360.             </xsl:if>
  361.         
  362.             <xsl:if test=".//B871">
  363.                 <xsl:variable name="B871-year" select="substring(.//B871/DOC/DATE/PDAT,1,4)"/>
  364.                 <xsl:variable name="B871-month" select="substring(.//B871/DOC/DATE/PDAT,5,2)"/>
  365.                 <xsl:variable name="B871-date" select="substring(.//B871/DOC/DATE/PDAT,7,2)"/>
  366.             
  367.             <tr><td class="table_data">(87)</td>
  368.                 <td class="table_data">PCT Pub. No.:</td>
  369.                 <td class="table_data"><b><xsl:value-of select=".//B871/DOC/DNUM/PDAT"/></b></td>
  370.             </tr>
  371.             
  372.             <tr><td/>
  373.                 <td class="table_data">PCT Pub. Date:</td>
  374.                 <td class="table_data"><b><xsl:value-of select="$B871-year"/>-<xsl:value-of select="$B871-month"/>-<xsl:value-of select="$B871-date"/></b></td>
  375.             </tr>
  376.             </xsl:if>
  377.             
  378.             <xsl:if test=".//B300">
  379.                 <xsl:variable name="B300-year" select="substring(.//B320/DATE/PDAT,1,4)"/>
  380.                 <xsl:variable name="B300-month" select="substring(.//B320/DATE/PDAT,5,2)"/>
  381.                 <xsl:variable name="B300-date" select="substring(.//B320/DATE/PDAT,7,2)"/>
  382.             
  383.                 <tr><td class="table_data">(30)</td>
  384.                     <td class="table_data" colspan="3"><b>Foreign Application Priority Data</b></td>
  385.                     <td/>
  386.                 </tr>
  387.                 <tr><td/>
  388.                     <td class="table_data"><xsl:value-of select="$B300-year"/>-<xsl:value-of select="$B300-month"/>-<xsl:value-of select="$B300-date"/>┬á┬á┬á(<xsl:value-of select=".//B330/CTRY/PDAT"/>)</td>
  389.                     <td class="table_data"><xsl:value-of select=".//B310/DNUM/PDAT"/></td>
  390.                 </tr>
  391.             </xsl:if>
  392.             
  393.             
  394.             <!-- ***** Test for Continuity Data ***** -->
  395.         <xsl:for-each select="B600/child::*">
  396.             <tr><td/><td/><td class="table_data" colspan="3"><b>Related U.S. Application Data</b></td></tr>
  397.             <tr>
  398.             <xsl:choose>
  399.                 <xsl:when test="../B610"><td/>                              <td class="table_data"><xsl:text>Addition to </xsl:text>  <xsl:call-template name="continuity"/></td></xsl:when>
  400.                 <xsl:when test="../B620"><td class="table_data">(62)</td> <td class="table_data" colspan="4"><xsl:text>Division of </xsl:text> <xsl:call-template name="continuity"/></td></xsl:when>
  401.                 <xsl:when test="../B631"><td class="table_data">(63)</td> <td class="table_data" colspan="4"><xsl:text>Continuation of </xsl:text> <xsl:call-template name="continuity"/></td></xsl:when>
  402.                 <xsl:when test="../B632"><td class="table_data">(63)</td> <td class="table_data" colspan="4"><xsl:text>Continuation in part of </xsl:text> <xsl:call-template name="continuity"/></td></xsl:when>
  403.                 <xsl:when test="../B633"><td class="table_data">(63)</td> <td class="table_data" colspan="4"><xsl:text>Continuing reissue of </xsl:text> <xsl:call-template name="continuity"/></td></xsl:when>
  404.                 <xsl:when test="../B640"><td class="table_data">(64)</td> <td class="table_data" colspan="4"><xsl:text>Reissue of </xsl:text> <xsl:call-template name="continuity"/></td></xsl:when>
  405.                 <xsl:when test="../B641US"><td/>                          <td class="table_data" colspan="4"><xsl:text>Divisional reissue of </xsl:text> <xsl:call-template name="continuity"/></td></xsl:when>
  406.                 <xsl:when test="../B645"><td/>                              <td class="table_data" colspan="4"><xsl:text>Reexamination of </xsl:text> <xsl:call-template name="continuity"/></td></xsl:when>
  407.                 <xsl:when test="../B645US"><td/>                          <td class="table_data" colspan="4"><xsl:text>Reissue of reexamination of </xsl:text> <xsl:call-template name="continuity"/></td></xsl:when>
  408.                 <xsl:when test="../B660"><td class="table_data">(66)</td> <td class="table_data" colspan="4"><xsl:text>Substitution for </xsl:text> <xsl:call-template name="continuity"/></td></xsl:when>
  409.                 <xsl:when test="../B680US"><td/>                          <td class="table_data" colspan="4"><xsl:text>Non-provisional of provisional </xsl:text> <xsl:call-template name="continuity"/></td></xsl:when>
  410.             </xsl:choose>        
  411.             </tr>
  412.         </xsl:for-each>
  413.             
  414.             <!-- Todo: table width="50%" border="0">
  415.                 <xsl:if test="//B300">
  416.                     <xsl:call-template name="foreign_data"/>    
  417.                 </xsl:if>
  418.             </table-->
  419.             <xsl:call-template name="tech_info"/>
  420.             <xsl:apply-templates select="appendix-data"/>
  421.             <tr><td class="table_data">(58)</td>
  422.                 <td class="table_data"><b>Field of Search </b></td>
  423.                 <td class="table_data">
  424.             <!-- ***** field of search ***** -->
  425.                 <xsl:value-of select=".//B580/*"/>
  426.                 <!-- ***** repeating USPCs ***** -->
  427.                     <xsl:for-each select="//B582[1]/following-sibling::*">,
  428.                         <xsl:value-of select="PDAT"/>
  429.                     </xsl:for-each>
  430.                 </td>
  431.             </tr>
  432.         </table>
  433.     <xsl:call-template name="citations"/>
  434.     </xsl:template>
  435.  
  436.     <xsl:template name="continuity">
  437.            <xsl:param name="continuity-year">
  438.             <xsl:value-of select="substring(.//DATE/PDAT,1,4)"/>
  439.         </xsl:param>
  440.         <xsl:param name="continuity-month">
  441.             <xsl:value-of select="substring(.//DATE/PDAT,5,2)"/>
  442.         </xsl:param>
  443.         <xsl:param name="continuity-day">
  444.             <xsl:value-of select="substring(.//DATE/PDAT,7,2)"/>
  445.         </xsl:param>
  446.         <xsl:value-of select=".//PDOC/DOC/DNUM/PDAT"/>
  447.         <xsl:text> filed on </xsl:text>
  448.         <xsl:value-of select="$continuity-year"/>-<xsl:value-of select="$continuity-month"/>-<xsl:value-of select="$continuity-day"/>
  449.         <!--xsl:value-of select=".//DATE/PDAT" /-->
  450.     </xsl:template>
  451.  
  452.     <xsl:template name="citations" match="B560">
  453.         <br/><br/>
  454.         <table width="70%" cellpadding="0" cellspacing="0" border="0">     
  455.         <colgroup>
  456.             <col width="10%"/>    <!-- (56) -->
  457.             <col width="15%"/>    <!-- number -->
  458.             <col width="5%"/>     <!-- cited-by-examiner -->
  459.             <col width="20%"/>    <!-- date -->            
  460.             <col width="30%"/>    <!-- name / country -->
  461.             <col width="20%"/>    <!-- PNC -->
  462.         </colgroup>
  463.         <!-- ***** test for cited patent documents ***** -->
  464.         <xsl:if test="//B560">
  465.             <tr><td class="table_data">(56)</td>
  466.                 <td class="table_data" colspan="4" align="center"><b>References Cited</b></td>
  467.                 <td/><td/><td/><td/>
  468.             </tr>
  469.             <tr/>
  470.             <tr><td/>
  471.                 <td class="table_data" colspan="4" align="center">U.S. PATENT DOCUMENTS </td>
  472.                 <td/><td/><td/><td/>
  473.             </tr>
  474.             <!-- ***** no container element for US patent docs; test existence of PARTY-US ***** -->
  475.             <xsl:for-each select=".//PARTY-US/ancestor::B561">
  476.                 <xsl:variable name="citation-year">
  477.                     <xsl:value-of select="substring(.//PCIT/DOC/DATE,1,4)"/>
  478.                 </xsl:variable>
  479.                 <xsl:variable name="citation-month">
  480.                     <xsl:value-of select="substring(.//PCIT/DOC/DATE,5,2)"/>
  481.                 </xsl:variable>
  482.                 <tr><td/>
  483.                 <xsl:choose>
  484.                     <xsl:when test="substring($doc_kind,1,1)='P'">
  485.                         <td class="table_data">
  486.                              <xsl:choose>
  487.                                  <xsl:when test="substring(.//PCIT/DOC/DNUM,1,4)='P.P.'">
  488.                                     <xsl:value-of select="substring(.//PCIT/DOC/DNUM,1,4)"/><xsl:value-of select="format-number(substring-after(.//PCIT/DOC/DNUM,'P.P.'), '##,###,###')"/>
  489.                                 </xsl:when>
  490.                                 <xsl:otherwise>
  491.                                     <xsl:value-of select=".//PCIT/DOC/DNUM"/>
  492.                                 </xsl:otherwise>
  493.                              </xsl:choose>
  494.                         </td>
  495.                      </xsl:when>
  496.                      <xsl:when test="substring($doc_kind,1,1)='S'">
  497.                      <td class="table_data">
  498.                              <xsl:choose>
  499.                                  <xsl:when test="substring(.//PCIT/DOC/DNUM,1,2)='D.'">
  500.                                     <xsl:value-of select="substring(.//PCIT/DOC/DNUM,1,2)"/><xsl:value-of select="format-number(substring-after(.//PCIT/DOC/DNUM,'D.'), '##,###,###')"/>
  501.                                 </xsl:when>
  502.                                 <xsl:otherwise>
  503.                                     <xsl:value-of select=".//PCIT/DOC/DNUM"/>
  504.                                 </xsl:otherwise>
  505.                              </xsl:choose>
  506.                          </td>
  507.                      </xsl:when>
  508.                      <xsl:otherwise>
  509.                          <td class="table_data">
  510.                              <xsl:choose>
  511.                                  <!-- *** test for alphabetic characters in DNUM ("Re.", "D", etc.) *** -->
  512.                                  <!-- *** if none, format-number *** -->
  513.                                  <xsl:when test="contains(.//PCIT/DOC/DNUM,'R')">
  514.                                     <xsl:value-of select=".//PCIT/DOC/DNUM"/>
  515.                                 </xsl:when>
  516.                                 <xsl:when test="contains(.//PCIT/DOC/DNUM,'D')">
  517.                                     <xsl:value-of select=".//PCIT/DOC/DNUM"/>
  518.                                 </xsl:when>
  519.                                 <xsl:when test="contains(.//PCIT/DOC/DNUM,'P')">
  520.                                     <xsl:value-of select=".//PCIT/DOC/DNUM"/>
  521.                                 </xsl:when>
  522.                                 <xsl:otherwise>
  523.                                     <xsl:value-of select="format-number(.//PCIT/DOC/DNUM, '##,###,###')"/>
  524.                                 </xsl:otherwise>
  525.                             </xsl:choose>
  526.                         </td>
  527.                      </xsl:otherwise>
  528.                 </xsl:choose>
  529.                 <xsl:choose>
  530.                     <xsl:when test=".//CITED-BY-EXAMINER">
  531.                         <td class="table_data" align="center">*</td>
  532.                     </xsl:when>
  533.                     <xsl:otherwise><td/></xsl:otherwise>
  534.                   </xsl:choose>
  535.                     <td class="table_data"><xsl:value-of select="format-number($citation-month,'##')"/>/<xsl:value-of select="$citation-year"/></td>
  536.  
  537.                     <td class="table_data"><xsl:value-of select=".//PCIT/PARTY-US/NAM/SNM"/></td>
  538.                     <td class="table_data" align="right"><xsl:value-of select=".//PCIT/PNC"/></td>
  539.                 </tr>                    
  540.             </xsl:for-each>
  541.         </xsl:if>
  542.             <!-- ***** no container element for foreign documents; test existence of CTRY ***** -->
  543.             <xsl:if test=".//B561/descendant::CTRY">    
  544.                 <tr><td>┬á</td></tr>            
  545.                 <tr><td/>
  546.                     <td class="table_data" colspan="4" align="center">FOREIGN PATENT DOCUMENTS </td>
  547.                     <td/>
  548.                     <td/>
  549.                     <td/>
  550.                 </tr>
  551.                 <xsl:for-each select=".//CTRY/ancestor::B561">
  552.  
  553.                 <xsl:variable name="fcitation-year">
  554.                     <xsl:value-of select="substring(.//PCIT/DOC/DATE,1,4)"/>
  555.                 </xsl:variable>
  556.                 <xsl:variable name="fcitation-month">
  557.                     <xsl:value-of select="substring(.//PCIT/DOC/DATE,5,2)"/>
  558.                 </xsl:variable>
  559.  
  560.                         <xsl:variable name="citation-year">
  561.                             <xsl:value-of select="substring(.//PCIT/DOC/DATE,1,4)"/>
  562.                         </xsl:variable>
  563.                         <xsl:variable name="citation-month">
  564.                             <xsl:value-of select="substring(.//PCIT/DOC/DATE,5,2)"/>
  565.                         </xsl:variable>
  566.                         <xsl:variable name="citation-day">
  567.                             <xsl:value-of select="substring(.//PCIT/DOC/DATE,7,2)"/>
  568.                         </xsl:variable>
  569.  
  570.                         <tr><td/>
  571.                         <td class="table_data"><xsl:value-of select=".//PCIT/DOC/DNUM"/></td>
  572.                   <xsl:choose>
  573.                         <xsl:when test=".//CITED-BY-EXAMINER">
  574.                             <td class="table_data" align="center">*</td>
  575.                         </xsl:when>
  576.                         <xsl:otherwise><td/></xsl:otherwise>
  577.                   </xsl:choose>
  578.                         <!--td class="table_data"--><!--xsl:value-of select=".//PCIT/DOC/DATE" /--><!--/td-->
  579.                         <td class="table_data"><xsl:value-of select="format-number($fcitation-month,'##')"/>/<xsl:value-of select="$fcitation-year"/></td>
  580.                         <td class="table_data">(<xsl:value-of select=".//PCIT/DOC/CTRY"/>)</td>
  581.                         <td class="table_data" align="right"><xsl:value-of select=".//PCIT/PNC"/></td>
  582.                     </tr>                    
  583.                 </xsl:for-each>
  584.             </xsl:if>
  585.  
  586.             <!-- ***** test for OTHER PUBLICATIONS (B562) ***** -->
  587.             <xsl:if test="//B562">
  588.                 <tr><td>┬á</td></tr>
  589.                 <tr><td/>
  590.                     <td class="table_data" align="center" colspan="4">OTHER PUBLICATIONS</td>
  591.                 </tr>
  592.                 <xsl:for-each select="//B562">
  593.                     <tr><td class="table_data" colspan="6">
  594.                         <xsl:apply-templates/>
  595.                     </td></tr>
  596.                 </xsl:for-each>
  597.                 <tr><td>┬á</td></tr>
  598.             </xsl:if>
  599.  
  600.             <xsl:if test=".//CITED-BY-EXAMINER">
  601.                 <tr><td colspan="3" class="table_data">* cited by examiner</td></tr>
  602.             </xsl:if>
  603.         <!-- ***** primary examiner ***** -->
  604.             <tr><td class="table_data" colspan="5"><i>Primary Examiner</i>
  605.                 <xsl:text> </xsl:text>
  606.                 ΓÇö
  607.                 <xsl:value-of select=".//B746/PARTY-US/NAM/FNM"/>
  608.                 <xsl:text> </xsl:text>
  609.                 <xsl:value-of select=".//B746/PARTY-US/NAM/SNM"/>
  610.                 </td>
  611.             </tr>
  612.         <!-- ***** test for assistant examiner(s) ***** -->
  613.             <xsl:if test="//B747">
  614.             <!-- ***** assistant examiner(s) ***** -->
  615.             <tr><td class="table_data" colspan="6"><i>Assistant Examiner<xsl:if test="count(//B747) > 1">s</xsl:if></i>
  616.                 <xsl:text> </xsl:text>
  617.                 ΓÇö
  618.                     <xsl:value-of select=".//B747/PARTY-US/NAM/FNM"/>
  619.                     <xsl:text> </xsl:text>
  620.                     <xsl:value-of select=".//B747/PARTY-US/NAM/SNM"/>
  621.             
  622.                 <!-- ***** add commas after each SNM except final ***** -->
  623.                     <xsl:for-each select="//B747[1]/following-sibling::B747">, 
  624.                         <xsl:value-of select="PARTY-US/NAM/FNM"/>
  625.                         <xsl:text> </xsl:text>
  626.                         <xsl:value-of select="PARTY-US/NAM/SNM"/>
  627.                     </xsl:for-each>
  628.                 </td>
  629.             </tr>
  630.             </xsl:if>
  631.             <!-- ***** attorney or agent ***** -->
  632.             <xsl:if test="//B740">
  633.             <tr><td class="table_data" colspan="6">(74)
  634.                 ┬á┬á┬á<i>Attorney, Agent, or Firm</i>
  635.                 <xsl:text> </xsl:text>
  636.                 ΓÇö
  637.                 <xsl:text> </xsl:text>
  638.                 <!-- ***** B741+ ***** -->
  639.                 <xsl:value-of select=".//B741/PARTY-US/NAM"/>
  640.                 <!-- ***** additional agents (B741) ***** -->
  641.                 <xsl:for-each select="//B741[2]/descendant::PARTY-US">;
  642.                     <xsl:apply-templates select="NAM"/>
  643.                 </xsl:for-each>
  644.                 </td>
  645.             </tr>
  646.             </xsl:if>
  647.         </table>
  648.     </xsl:template>
  649.  
  650.     <xsl:template name="foreign_data" match="B300">
  651.         <tr>
  652.             <td class="table_data" width="9%">(30)</td>
  653.             <td class="table_data" colspan="3" align="center"><b>Foreign Application Priority Data</b></td>
  654.         </tr>
  655.         <tr><td/>
  656.             <!-- ***** foreign priority data, filing date ***** -->
  657.             <td class="table_data"><xsl:value-of select="B300/B320"/></td>
  658.             <!-- ***** foreign priority data, country code ***** -->
  659.             <td class="table_data"><xsl:value-of select="B300/B330"/></td>
  660.             <!-- ***** foreign priority data, priority application number ***** -->
  661.             <td class="table_data" align="right"><xsl:value-of select=".//B310/DNUM"/></td>
  662.         </tr>
  663.     </xsl:template>
  664.     
  665.     <xsl:template name="tech_info" match="B500">
  666.     <!-- ***** technical information ***** -->
  667.         <tr><td class="table_data">(51)</td>
  668.         <xsl:choose>
  669.             <xsl:when test="substring($doc_kind,1,1)='S'">
  670.                 <td class="table_data" width="15%"><b>LOC (7) Cl.: </b></td>
  671.             </xsl:when>
  672.             <xsl:otherwise>    
  673.                 <td class="table_data" width="15%"><b>Int. Cl.:<font size="1" style="vertical-align: super">7</font></b></td>
  674.             </xsl:otherwise>            
  675.         </xsl:choose>    
  676.                 <xsl:call-template name="ST32classifications_ipc"/>
  677.         </tr>
  678.         <tr><td class="table_data">(52)</td>
  679.             <td class="table_data"><b>U.S. Cl.:</b></td>
  680.                 <xsl:call-template name="ST32classifications_us"/>
  681.         </tr>
  682.     </xsl:template>
  683.     
  684.     <xsl:template name="ST32classifications_ipc" match="B510">
  685.             <td class="table_data">
  686.             <!-- ***** classification-ipc-primary  ***** -->
  687.             <b><xsl:value-of select=".//B511/*"/></b>
  688.             <!-- ***** classification-ipc-secondary ***** -->
  689.             <xsl:for-each select="descendant::B512">;            
  690.                 <xsl:value-of select="."/>                
  691.             </xsl:for-each>
  692.             </td>
  693.             <xsl:text> </xsl:text>
  694.             <!-- ***** IPC edition ***** -->
  695.             <td class="table_data"><xsl:value-of select="./B516"/></td>
  696.     </xsl:template>
  697.     
  698.     <xsl:template name="ST32classifications_us" match="B520">
  699.     
  700.             <td class="table_data">
  701.             <!-- ***** classification-us-primary ***** -->
  702.                 <b><xsl:value-of select=".//B521/*"/></b>
  703.             <!-- ***** classification-us-secondary, allow multiples ***** -->
  704.                 <xsl:for-each select=".//B520[1]/B522">;
  705.                     <xsl:value-of select="PDAT"/>
  706.                 </xsl:for-each>
  707.             </td>
  708.     </xsl:template>
  709.  
  710.  
  711. <!-- ********************************************************* -->
  712. <!--   SUBDOC ABSTRACT                                            -->
  713. <!-- ********************************************************* -->
  714.  
  715.     <xsl:template match="SDOAB">
  716.         <br/>
  717.         <div class="break_before">
  718.             <xsl:choose>
  719.             <!-- ***** If no H, add heading, text "Abstract" ***** -->
  720.                 <xsl:when test="not(.//H)">
  721.                     <table width="90%" border="0">
  722.                     <tr><td width="9%" class="table_data">(57)</td>
  723.                         <td><h3>Abstract</h3></td>
  724.                     </tr>
  725.                     </table>
  726.                 </xsl:when>
  727.                 <xsl:otherwise>
  728.                     <xsl:apply-templates mode="abstract_heading" select=".//H"/>
  729.                 </xsl:otherwise>
  730.             </xsl:choose>
  731.             <xsl:apply-templates mode="abstract_para" select=".//PARA"/>
  732.         </div>
  733.         <xsl:apply-templates mode="drawing-section" select="//SDODR"/>
  734.     </xsl:template>
  735.     
  736.     <xsl:template mode="abstract_heading" match="H">
  737.         <h3 align="center">
  738.             <xsl:apply-templates mode="abstract_para"/>
  739.         </h3>
  740.     </xsl:template>
  741.     
  742.     <xsl:template mode="abstract_para" match="PARA">
  743.           <div class="left_para">
  744.             <table border="0" width="100%">
  745.                 <tr>
  746.                     <td width="8%" valign="top">
  747.                         <div class="para_text"/>
  748.                     </td>
  749.                     <td width="85%">
  750.                         <div class="para_text">
  751.                             ┬á┬á┬á                
  752.                         <xsl:apply-templates/>
  753.                         </div>
  754.                     </td>
  755.                     <td/>
  756.                     </tr>
  757.                 </table>
  758.         </div>
  759.     </xsl:template>
  760.  
  761.  
  762. <!-- ********************************************************** -->
  763. <!--     SUBDOC DESCRIPTION                                         -->
  764. <!-- ********************************************************** -->
  765.     
  766. <xsl:template match="SDODE">
  767.     <div class="smalltitle" style="page-break-before: always;">
  768.     <!-- ***** title of invention ***** -->
  769.         <xsl:value-of select="//B540/*"/>
  770.     </div>
  771.          <xsl:apply-templates/>
  772. </xsl:template>
  773.     
  774. <!-- ********************************************************** -->
  775. <!--     SUBDOC CLAIMS                                            -->
  776. <!-- ********************************************************** -->
  777.     <xsl:template match="SDOCL">
  778.         <xsl:if test="not(.//H)">
  779.         <!-- ***** if no H, add heading, text "Claim" ***** -->
  780.             <table width="90%" border="0">
  781.                 <tr><td width="9%" class="table_data">(57)</td>
  782.                     <td><h3>Claim</h3></td>
  783.                 </tr>
  784.             </table>
  785.         </xsl:if>
  786.     <xsl:apply-templates/>
  787.     </xsl:template>
  788.  
  789.     <xsl:template match="CLM">
  790.         <table border="0" width="90%" cellpadding="0" cellspacing="0">
  791.             <tr>
  792.                 <td width="10%"/>
  793.                 <td width="80%" valign="top" class="para_text">
  794.                     ┬á┬á┬á
  795.                     <xsl:apply-templates select=".//PTEXT" mode="claimtext"/>                    
  796.                 </td>
  797.                 <td width="*"/>
  798.             </tr>
  799.         </table>
  800.         <br/><br/>
  801.      </xsl:template>
  802.  
  803.     <xsl:template match="PTEXT" mode="claimtext">
  804.         <xsl:choose>
  805.         <!-- ***** if parent element is CLMSTEP, indent ***** -->
  806.             <xsl:when test="./parent::CLMSTEP">
  807.                 <div class="claim_text">
  808.                     <xsl:apply-templates/>
  809.                 </div>
  810.             </xsl:when>
  811.             <xsl:otherwise>        
  812.                 <xsl:apply-templates/>
  813.             </xsl:otherwise>
  814.         </xsl:choose>
  815.     </xsl:template>
  816.     
  817.  
  818. <!-- ********************************************************* -->
  819. <!--   SUBDOC DRAWINGS (called by SDOAB)                       -->
  820. <!-- ********************************************************* -->
  821.  
  822.     <!-- ***** if there's no SDOAB, manually trigger drawings ***** -->
  823.     <!--xsl:template match="SDODR">
  824.         <xsl:if test="not(//SDOAB)">
  825.             <xsl:apply-templates select=".//EMI"/>
  826.         </xsl:if>
  827.     </xsl:template-->
  828.     
  829.         <xsl:template match="SDODR">
  830.            <a name="DRAWINGS"/>
  831.         <xsl:choose>
  832.         <!-- **** show 1st image only in Utility documents **** -->
  833.             <xsl:when test="substring($doc_kind,1,1)='S'">
  834.                 <!-- ** hides 1st image [0000] if theres an abstract -->
  835.                 <!--xsl:if test=".//SDOAB"-->
  836.                      <div class="break_before">
  837.                         [<xsl:value-of select="substring-after(EMI/@ID,'-')"/>]
  838.                         <embed toolbar="off" fit="best" align="top" width="600" height="800" src="{EMI[1]/@FILE}"/>
  839.                     </div>
  840.                  <!--/xsl:if-->
  841.                 <!-- **** show following images in thumbnail size **** -->
  842.                 <xsl:for-each select="EMI[1]/following-sibling::EMI">
  843.                     <div>
  844.                         [<xsl:value-of select="substring-after(@ID,'-')"/>]
  845.                         <embed toolbar="off" fit="best" align="top" width="300" height="400" src="{@FILE}"/>
  846.                     </div>
  847.                 </xsl:for-each>
  848.              </xsl:when>
  849.             <xsl:when test="substring($doc_kind,1,1)='P'">
  850.                 <!-- 1st image should be shown by abstract -->
  851.                 <xsl:if test=".//SDOAB">
  852.                      <div class="break_before">
  853.                         [<xsl:value-of select="substring-after(EMI/@ID,'-')"/>]
  854.                         <embed toolbar="off" fit="best" align="top" width="600" height="800" src="{EMI[1]/@FILE}"/>
  855.                     </div>
  856.                 </xsl:if>
  857.                 <!-- **** show following images in thumbnail size **** -->
  858.                 <xsl:for-each select="EMI[1]/following-sibling::EMI">
  859.                     <div>
  860.                         [<xsl:value-of select="substring-after(@ID,'-')"/>]
  861.                         <embed toolbar="off" fit="best" align="top" width="300" height="400" src="{@FILE}"/>
  862.                     </div>
  863.                 </xsl:for-each>
  864.              </xsl:when>
  865.              <xsl:otherwise>
  866.                 <!-- **** show first image; click link to see others **** -->
  867.                 <!--div class="break_before" >
  868.                     [<xsl:value-of select="substring-after(EMI[1]/@ID,'-')"/>]
  869.                     <embed toolbar="off" fit="best" align="top" width="600" height="800" src="{EMI[1]/@FILE}"/>
  870.                 </div-->
  871.              </xsl:otherwise>
  872.          </xsl:choose>
  873.     </xsl:template>
  874.     
  875.     <!-- **** show only the first image in the document browser window *** -->
  876.     <!-- **** subsequent images are shown in new window upon clicking cross-reference hyperlink **** -->
  877.     <xsl:template match="SDODR/EMI[1] | EMR">
  878.         <div class="break_before">
  879.         [<xsl:value-of select="substring-after(@ID,'-')"/>]
  880.         <embed toolbar="off" fit="best" align="top" width="600" height="800" src="{@FILE}"/>
  881.         </div>
  882.     </xsl:template>
  883.     
  884.     <xsl:template match="EMI[not(ancestor::SDODR)]">
  885.         <div class="break_before">
  886.         [<xsl:value-of select="substring-after(@ID,'-')"/>]
  887.         <embed toolbar="off" fit="best" align="top" width="600" height="800" src="{@FILE}"/>
  888.         </div>
  889.     </xsl:template>
  890.  
  891.  
  892.     <xsl:template mode="drawing-section" match="*">
  893.     <!-- creates an anchor named 'DRAWINGS' after the abstract -->
  894.         <a name="DRAWINGS"/>
  895.          <xsl:apply-templates/>
  896.     </xsl:template>
  897.  
  898. <!-- ********************************************************** -->
  899. <!--     COMMON ELEMENTS (in roughly alphabetical order            -->
  900. <!-- ********************************************************** -->
  901.     <xsl:template match="ADR">
  902.         <xsl:text> </xsl:text>
  903.         <xsl:value-of select="STR"/>,
  904.         <xsl:text> </xsl:text>
  905.         <xsl:value-of select="OMC"/>
  906.         <xsl:text> </xsl:text>
  907.         <xsl:value-of select="CITY"/>,
  908.         <xsl:text> </xsl:text>
  909.         <xsl:value-of select="STATE"/>
  910.         <xsl:text> </xsl:text>
  911.         <xsl:if test="CTRY">
  912.             (<xsl:value-of select="CTRY"/>)
  913.         </xsl:if>
  914.         <xsl:text> </xsl:text>
  915.     </xsl:template>
  916.     
  917.     <xsl:template match="FGREF">
  918.         <xsl:choose>
  919.                <xsl:when test="substring($doc_kind,1,1)='S'">
  920.                  <a href="#{@ID}"><xsl:value-of select="."/></a>
  921.              </xsl:when>
  922.                <xsl:when test="substring($doc_kind,1,1)='P'">
  923.                  <a href="#{@ID}"><xsl:value-of select="."/></a>
  924.              </xsl:when>
  925.              <xsl:otherwise>
  926.                 <a href="javascript:loadNewDoc(this);">
  927.                    <xsl:apply-templates/>
  928.                  </a>
  929.              </xsl:otherwise>
  930.          </xsl:choose>
  931.      </xsl:template>
  932.     
  933.     <xsl:template match="HIL/BOLD/PDAT | FGREF/PDAT | BOLD">
  934.         <b>    <xsl:apply-templates/> </b>
  935.     </xsl:template>
  936.     
  937.     <xsl:template match="H">
  938.         <h3><xsl:apply-templates/></h3>
  939.     </xsl:template>
  940.     
  941.     <xsl:template match="HIL">
  942.         <xsl:apply-templates/>
  943.         <xsl:text> </xsl:text>
  944.     </xsl:template>
  945.  
  946.     <xsl:template match="ITALIC">
  947.         <i>    <xsl:apply-templates/>    </i>
  948.     </xsl:template>
  949.     
  950.     <xsl:template match="NAM">
  951.         <xsl:apply-templates/>
  952.     </xsl:template>
  953.     
  954.     <!-- ***** components of NAM ***** -->
  955.     <xsl:template match="ONM | SFX | TTL | FNM | SNM">
  956.             <xsl:text> </xsl:text>
  957.             <xsl:apply-templates/>
  958.     </xsl:template>
  959.  
  960.     <xsl:template match="PARA">
  961.         <div class="left_para">
  962.         <table border="0" width="100%">
  963.             <tr>
  964.                 <td width="8%" valign="top" class="para_text">
  965.                     <xsl:text> </xsl:text>
  966.                 </td>
  967.         <!-- ***** test LVL attribute, indent as required ***** -->
  968.             <xsl:choose>
  969.                 <xsl:when test="@LVL='0'">
  970.                     <td width="85%" class="para_text">
  971.                     ┬á┬á┬á                
  972.                         <xsl:apply-templates/>
  973.                     </td>
  974.                 </xsl:when>
  975.                 <xsl:when test="@LVL='1'"><!-- ***** left-align, no indent ***** -->
  976.                     <td width="85%" class="para_text">
  977.                         <xsl:apply-templates/>
  978.                     </td>
  979.                 </xsl:when>
  980.                 <xsl:when test="@LVL='3'">
  981.                     <td width="5%"/>
  982.                     <td width="*" class="para_text">
  983.                         <xsl:apply-templates/>
  984.                     </td>
  985.                 </xsl:when>
  986.                 <xsl:otherwise><!-- ***** other value or no value at all ***** -->
  987.                     <td width="85%" class="para_text">
  988.                     ┬á┬á┬á                
  989.                         <xsl:apply-templates/>
  990.                     </td>
  991.                 </xsl:otherwise>
  992.             </xsl:choose>            
  993.                 <td width="*"/>
  994.             </tr>
  995.         </table>
  996.         </div>
  997.      </xsl:template>
  998.  
  999.     <xsl:template match="PTEXT | STEXT | PDAT">
  1000.         <xsl:apply-templates/>
  1001.     </xsl:template>
  1002.  
  1003.     <xsl:template match="ULINE | DULINE">
  1004.         <u>    <xsl:apply-templates/>    </u>
  1005.     </xsl:template>
  1006.     
  1007.  
  1008.     <xsl:template match="SMALLCAPS">
  1009.         <span class="smallcaps">
  1010.             <xsl:apply-templates/>
  1011.         </span>
  1012.     </xsl:template>
  1013.  
  1014.     <!-- ***** hide MathML elements ***** -->
  1015.     <xsl:template match="//MATH/*"/>
  1016.  
  1017. <!-- **** include Grant components **** -->
  1018. <xsl:template match="SEQLST-US">
  1019.         <div style="page-break_before-inside: avoid; "> 
  1020.             [<xsl:value-of select="@ID"/>]
  1021.             <xsl:apply-templates/>
  1022.         </div>
  1023.     </xsl:template><xsl:template match="SEQLST-OLD | SEQLST-NEW">
  1024.         <xsl:apply-templates/>
  1025.     </xsl:template><xsl:template match="*">
  1026.         <xsl:apply-templates/>
  1027.     </xsl:template><xsl:template match="S-1 | S100">
  1028.         <div>
  1029.             <xsl:apply-templates/>
  1030.         </div>
  1031.     </xsl:template><xsl:template match="S-1-III | S160">
  1032.         <xsl:text>Number of Sequences: </xsl:text>
  1033.             <xsl:value-of select="."/>
  1034.     </xsl:template><xsl:template match="S-2 | S210">
  1035.         <xsl:text>Sequence ID: </xsl:text>
  1036.         <xsl:choose>
  1037.             <xsl:when test="self::S-2">
  1038.                 <xsl:value-of select="@SEQ-NO"/>
  1039.                 <xsl:apply-templates/>
  1040.             </xsl:when>
  1041.             <xsl:when test="self::S210">
  1042.                 <xsl:value-of select="."/>
  1043.             </xsl:when>
  1044.         </xsl:choose>
  1045.     </xsl:template><xsl:template match="S-2-I-A | S211">
  1046.         <br/>
  1047.         <xsl:text>Length of Sequence: </xsl:text>
  1048.         <xsl:value-of select="."/>
  1049.     </xsl:template><xsl:template match="S-2-I-B | S212">
  1050.         <br/>        
  1051.         <xsl:text>Sequence Type: </xsl:text>
  1052.         <xsl:value-of select="."/>
  1053.     </xsl:template><xsl:template match="S-2-I-C">
  1054.         <br/>
  1055.         <xsl:text>Strandedness: </xsl:text>        
  1056.         <xsl:apply-templates/>
  1057.     </xsl:template><xsl:template match="S-2-I-D">
  1058.         <br/>
  1059.         <xsl:text>Topology: </xsl:text>
  1060.         <xsl:apply-templates/>
  1061.     </xsl:template><xsl:template match="S-2-II-MT">
  1062.         <br/>
  1063.         <xsl:text>Molecule Type: </xsl:text>
  1064.         <xsl:apply-templates/>
  1065.     </xsl:template><xsl:template match="S-2-VI-A | S213">
  1066.         <br/>
  1067.         <xsl:text>Scientific Name: </xsl:text>
  1068.         <xsl:value-of select="."/>
  1069.     </xsl:template><xsl:template match="S-2-IX-A | S221">
  1070.         <br/>
  1071.         <xsl:text>Name/Key: </xsl:text>
  1072.             <xsl:apply-templates/>
  1073.     </xsl:template><xsl:template match="S-2-IX-B | S222">
  1074.         <br/>
  1075.         <xsl:text>Location: </xsl:text>
  1076.             <xsl:apply-templates/>
  1077.     </xsl:template><xsl:template match="S-2-IX-D | S223">
  1078.         <br/>
  1079.         <xsl:text>Other Information: </xsl:text>
  1080.             <xsl:apply-templates/>
  1081.     </xsl:template><xsl:template match="S-2-XI | S400">
  1082.     <pre style="font-size: 10pt;">
  1083.             <xsl:value-of select="."/>
  1084.     </pre>
  1085.     </xsl:template>
  1086. <xsl:template match="TABLE-US">
  1087.         <div style="page-break_before-inside: avoid; "> 
  1088.             [<xsl:value-of select="@ID"/>]
  1089.             <xsl:apply-templates select=".//TABLE"/>
  1090.         </div>
  1091.     </xsl:template><xsl:template match="TABLE">
  1092.             <span class="table_head">
  1093. <!-- *** todo: get proper heading *** -->
  1094.                 <xsl:value-of select="./HEADING | ./TITLE"/>
  1095.             </span>
  1096.  
  1097.         <table width="100%" cellpadding="0" cellspacing="0" border="0">
  1098.             <tr><td>
  1099.                 <xsl:apply-templates select="TGROUP"/>
  1100.             </td></tr>
  1101.         </table>
  1102.     </xsl:template><xsl:template match="TGROUP">
  1103.     <!-- *************************************************** -->
  1104.     <!--  nesting tables: HTML 4.0, section 11.2.3:          -->
  1105.     <!-- "The THEAD, TFOOT, and TBODY sections must contain  -->
  1106.     <!--  the same number of columns.                        -->    
  1107.     <!-- *************************************************** -->
  1108.  
  1109.     <table cellpadding="5" cellspacing="0">
  1110.         <xsl:attribute name="rules">
  1111.             <xsl:value-of select="ancestor-or-self::TABLE[1]/@FRAME"/>
  1112.         </xsl:attribute>
  1113.         
  1114.         <!-- this will hide the box around a table -->
  1115.         <!--xsl:if test="ancestor::table[1]/@frame='none'">
  1116.             <xsl:attribute name="border">0</xsl:attribute>
  1117.         </xsl:if-->
  1118.  
  1119.         <colgroup>
  1120.             <xsl:apply-templates select="COLSPEC"/>
  1121.         </colgroup>
  1122.         <thead>
  1123.             <xsl:apply-templates select="THEAD"/>
  1124.         </thead>
  1125.             <xsl:apply-templates select="TBODY"/>
  1126.     </table>
  1127.     </xsl:template><xsl:template match="TBODY">
  1128.         <tbody valign="{@VALIGN}">
  1129.             <xsl:apply-templates/>
  1130.         </tbody>
  1131.     </xsl:template><xsl:template match="THEAD">
  1132.         <xsl:apply-templates/>
  1133.     </xsl:template><xsl:template match="COLSPEC">
  1134.             <xsl:for-each select="descendant-or-self::COLSPEC">    
  1135.                 <col width="{@COLWIDTH}" align="{@ALIGN}"/>
  1136.                     <xsl:apply-templates/>
  1137.             </xsl:for-each>
  1138.     </xsl:template><xsl:template match="ROW">
  1139.         <tr>
  1140.             <xsl:apply-templates select="ENTRY"/>
  1141.         </tr>
  1142.     </xsl:template><xsl:template match="ENTRY">
  1143.     <xsl:param name="rowname" select="@SPANNAME"/>
  1144.         <td class="table_data">
  1145.             <xsl:if test="@ALIGN">
  1146.                 <xsl:attribute name="ALIGN">
  1147.                     <xsl:value-of select="@ALIGN"/>
  1148.                 </xsl:attribute>
  1149.             </xsl:if>
  1150.               <xsl:choose>
  1151.                 <xsl:when test="@SPANNAME">
  1152.                     <xsl:attribute name="colspan">
  1153.                         <!-- get values from script, below -->
  1154.                         <xsl:value-of select="../../../SPANSPEC[@SPANNAME=$rowname]/@NAMEEND"/>
  1155.                     </xsl:attribute>
  1156.                 </xsl:when>
  1157.                 <xsl:when test="@NAMEEND">
  1158.                     <xsl:attribute name="colspan">
  1159.                         <xsl:value-of select="@NAMEEND"/>
  1160.                     </xsl:attribute>
  1161.                 </xsl:when>
  1162.             </xsl:choose>
  1163.         <!-- ***** insert   between <td> and </td> if no content (preserves width) ***** -->
  1164.                 <xsl:if test="not(child::*)">
  1165.                   ┬á
  1166.                 </xsl:if>
  1167.                 <xsl:apply-templates/>
  1168.             </td>
  1169.         </xsl:template><xsl:template match="text()">
  1170.             <xsl:value-of select="."/>
  1171.         </xsl:template>
  1172. <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." xmlns:doc="urn:schemas-uspto-gov:document">
  1173. <style type="text/css">
  1174.             a     {text-decoration: none;color:blue;}
  1175.             
  1176.             a:visited {color: blue; }
  1177.             
  1178.             
  1179.             .bar {font-family: Code 39;
  1180.                   font-size: 16pt;}
  1181.  
  1182.             .break_avoid {page-break-inside: avoid;}
  1183.             
  1184.             .break_before {page-break-before: always;}
  1185.             
  1186.             .break_before_after {page-break-before: always;
  1187.                                  page-break-after: always;}
  1188.  
  1189.             .claim_text {margin-left: +30pt;
  1190.                          font-size: 10pt;
  1191.                              line-height: 200%;}
  1192.  
  1193.             .grant_claim_text {margin-left: +60pt;
  1194.                                    line-height: 200%;}
  1195.  
  1196.             .head {    font-size: 12pt;
  1197.                     font-weight: bold;
  1198.                       margin-top: 2em;
  1199.                       margin-bottom: 2em;}
  1200.                       
  1201.             heading {margin-top: 3px;
  1202.                      margin-bottom: 3px;
  1203.                      text-transform: uppercase;}
  1204.                      
  1205.  
  1206.              h3         {margin-top: 3px;
  1207.                      margin-bottom: 3px;
  1208.                      font-weight: normal;
  1209.                      text-align: center;
  1210.                      text-transform: uppercase;}
  1211.  
  1212.                      
  1213.                       
  1214.             .headinfo_large {font-size: 12pt;}
  1215.                              
  1216.             .headinfo_reg   {font-size: 10pt;
  1217.                              font-weight: bold;}
  1218.  
  1219.  
  1220.             .left_para {margin-top: 8px;
  1221.                         margin-bottom: 8px;
  1222.                         margin-left: -30pt;}
  1223.                         
  1224.                         
  1225.             .list_item {list-style-type: none;
  1226.                          display: list-item;
  1227.                          margin-left: +30pt;
  1228.                            line-height: 200%;}
  1229.                            
  1230.             .mono       {line-height: 200%;
  1231.                         font-family: monospace;}
  1232.  
  1233.             paragraph {font-size: 10pt;
  1234.                        line-height: 200%;}
  1235.             
  1236.             .para_text {line-height: 200%;
  1237.                         font-size: 10pt;
  1238.                         margin-top: 8px;
  1239.                         margin-bottom: 8px;}
  1240.  
  1241.             .smallcaps     {text-transform: uppercase;
  1242.                          font-size: 9pt; }            
  1243.             
  1244.             .smalltitle {display: block;
  1245.                     text-align: center;
  1246.                     text-transform: uppercase;
  1247.                     font-size:16pt;
  1248.                     font-weight:bold;
  1249.                     margin-top:3mm;
  1250.                     margin-bottom: 3mm;}
  1251.  
  1252.             .table_head {font-size: 12pt;
  1253.                          font-weight: bold; 
  1254.                          margin-top: 2em; 
  1255.                          margin-bottom: 2em;}
  1256.  
  1257.             .table_data {font-size: 10pt;
  1258.                        vertical-align: top;}
  1259.  
  1260.             .text  {line-height: 200%;
  1261.                     font-size: 10pt;}
  1262.                     
  1263.             .title {display: block;
  1264.                     text-align: center;
  1265.                     font-size:26pt;
  1266.                     font-family:serif;
  1267.                     font-weight:bold;
  1268.                     margin-top:3mm;
  1269.                     margin-bottom: 3mm;}
  1270.  
  1271. </style>
  1272. </xsl:template>
  1273.  
  1274.  
  1275. </xsl:stylesheet>