[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?

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)
n squared
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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.