Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > xslt too many variables in select..

Reply
Thread Tools

xslt too many variables in select..

 
 
michiel hermsen
Guest
Posts: n/a
 
      10-08-2004
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>
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how many hard drives is too many? mattcar Computer Support 6 06-29-2007 01:58 AM
How many warnings is too many? Rhino Java 33 12-22-2005 09:39 PM
How many threads are too many? rbt Python 1 06-11-2005 11:03 PM
How many threads is too many? peelman Java 12 01-15-2005 07:37 AM
Too many (small) vs. too large linked script files in a document... Dag Sunde Javascript 4 12-16-2004 11:38 PM



Advertisments