11.2 New Theorems

<..boundaries on theorems..>
 <script element="div::newtheorem" >
   <set name="newtheorem" >
      <.open xslt script.>
      <.annotate bounderies of theorems.>
      <.tags for empty templates.>
      <.close xslt script.>
   </set>
   <xslt name="." xml="." xsl="newtheorem" />
 </script>
-_-_-

<..annotate bounderies of theorems..>
 <xsl:template match="
     div[   (@class=’newtheorem’)
          and
            child::*[1] / child::span[ @class = ’theorem-head’ ]
     ]
 " >
    <xsl:copy>
      <xsl:apply-templates select="*|@*|text()|comment()" />
      <div class="begin-end" title="speech-extra">
         <xsl:value-of select="
            concat( ’ end ’,
                    string( child::*[1] /
                            child::span[ @class = ’theorem-head’ ] )
            ) " />
      </div>
    </xsl:copy>
 </xsl:template>
-_-_-