Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Node-set variable and Contains function

From: gilly3 <news@------------.--->
To: NULL
Date: 11/5/2004 5:38:00 PM
I want to filter my results to only return nodes that contain any one of a 
set of strings.  I pass in a parameter that contains a node-set and then 
filter like this:

<xsl:foreach select="myNode
    [
        contains(.,msxml:node-set($SearchString)//searchParam[1])
        or contains(.,msxml:node-set($SearchString)//searchParam[2])
        or contains(.,msxml:node-set($SearchString)//searchParam[3])
        or contains(.,msxml:node-set($SearchString)//searchParam[4])
        or contains(.,msxml:node-set($SearchString)//searchParam[5])
        or contains(.,msxml:node-set($SearchString)//searchParam[6])
        or contains(.,msxml:node-set($SearchString)//searchParam[7])
        or contains(.,msxml:node-set($SearchString)//searchParam[8])
        or contains(.,msxml:node-set($SearchString)//searchParam[9])
        or contains(.,msxml:node-set($SearchString)//searchParam[10])
    ]">

I'd like to come up with a more elegant way of doing this.  Right now, I've 
hard-coded a limit of 10 searchParam's to search on.  I'd like to be able 
to search on a dynamic number of searchParam's, depending on the number of 
nodes in the parameter.  Is there a way to do this?

cheers

-ivan.


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent