Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > Passing arguments

Reply
Thread Tools

Passing arguments

 
 
Mark Constant
Guest
Posts: n/a
 
      11-11-2003
I have a xslt page that looks like this
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlnssl="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="lcescription"/></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?
 
Reply With Quote
 
 
 
 
Dimitre Novatchev
Guest
Posts: n/a
 
      11-12-2003
> 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





 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
functions and arguments.length; passing unknown number of arguments oldyork90 Javascript 10 09-27-2008 03:05 AM
how to pass a function name and its arguments inside the arguments of other function? jmborr Python 1 11-03-2007 08:20 AM
function default arguments from other arguments tutmann C++ 4 10-17-2006 08:00 PM
function call with arguments which takes no arguments Neo C Programming 10 01-20-2005 06:31 AM
Difference between default arguments and keyword arguments Edward Diener Python 14 04-05-2004 11:26 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57