Hi,
I'm making a xml file about different groups and there members.
I like to make a choice in a selectlist in an xsl file to get only the members from the group that I select.
The problem is that I can't get the link working between the form and the xsl.
I want to replace 'Animatie' (<xsl:when test="@dnaam = 'Animatie'">), witch is one of the group names, with a variable that changes everytime you select another group with the selectlist in the form that's on top of the xsl file.
The options in the selectlist are 'Animatie', 'Arbeidstrajectbegeleiding', 'Financiele Dienst' and 'Juridische Dienst' (they are dutch groupnames). So when you select one, the variable that has to come behind @dnaam = ........ has to change into the selected option.
XML file:
XSL file:
Thanks,
EJ
I'm making a xml file about different groups and there members.
I like to make a choice in a selectlist in an xsl file to get only the members from the group that I select.
The problem is that I can't get the link working between the form and the xsl.
I want to replace 'Animatie' (<xsl:when test="@dnaam = 'Animatie'">), witch is one of the group names, with a variable that changes everytime you select another group with the selectlist in the form that's on top of the xsl file.
The options in the selectlist are 'Animatie', 'Arbeidstrajectbegeleiding', 'Financiele Dienst' and 'Juridische Dienst' (they are dutch groupnames). So when you select one, the variable that has to come behind @dnaam = ........ has to change into the selected option.
XML file:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="opmaak.xsl"?>
<diensten>
<dienst dnaam="Animatie">
<lid>
<persnaam>Persoon 1</persnaam>
<functie>Funtie 1</functie>
<kort></kort>
<dect>521</dect>
</lid>
<lid>
<persnaam>Persoon 2</persnaam>
<functie>Functie 2</functie>
<kort></kort>
<dect>501</dect>
</lid>
<lid>
<persnaam>Persoon 3</persnaam>
<functie></functie>
<kort></kort>
<dect>521</dect>
</lid>
</dienst>
<dienst dnaam="Arbeidstrajectbegeleiding">
<lid>
<persnaam>Persoon 4</persnaam>
<functie></functie>
<kort></kort>
<dect>517</dect>
</lid>
<lid>
<persnaam>Persoon 5</persnaam>
<functie></functie>
<kort></kort>
<dect>517</dect>
</lid>
<lid>
<persnaam>Persoon 6</persnaam>
<functie></functie>
<kort></kort>
<dect>517</dect>
</lid>
</dienst>
<dienst dnaam="Financiele Dienst">
<lid>
<persnaam>Persoon 7</persnaam>
<functie>Functie 3</functie>
<kort>326</kort>
<dect></dect>
</lid>
<lid>
<persnaam>Persoon 8</persnaam>
<functie></functie>
<kort>325</kort>
<dect></dect>
</lid>
</dienst>
<dienst dnaam="Juridische Dienst">
<lid>
<persnaam>Persoon 9</persnaam>
<functie>Functie 4</functie>
<kort></kort>
<dect>516</dect>
</lid>
</dienst>
</diensten>
XSL file:
Code:
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="[URL unfurl="true"]http://www.w3.org/1999/XSL/Transform">[/URL]
<xsl:template match="/">
<html>
<head>
<title>Personeelsleden</title>
<script language="javascript">
<![CDATA[
function jump()
{
d = document;
dienstnaam=d.form1.dienstlijst.options[d.form1.dienstlijst.selectedIndex].value;
d.form1.waardeveld.value = dienstnaam;
}
]]>
</script>
</head>
<body>
<form name="form1">
Zoeken op dienst:
<select name="dienstlijst" onchange="jump()">
<option value="Animatie">Animatie</option>
<option value="Arbeidstrajectbegeleiding">Arbeidstrajectbegeleiding</option>
<option value="Financiele Dienst">Financiele Dienst</option>
<option value="Juridische Dienst">Juridische Dienst</option>
</select>
<input type="text" name="waardeveld" style="visibility:visible"/>
</form>
<h1>Personeelsleden</h1>
<table>
<tr>
<td id="titel">
Naam:
</td>
<td id="titel">
Functie:
</td>
<td id="titel">
Kort:
</td>
<td id="titel">
Dect:
</td>
</tr>
<xsl:for-each select="diensten/dienst">
<xsl:choose>
<xsl:when test="@dnaam = 'Animatie'">
<xsl:for-each select="lid">
<tr>
<td id="tabel2">
<xsl:value-of select="persnaam"/>
</td>
<td id="tabel">
<xsl:value-of select="functie"/>
</td>
<td id="tabel">
<xsl:value-of select="kort"/>
</td>
<td id="tabel">
<xsl:value-of select="dect"/>
</td>
</tr>
</xsl:for-each>
</xsl:when>
</xsl:choose>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
Thanks,
EJ