I am trying to filter the XML by what I get in a parameter. What is the correct sintax to match on only those courses that have dep_code equal to 'something' or in this case $department???
XML STRUCTURE IS
<course>
<dep_code></dep_code>
<catalog_number></catalog_number>
<course_group></course_group>
<term></term>
<offered></offered>
<course_type></course_type>
<course_level></course_level>
<title></title>
<course_number></course_number>
<meeting_text></meeting_text>
<faculty_text></faculty_text>
<description></description>
<prerequisites></prerequisites>
</course>
Parameter defined
<xsl:param name="department" select="'All'" />
Code I have tried I have tried this:
<xsl:template match="course/dep_code/{$department}">
Also this:
<xsl:template match="course/dep_code/$department">
<xsl:template match="course/dep_code eq $department">
I I keep on getting syntactical errors like the following:
- F [Saxon-PE 9.4.0.3] Unexpected token "{" in path expression
- F [Saxon-PE 9.4.0.3] A variable reference is not allowed in an XSLT pattern (except in a predicate)
Thanks in advance