Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6939481
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T12:37:40+00:00 2026-05-27T12:37:40+00:00

As I have mentioned in this post: dynamic multiple filters in xsl Basically, I

  • 0

As I have mentioned in this post:
dynamic multiple filters in xsl
Basically, I want to apply multiple filters to my xml using “for loop” and these filters are dynamic which are coming from some other xml

sth like this:

foreach(list/field[@ProgramCategory=$Country][not(contain(@Program,$State1][not(contain(@Program,$State2][not(contain(@Program,$State3][not(contain(@Program,$Staten])

The problem is that I can get n no. of states which I am getting through for loop of other xml.

I cannot use document() function as suggested by Dimitre so I was thinking of achieving it by:

 <xsl:variable name="allprograms">
    <xsl:for-each select="/list2/field2">

            <xsl:text disable-output-escaping="yes">[not(contains(@Program,'</xsl:text><xsl:value-of select="@ProgramID"></xsl:value-of><xsl:text disable-output-escaping="yes">'))]</xsl:text>
                                                            </xsl:for-each>
</xsl:variable> 

gives me something like this:

[not(contains(@Program,'Virginia'))][not(contains(@Program,'Texas'))][not(contains(@Program,'Florida'))]

I want to use this above value as a filter in the for loop below and I am not sure how to achieve that

<xsl:for-each="list/field[not(contains(@Program,'Virginia'))][not(contains(@Program,'Texas'))][not(contains(@Program,'Florida'))]">

Before this I also have a for loop to filter United States

xsl:for-each="list/field $allprograms">
   <xsl:value-of select="@ows_ID" />
</xsl:for-each>

I want my answer to be 1082, 1088..

I can add the xml here too if there is any confusion..

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T12:37:41+00:00Added an answer on May 27, 2026 at 12:37 pm

    Jack,

    From the previous solution you just need to add to this:

     <xsl:param name="pFilteredStates"> 
      <state>Virginia</state> 
      <state>Texas</state> 
      <state>Florida</state> 
     </xsl:param> 
    

    the following (changing the current variable definition that relies on the document() function):

    <xsl:variable name="vFiltered" select= 
      "ext:node-set($pFilteredStates)/* 
      "/> 
    

    Where the "ext:" prefix needs to be bound to this namespace (this is the EXSLT namespace — if your XSLT processor doesn’t implement exslt:node-set() then you need to find what xxx:node-set() extension it implements, or tell us what is your XSLT processor and people will provide this information):

    "http://exslt.org/common"
    

    So, your <xsl:stylesheet> may look like the following:

    <xsl:stylesheet version="1.0"
     xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
     xmlns:ext="http://exslt.org/common" exclude-result-prefixes="ext">
    

    I still recommend that the $pFilteredStates parameter should be passed by the initiator of the transformation — in which case you can delete the definition of $vFiltered and replace every reference to it with $pFilteredStates` and the transformation should work OK.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

UPDATE: I should have mentioned in the original post that I want to learn
I have seen this mentioned a few times and I am not clear on
When I asked this previously I should have mentioned that it's particularly a light-weight
On a related post I mentioned that I have found custom HTML helpers to
Ok, I have search for about 3 hours and have decided to post this.
I want to post something in the users friends wall. I use this to
In C#, as mentioned in the Documentation , and this nice post 's accepted
This is a continuation from this post I have a set of random sized
I have a web-service which I secured using certificates. Now, I want to identify
With help of this post and this tutorial I have managed to integrate Facebook

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.