M
michiel hermsen
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 >= $vanaf and number <= $tot)
and (language/version > 1)]">
<xsl:sort order="{$order}"
select="language[lang($language)]/title"/>
</xsl:apply-templates>
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 >= $vanaf and number <= $tot)
and (language/version > 1)]">
<xsl:sort order="{$order}"
select="language[lang($language)]/title"/>
</xsl:apply-templates>