Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   XML (http://www.velocityreviews.com/forums/f32-xml.html)
-   -   xslt too many variables in select.. (http://www.velocityreviews.com/forums/t167971-xslt-too-many-variables-in-select.html)

michiel hermsen 10-08-2004 09:28 AM

xslt too many variables in select..
 
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>


All times are GMT. The time now is 03:12 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.