[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: search against index

Subject: RE: search against index
From: Américo Albuquerque <melinor@xxxxxxx>
Date: Fri, 8 Aug 2003 01:29:37 +0100
xsl search node
Hi

> -----Original Message-----
> From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx 
> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of 
> bry@xxxxxxxxxx
> Sent: Thursday, August 07, 2003 9:28 PM
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: Re:  search against index
> 
> 
> >       <xsl:when test="contains
> ($string,'+')">
> >         <xsl:call-template name="search">
> >           <xsl:with-param name="nodes"
> select="$nodes[contains(@value,normalize-
> space
> > (substring-before($string,'+')))]"/>
> >           <xsl:with-param name="string"
> select="normalize-space(substring-after
> > ($string,'+'))"/>
> >         </xsl:call-template>
> >       </xsl:when>
> 
> Thanks, but unfortunately what I was trying 
> to get at was the search has to accept
> 
> value + value + value.... and so on until 
> one runs out of + value.

The search accepts "value + value + value + ... + value" and it returns the
node that pass the criteria
Have you even try it? I've try it with msxml, xalan and saxon and it worked
wit hall of them.

It simply get the first value and passes the rest of the string and the
nodes that matches that value to it self util the string has no more '+',
that is when it apllys the last filter and copy what remains


> Hence the need to keep building and paring a 
> nodeset, the main problem with building 

You don't need to build them, just to select those that contains your
'value'

> multiple nodesets is I figured had to be a 
> better way, am thinking I might have found 
> one on the way home:
> 
> 
> step 1: split searchstring and build a 
> nodeset
> 
> step 2: for each node in searchstring 
> nodeset copy index node from document that 
> contains searchstring value in value 
> attribute. Add id attribute that consists of 
> the count of current index node.
> 
> Thus building a bigger rtf with the 
> possibility of the following:
> <list>
> <index value="another string here" id="2">
> ..
> </index>
> <index value="another string here" id="2">
> </index>
> <index value="a string" id="3">...
> </index>
> </list>
> 
> 
> step 3:
> the number of nodes in the searchstring 
> nodeset tells us how many index's have to be 
> returned with the same id, that is to say if 
> the original searchstring was string+another 
> then I end up with two searchstring nodes
> and thus from my big nodeset I should be 
> able to do something like
> <xsl:apply-templates select="gen:node-set
> ($bignodeset)/list/index[count(following-
> sibling::index[@id = $myid]) -1 = 
> $searchstringcount]"/>
> 
> Since I haven't tried this yet I'm not sure 
> which would give better results, i.e. this 
> or the earlier building node-sets all over 
> hell, can depend on the processor I suppose, 
> I'm currently in msxml which made me worry 
> as building a node-set is basically the same 
> as creating a new dom. But I'm thinking this 
> method is probably the quicker (only thing 
> that worries me of course is that my nodeset 
> of index items could conceivably grow very 
> big). If anyone has any suggestions on 
> improving that would be cool, in fact also 
> wondering if fxsl, and Dimitre's new exslt 
> implementation doesn't allow for improving 
> at least the last step of the way. 
> 
> Also Andrew's suggestion of generating the 
> xslt unfortunately can't be followed in this 
> instance. 
> 
> 
> 
> 
> 
> 
> 
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> 
> 


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


Current Thread
  • RE: search against index
    • Andrew Welch - Thu, 7 Aug 2003 10:56:08 -0400 (EDT)
      • <Possible follow-ups>
      • bry - Thu, 7 Aug 2003 14:28:39 -0400 (EDT)
        • Américo Albuquerque - Thu, 7 Aug 2003 20:32:42 -0400 (EDT) <=
          • bryan - Fri, 8 Aug 2003 04:29:29 -0400 (EDT)

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.