Passing arguments

Discussion in 'XML' started by Mark Constant, Nov 11, 2003.

  1. 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?
    Mark Constant, Nov 11, 2003
    #1
    1. Advertising

  2. > 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
    Dimitre Novatchev, Nov 12, 2003
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Edward Diener
    Replies:
    14
    Views:
    4,929
    Josiah Carlson
    Apr 6, 2004
  2. Neo
    Replies:
    10
    Views:
    655
    sushant
    Jan 20, 2005
  3. tutmann
    Replies:
    4
    Views:
    434
  4. jmborr
    Replies:
    1
    Views:
    407
    Stargaming
    Nov 3, 2007
  5. oldyork90
    Replies:
    10
    Views:
    342
    Jorge
    Sep 27, 2008
Loading...

Share This Page