4.5 Undo Empty Scripts

<..undo empty scripts..>
 <script element="span::msup" >
    <set name="m-sub-sup" >
      <.open xslt script.>
      <.undo if empty su.>
      <.close xslt script.>
    </set>
    <xslt name="." xml="." xsl="m-sub-sup" />
    <.superscript 2 and 3 into verbose.>
 </script>
 <script element="span::msub" >
   <.sub sup script.>
 </script>
 <script element="span::msubsup" >
   <.subsup prime.>
   <.sub sup script.>
   <.sub superscript 2 and 3 into verbose.>
 </script>
-_-_-

<..sub sup script..>
 <set name="m-sub-sup" >
   <.open xslt script.>
   <.undo if empty su.>
   <.close xslt script.>
 </set>
 <xslt name="." xml="." xsl="m-sub-sup" />
-_-_-

<..undo if empty su..>
 <xsl:template match="span[
     ((@class = ’msup’) or (@class = ’msub’)
                        or (@class = ’msubsup’))
   and
     not(
       child::span[ (@class = ’mrow-sub’) ]
         / child::span[ (@class != ’begin-script’)
                        and
                        (@class != ’end-script’)
                        and
                        (@class != ’mid-script’)
                      ]
     )
   and
     not(
       child::span[ (@class = ’mrow-super’) ]
         / child::span[ (@class != ’begin-script’)
                        and
                        (@class != ’end-script’)
                        and
                        (@class != ’mid-script’)
                      ]
     )
 ]" >
    <xsl:apply-templates select="child::span[
                           @class = ’mrow-base’ ]/*" />
 </xsl:template>
-_-_-
<span class="msup">  
   <span class="mrow-base">  
     .........  
   </span>  
   <span class="mrow-super">  
     <span class="begin-script"> superscript </span>  
     <span class="end-script"> baseline </span>  
   </span>  
</span>