Re: n squared behavior with XT for 'preceding' tests?

Subject: Re: n squared behavior with XT for 'preceding' tests?
From: David Carlisle <davidc@xxxxxxxxx>
Date: Thu, 22 Jul 1999 01:21:30 +0100 (BST)
I wisely wrote 

> (and not try doing it at 0015 in the morning)

I less wisely did:

=====================================================
<math>

<mrow>
<mi>a</mi><mi>b</mi><mi>c</mi><mn>1</mn>
<mi>x</mi><mi>y</mi><mi>z</mi><mn>2</mn>
</mrow>

</math>


=====================================================
<math>
<mrow>
<mi>abc</mi>
<mn>1</mn>
<mi>xyz</mi>
<mn>2</mn>
</mrow>
</math>
=====================================================

<xsl:stylesheet xmlns:xsl="http://www.w3.org/XSL/Transform/1.0";
                default-space="strip"
                indent-result="yes">

<xsl:template match="*" >
 <xsl:copy>
     <xsl:apply-templates/>
 </xsl:copy>
</xsl:template>


<xsl:template match="mi" >
 <xsl:if test="not(from-preceding-siblings(*[position()=1 and  from-self(mi)]))">
     <xsl:apply-templates mode="grab" select="."/>
 </xsl:if>
</xsl:template>

<xsl:template mode="grab" match="mi">
<xsl:param-variable name="x" expr="''"/>
<xsl:choose>
  <xsl:when test="from-following-siblings(*[position()=1 and from-self(mi)])">   
     <xsl:apply-templates mode="grab" select="from-following-siblings(*[1])">
       <xsl:param name="x" expr="concat($x,.)"/>
     </xsl:apply-templates>
   </xsl:when>
   <xsl:otherwise>
     <mi><xsl:value-of select="concat($x,.)"/></mi>
   </xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>




 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread