Passing arguments

M

Mark Constant

I have a xslt page that looks like this
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:lc="http://mark/DevelopmentWebsite">
<xsl:template match="/">
<h2>My Game Collection</h2>
<table border="1">
<xsl:for-each select="lc:Entertainment/lc:GameList">
<tr>
<th colspan="2"><xsl:value-of select="lc:Title"/></th>
</tr>
<tr>
<td>
<xsl:element name="IMG">
<xsl:attribute name="SRC">
<xsl:value-of select="lc:Image"/>
</xsl:attribute>
</xsl:element>
</td>
<td><xsl:value-of select="lc:Description"/></td>
</tr>
</xsl:for-each>
</table>
</xsl:template>
</xsl:stylesheet>

All I would have to do to get it to display all games that are in the
Horror genre is put

<xsl:for-each select="lc:Entertainment/lc:GameList[lc:Genre =
'Horror']">

instead of

<xsl:for-each select="lc:Entertainment/lc:GameList">

Now how could I get it so there is a drop down list on my page with a
list of different genres. If the person selects a certain genre it
passes the argument to the XSLT so it only displays the genre the user
picked? Can I even pass arguments to a XSLT page?
 
D

Dimitre Novatchev

Can I even pass arguments to a XSLT page?

An XSLT transformation can be passed an external parameter. How this is
accomplished depends on the particular vendor. For example in the case of
MSXML one can use the IXSLProcessor.addParameter() method.


=====
Cheers,

Dimitre Novatchev.
http://fxsl.sourceforge.net/ -- the home of FXSL
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top