|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: n squared behavior with XT for 'preceding' tests?
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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








