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

Subject: Re: n squared behavior with XT for 'preceding' tests?
From: "Sebastian Rahtz" <sebastian.rahtz@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 21 Jul 1999 23:40:59 +0100 (BST)
If I understand David Carlisle's code aright, he explicitly processes
the first <hd> element:

<xsl:template match="test">
  <xsl:apply-templates select="hd[1]"/>
</xsl:template>

and then processes the following identical ones:
      
      <xsl:apply-templates mode="later"
        select="from-following-siblings(hd[text()=$x])"/>

followed by the next non-identical one

       <xsl:apply-templates
         select="from-following-siblings(hd[not(text()=$x)][1])"/>

Two questions:

 1. why doesn't the the second stage
       (select="from-following-siblings(hd[text()=$x])"/>) 
    skip over the non-identical siblings? so if I have

      <hd>Foo</hd>
      <hd>Bar</hd>
      <hd>Foo</dd>
     
     doesn't the "Foo" one pick up the #3 "Foo" and then the #2 "Bar"?
     they are all "following-siblings", and the select isn't a _while
     test is true_, but a _select all that match_ test, no?
     
     or did the original spec say that the things were pre-sorted?
       
 2. I was reading this hoping I could use a similar technique to clean 
    up some MathML:

       <mi>A</mi><mi>v</mi>

    which I want as 
   
       <mi>Av</mi>

    but since this can occur in many places, I don't have the luxury
    of the top-level "go process the <x> elements". I could do
    "select the text of all the <mi> following-siblings" in the <mi>
    template, but then if I have

        <mi>A</mi><mi>v</mi><mo>x</mo><mi>A</mi><mi>v</mi>

    I run up againt the same problem, that "following <mi> siblings"
    will pick up ALL the <mi>s in this sequence, and not stop at the
    <mo>

Am I confusing myself, and you, dear reader? Can I simplify
<mi>A</mi><mi>v</mi> in straight XSL?

sebastian


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


Current Thread