NTSGuru
Programmer
- Jul 25, 2000
- 52
I have an XML page, and an XSL page... I would like to reference the XML page from an HTML page, and using that link, pass a parameter to the XML page that will allow me to filter what the XML page shows. Here's what I have as my XSL (my XML page is well-formed):
<?xml version='1.0'?>
<xsl:stylesheet
xmlns:xsl=" xmlns=" result-ns="">
<xsl:template match="/">
<HTML>
<BODY>
<TABLE BORDER="2">
<TR><TD>Name</TD><TD>Gender</TD></TR>
<xsl:for-each select="NTS/person">
<TR>
<TD><xsl:value-of select="FirstName"/>
<xsl:value-of select="LastName"/></TD>
<TD><xsl:value-of select="Gender"/></TD>
</TR>
</xsl:for-each>
</TABLE>
</BODY>
</HTML>
</xsl:template>
</xsl:stylesheet>
I know how to use the <xsl:if match=".[Gender='Male']"> clause, but I would like to be able to have a Dynamic match possibility by referencing it this way from HTML:
<A HREF="mypage.xml?Gender=Male">Male</A>
Is this possible, or is there an easier way to do this?
TIA
Fred
<?xml version='1.0'?>
<xsl:stylesheet
xmlns:xsl=" xmlns=" result-ns="">
<xsl:template match="/">
<HTML>
<BODY>
<TABLE BORDER="2">
<TR><TD>Name</TD><TD>Gender</TD></TR>
<xsl:for-each select="NTS/person">
<TR>
<TD><xsl:value-of select="FirstName"/>
<xsl:value-of select="LastName"/></TD>
<TD><xsl:value-of select="Gender"/></TD>
</TR>
</xsl:for-each>
</TABLE>
</BODY>
</HTML>
</xsl:template>
</xsl:stylesheet>
I know how to use the <xsl:if match=".[Gender='Male']"> clause, but I would like to be able to have a Dynamic match possibility by referencing it this way from HTML:
<A HREF="mypage.xml?Gender=Male">Male</A>
Is this possible, or is there an easier way to do this?
TIA
Fred