xslt too many variables in select..

Discussion in 'XML' started by michiel hermsen, Oct 8, 2004.

  1. I've got this piece of code which selects the right 'PubObjects' from my
    xml-file, given the variables the user has selected. But because there
    are more than 200 PubObjects, it's not very fast because the variables
    get checked for every PubObject.

    I want only the variables checked that the user selected to be checked.
    If they are not the variables are zero. But because I can't put an if
    statement inside the apply-templates tags, I don't know what to do. Can
    anyone help? (I hope I made the problem clear)

    This is the piece of xsl:

    <xsl:apply-templates select="PubObject[(subject=$subject or
    $subject='all')
    and
    (
    ($klas1=targetGroup/group or $klas2=targetGroup/group
    or $klas3=targetGroup/group or $klas4=targetGroup/group
    or $klas5=targetGroup/group or $klas6=targetGroup/group)

    or
    ($vmbobb=targetGroup/school or $vmbokg=targetGroup/school
    or $vmbot=targetGroup/school or $havo=targetGroup/school
    or $vwo=targetGroup/school or $basisschool=targetGroup/school)

    or ($vmbobb1=targetGroup or $vmbobb2=targetGroup
    or $vmbobb3=targetGroup or $vmbobb4=targetGroup
    or $vmbokg1=targetGroup or $vmbokg2=targetGroup
    or $vmbokg3=targetGroup or $vmbokg4=targetGroup
    or $vmbot1=targetGroup or $vmbot2=targetGroup
    or $vmbot3=targetGroup or $vmbot4=targetGroup
    or $havo1=targetGroup or $havo2=targetGroup
    or $havo3=targetGroup or $havo4=targetGroup
    or $havo5=targetGroup or $vwo1=targetGroup
    or $vwo2=targetGroup or $vwo3=targetGroup
    or $vwo4=targetGroup or $vwo5=targetGroup
    or $vwo6=targetGroup)
    )
    and (number &gt;= $vanaf and number &lt;= $tot)
    and (language/version &gt; 1)]">

    <xsl:sort order="{$order}"
    select="language[lang($language)]/title"/>
    </xsl:apply-templates>
     
    michiel hermsen, Oct 8, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. peelman

    How many threads is too many?

    peelman, Jan 13, 2005, in forum: Java
    Replies:
    12
    Views:
    879
    Esmond Pitt
    Jan 15, 2005
  2. Rhino
    Replies:
    33
    Views:
    1,357
    Oliver Wong
    Dec 22, 2005
  3. rbt
    Replies:
    1
    Views:
    383
  4. How many roles is too many?

    , Jun 13, 2006, in forum: ASP .Net Security
    Replies:
    4
    Views:
    217
    Joe Kaplan \(MVP - ADSI\)
    Jun 18, 2006
  5. Dag Sunde
    Replies:
    4
    Views:
    381
Loading...

Share This Page