Using the .addParameter() function

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Mark Constant

    #1

    Using the .addParameter() function

    I have a drop-down list now and I got it so when something is selected
    from the drop down list it calls a JavaScript function. I want it so
    the value selected from the drop-down list is sent as a parameter to
    the xslt file. When I select a value from the drop-down list nothing
    appears. I want just a basic listing of Title, Image, and Description
    outputed. I have done a basic JavaScript that uses the .write()
    function and that worked so the value is getting sent to the
    JavaScript function from the drop-down list. So the problem has to be
    with the .addParameter function. What could I be missing?

    Here is my javascript and drop-down menu.
    <body MS_POSITIONING= "FlowLayout ">
    <form id="Form1" method="post" runat="server">
    <SELECT name="select1" onchange='CallX ML(this.form.se lect1);'>
    <OPTION value="Ratchet and Clank">Ratchet and Clank</OPTION>
    <OPTION value="Sly Cooper">Sly Cooper</OPTION>
    </SELECT>
    </form>
    </body>




    <script language="javas cript">
    function CallXML(dropdow n)
    {
    var myindex = dropdown.select edIndex;
    var SelValue = dropdown.option s[myindex].value;
    xml = new ActiveXObject(" Msxml2.DOMDocum ent.4.0");
    xml.async = false;
    xml.load("Games .xml");
    xslt = new ActiveXObject(" Msxml2.FreeThre adedDOMDocument .4.0");
    xslt.async = false;
    xslt.load("Game s.xslt");
    xslTemp = new ActiveXObject(" Msxml2.XSLTempl ate.4.0");
    xslTemp.stylesh eet = xslt;
    var xslProc = xslTemp.createP rocessor();
    xslProc.input = xml;
    xslProc.addPara meter(Title, SelValue);
    xslProc.transfo rm;
    xslProc.output;
    }
    </script>

    Here is my xslt file.
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <xsl:styleshe et version="1.0"
    xmlns:xsl="http ://www.w3.org/1999/XSL/Transform"
    xmlns:lc="http://mark/DevelopmentWebs ite">
    <xsl:output method="html"/>
    <xsl:param name="Title"/>
    <xsl:template match="/">

    <h2>My Game Collection</h2>
    <table border="1">
    <xsl:for-each select="lc:Ente rtainment/lc:GameList[lc:Title =
    $Title]">
    <tr>
    <th colspan="2"><xs l:value-of select="lc:Titl e"/></th>
    </tr>
    <tr>
    <td>
    <xsl:element name="IMG">
    <xsl:attribut e name="SRC">
    <xsl:value-of select="lc:Imag e"/>
    </xsl:attribute>
    </xsl:element>
    </td>
    <td><xsl:valu e-of select="lc:Desc ription"/></td>
    </tr>
    </xsl:for-each>
    </table>

    </xsl:template>
    </xsl:stylesheet>
  • Dimitre Novatchev

    #2
    Re: Using the .addParameter() function

    I don't see how you use the result from the transformation. There must be
    some code that displays the result of the transformation -- e.g. assignment
    to the "innerHTML" property of some html objext.


    =====
    Cheers,

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



    "Mark Constant" <constants@mi x-net.net> wrote in message
    news:ce43fdea.0 311132156.5fb11 660@posting.goo gle.com...[color=blue]
    > I have a drop-down list now and I got it so when something is selected
    > from the drop down list it calls a JavaScript function. I want it so
    > the value selected from the drop-down list is sent as a parameter to
    > the xslt file. When I select a value from the drop-down list nothing
    > appears. I want just a basic listing of Title, Image, and Description
    > outputed. I have done a basic JavaScript that uses the .write()
    > function and that worked so the value is getting sent to the
    > JavaScript function from the drop-down list. So the problem has to be
    > with the .addParameter function. What could I be missing?
    >
    > Here is my javascript and drop-down menu.
    > <body MS_POSITIONING= "FlowLayout ">
    > <form id="Form1" method="post" runat="server">
    > <SELECT name="select1" onchange='CallX ML(this.form.se lect1);'>
    > <OPTION value="Ratchet and Clank">Ratchet and Clank</OPTION>
    > <OPTION value="Sly Cooper">Sly Cooper</OPTION>
    > </SELECT>
    > </form>
    > </body>
    >
    >
    >
    >
    > <script language="javas cript">
    > function CallXML(dropdow n)
    > {
    > var myindex = dropdown.select edIndex;
    > var SelValue = dropdown.option s[myindex].value;
    > xml = new ActiveXObject(" Msxml2.DOMDocum ent.4.0");
    > xml.async = false;
    > xml.load("Games .xml");
    > xslt = new ActiveXObject(" Msxml2.FreeThre adedDOMDocument .4.0");
    > xslt.async = false;
    > xslt.load("Game s.xslt");
    > xslTemp = new ActiveXObject(" Msxml2.XSLTempl ate.4.0");
    > xslTemp.stylesh eet = xslt;
    > var xslProc = xslTemp.createP rocessor();
    > xslProc.input = xml;
    > xslProc.addPara meter(Title, SelValue);
    > xslProc.transfo rm;
    > xslProc.output;
    > }
    > </script>
    >
    > Here is my xslt file.
    > <?xml version="1.0" encoding="ISO-8859-1"?>
    > <xsl:styleshe et version="1.0"
    > xmlns:xsl="http ://www.w3.org/1999/XSL/Transform"
    > xmlns:lc="http://mark/DevelopmentWebs ite">
    > <xsl:output method="html"/>
    > <xsl:param name="Title"/>
    > <xsl:template match="/">
    >
    > <h2>My Game Collection</h2>
    > <table border="1">
    > <xsl:for-each select="lc:Ente rtainment/lc:GameList[lc:Title =
    > $Title]">
    > <tr>
    > <th colspan="2"><xs l:value-of select="lc:Titl e"/></th>
    > </tr>
    > <tr>
    > <td>
    > <xsl:element name="IMG">
    > <xsl:attribut e name="SRC">
    > <xsl:value-of select="lc:Imag e"/>
    > </xsl:attribute>
    > </xsl:element>
    > </td>
    > <td><xsl:valu e-of select="lc:Desc ription"/></td>
    > </tr>
    > </xsl:for-each>
    > </table>
    >
    > </xsl:template>
    > </xsl:stylesheet>[/color]


    Comment

    • Mark Constant

      #3
      Re: Using the .addParameter() function

      "Dimitre Novatchev" <dnovatchev@yah oo.com> wrote in message news:<bp1s5u$1i cjgj$1@ID-152440.news.uni-berlin.de>...[color=blue]
      > I don't see how you use the result from the transformation. There must be
      > some code that displays the result of the transformation -- e.g. assignment
      > to the "innerHTML" property of some html objext.
      >
      >
      > =====
      > Cheers,
      >
      > Dimitre Novatchev.
      > http://fxsl.sourceforge.net/ -- the home of FXSL
      >
      >
      >
      > "Mark Constant" <constants@mi x-net.net> wrote in message
      > news:ce43fdea.0 311132156.5fb11 660@posting.goo gle.com...[color=green]
      > > I have a drop-down list now and I got it so when something is selected
      > > from the drop down list it calls a JavaScript function. I want it so
      > > the value selected from the drop-down list is sent as a parameter to
      > > the xslt file. When I select a value from the drop-down list nothing
      > > appears. I want just a basic listing of Title, Image, and Description
      > > outputed. I have done a basic JavaScript that uses the .write()
      > > function and that worked so the value is getting sent to the
      > > JavaScript function from the drop-down list. So the problem has to be
      > > with the .addParameter function. What could I be missing?
      > >
      > > Here is my javascript and drop-down menu.
      > > <body MS_POSITIONING= "FlowLayout ">
      > > <form id="Form1" method="post" runat="server">
      > > <SELECT name="select1" onchange='CallX ML(this.form.se lect1);'>
      > > <OPTION value="Ratchet and Clank">Ratchet and Clank</OPTION>
      > > <OPTION value="Sly Cooper">Sly Cooper</OPTION>
      > > </SELECT>
      > > </form>
      > > </body>
      > >
      > >
      > >
      > >
      > > <script language="javas cript">
      > > function CallXML(dropdow n)
      > > {
      > > var myindex = dropdown.select edIndex;
      > > var SelValue = dropdown.option s[myindex].value;
      > > xml = new ActiveXObject(" Msxml2.DOMDocum ent.4.0");
      > > xml.async = false;
      > > xml.load("Games .xml");
      > > xslt = new ActiveXObject(" Msxml2.FreeThre adedDOMDocument .4.0");
      > > xslt.async = false;
      > > xslt.load("Game s.xslt");
      > > xslTemp = new ActiveXObject(" Msxml2.XSLTempl ate.4.0");
      > > xslTemp.stylesh eet = xslt;
      > > var xslProc = xslTemp.createP rocessor();
      > > xslProc.input = xml;
      > > xslProc.addPara meter(Title, SelValue);
      > > xslProc.transfo rm;
      > > xslProc.output;
      > > }
      > > </script>
      > >
      > > Here is my xslt file.
      > > <?xml version="1.0" encoding="ISO-8859-1"?>
      > > <xsl:styleshe et version="1.0"
      > > xmlns:xsl="http ://www.w3.org/1999/XSL/Transform"
      > > xmlns:lc="http://mark/DevelopmentWebs ite">
      > > <xsl:output method="html"/>
      > > <xsl:param name="Title"/>
      > > <xsl:template match="/">
      > >
      > > <h2>My Game Collection</h2>
      > > <table border="1">
      > > <xsl:for-each select="lc:Ente rtainment/lc:GameList[lc:Title =
      > > $Title]">
      > > <tr>
      > > <th colspan="2"><xs l:value-of select="lc:Titl e"/></th>
      > > </tr>
      > > <tr>
      > > <td>
      > > <xsl:element name="IMG">
      > > <xsl:attribut e name="SRC">
      > > <xsl:value-of select="lc:Imag e"/>
      > > </xsl:attribute>
      > > </xsl:element>
      > > </td>
      > > <td><xsl:valu e-of select="lc:Desc ription"/></td>
      > > </tr>
      > > </xsl:for-each>
      > > </table>
      > >
      > > </xsl:template>
      > > </xsl:stylesheet>[/color][/color]

      Even if I change the line xslProc.output; to Title.innerHTML =
      xslProc.output nothing happens.

      Comment

      • Dimitre Novatchev

        #4
        Re: Using the .addParameter() function

        > Even if I change the line xslProc.output; to Title.innerHTML =[color=blue]
        > xslProc.output nothing happens.[/color]

        So, what is your complete example?

        I'd recommend that you have a look at the examples from the MSXML SDK and
        try them, like this one:

        <HTML>
        <HEAD>
        <TITLE>sample </TITLE>
        <SCRIPT language = "javascript ">
        function init()
        {
        var srcTree = new ActiveXObject(" Msxml2.DOMDocum ent.4.0");
        srcTree.async=f alse;
        srcTree.load("h ello.xml");

        var xsltTree= new ActiveXObject(" Msxml2.DOMDOCUM ENT.4.0");
        xsltTree.async = false;
        xsltTree.load(" hello.xsl");

        resTree.innerHT ML = srcTree.transfo rmNode(xsltTree );
        }
        </SCRIPT>
        </HEAD>

        <BODY onload = "init()" >
        <div id="resTree"></div>
        </BODY>

        </HTML>You can incrementally add your code step by step, until you get your
        application working.=====
        Cheers,

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




        Comment

        • Mark Constant

          #5
          Re: Using the .addParameter() function

          "Dimitre Novatchev" <dnovatchev@yah oo.com> wrote in message news:<bp4fpm$1k omnk$1@ID-152440.news.uni-berlin.de>...[color=blue][color=green]
          > > Even if I change the line xslProc.output; to Title.innerHTML =
          > > xslProc.output nothing happens.[/color]
          >
          > So, what is your complete example?
          >
          > I'd recommend that you have a look at the examples from the MSXML SDK and
          > try them, like this one:
          >
          > <HTML>
          > <HEAD>
          > <TITLE>sample </TITLE>
          > <SCRIPT language = "javascript ">
          > function init()
          > {
          > var srcTree = new ActiveXObject(" Msxml2.DOMDocum ent.4.0");
          > srcTree.async=f alse;
          > srcTree.load("h ello.xml");
          >
          > var xsltTree= new ActiveXObject(" Msxml2.DOMDOCUM ENT.4.0");
          > xsltTree.async = false;
          > xsltTree.load(" hello.xsl");
          >
          > resTree.innerHT ML = srcTree.transfo rmNode(xsltTree );
          > }
          > </SCRIPT>
          > </HEAD>
          >
          > <BODY onload = "init()" >
          > <div id="resTree"></div>
          > </BODY>
          >
          > </HTML>You can incrementally add your code step by step, until you get your
          > application working.=====
          > Cheers,
          >
          > Dimitre Novatchev.
          > http://fxsl.sourceforge.net/ -- the home of FXSL[/color]

          I tried what you gave for an example above and it worked fine. It is
          when I try to start using the .addParameter() function. All I am
          getting for an output now is the header from my .xslt page which is
          more then I was getting before. Basically what I want to be outputted
          for right now is everything I have for Sly Cooper from my xml file.

          Here is my Javascript function
          <script language="javas cript">
          function CallXML()
          {
          var xsltTree = new ActiveXObject(" Msxml2.FreeThre adedDOMDocument .4.0");
          xsltTree.async = false;
          xsltTree.load(" Games.xslt")

          var srcTree = new ActiveXObject(" Msxml2.DOMDocum ent.4.0");
          srcTree.async = false;
          srcTree.load("G ames.xml");

          var xsltThread = new ActiveXObject(" Msxml2.XSLTempl ate.4.0");
          xsltThread.styl esheet = xsltTree;
          var xsltProc = xsltThread.crea teProcessor();
          xsltProc.input = xsltTree;
          xsltProc.addPar ameter("Title", "Sly Cooper");

          resTree.innerHT ML = srcTree.transfo rmNode(xsltTree );
          }
          </script>

          Here is my Games.Xslt file
          <?xml version="1.0" encoding="ISO-8859-1"?>
          <xsl:styleshe et version="1.0"
          xmlns:xsl="http ://www.w3.org/1999/XSL/Transform"
          xmlns:lc="http://mark/DevelopmentWebs ite">
          <xsl:output method="html"/>
          <xsl:param name="Title"/>
          <xsl:template match="/">

          <h2>My Game Collection</h2>
          <table border="1">
          <xsl:for-each select="lc:Ente rtainment/lc:GameList[lc:Title =
          $Title]">
          <tr>
          <th colspan="2"><xs l:value-of select="lc:Titl e"/></th>
          </tr>
          <tr>
          <td>
          <xsl:element name="IMG">
          <xsl:attribut e name="SRC">
          <xsl:value-of select="lc:Imag e"/>
          </xsl:attribute>
          </xsl:element>
          </td>
          <td><xsl:valu e-of select="lc:Desc ription"/></td>
          </tr>
          </xsl:for-each>
          </table>

          </xsl:template>
          </xsl:stylesheet>

          and here is what I have in the Games.xml file for Sly Cooper to show
          you that I do have something in the xml file for Sly Cooper.
          <?xml version="1.0" encoding="utf-8" ?>
          <Entertainmen t xmlns="http://mark/DevelopmentWebs ite">
          <GameList>
          <ID>1</ID>
          <Console>PS2</Console>
          <Title>Sly Cooper</Title>
          <Description> A witty game that is fun for everybody</Description>
          <Image>images\S lyCooper.jpg</Image>
          </GameList>
          <GameList>
          <ID>2</ID>
          <Console>PS2</Console>
          <Title>Ratche t and Clank</Title>
          <Description>Fu n</Description>
          </GameList>
          </Entertainment>

          Comment

          • Dimitre Novatchev

            #6
            Re: Using the .addParameter() function

            This works perfectly for me -- I haven't changed your xslt code and probably
            the reason for the problem is in your html:

            1. Html

            <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

            <html>
            <head>
            <script language="javas cript">
            function CallXML()
            {
            var xsltTree = new ActiveXObject(" Msxml2.FreeThre adedDOMDocument .4.0");
            xsltTree.async = false;
            xsltTree.load(" Games.xslt")

            var srcTree = new ActiveXObject(" Msxml2.DOMDocum ent.4.0");
            srcTree.async = false;
            srcTree.load("G ames.xml");

            var xsltThread = new ActiveXObject(" Msxml2.XSLTempl ate.4.0");
            xsltThread.styl esheet = xsltTree;
            var xsltProc = xsltThread.crea teProcessor();
            xsltProc.input = xsltTree;
            xsltProc.addPar ameter("Title", "Sly Cooper");

            resTree.innerHT ML = srcTree.transfo rmNode(xsltTree );
            }
            </script>
            <title>Untitled </title>
            </head>

            <body onload="CallXML ()">
            <div id="resTree"></div>



            </body>
            </html>

            2. XSLT code (Games.xslt):

            <?xml version="1.0" encoding="ISO-8859-1"?>
            <xsl:styleshe et version="1.0"
            xmlns:xsl="http ://www.w3.org/1999/XSL/Transform"
            xmlns:lc="http://mark/DevelopmentWebs ite">

            <xsl:output method="html"/>
            <xsl:param name="Title" select="'Sly Cooper'"/>

            <xsl:template match="/">
            <h2>My Game Collection</h2>
            <table border="1">
            <xsl:for-each
            select="lc:Ente rtainment/lc:GameList
            [lc:Title = $Title]">
            <tr>
            <th colspan="2">
            <xsl:value-of select="lc:Titl e"/>
            </th>
            </tr>
            <tr>
            <td>
            <xsl:element name="IMG">
            <xsl:attribut e name="SRC">
            <xsl:value-of select="lc:Imag e"/>
            </xsl:attribute>
            </xsl:element>
            </td>
            <td>
            <xsl:value-of select="lc:Desc ription"/>
            </td>
            </tr>
            </xsl:for-each>
            </table>
            </xsl:template>
            </xsl:stylesheet>

            3. XML source (Games.xml):

            <?xml version="1.0" encoding="utf-8" ?>
            <Entertainmen t xmlns="http://mark/DevelopmentWebs ite">
            <GameList>
            <ID>1</ID>
            <Console>PS2</Console>
            <Title>Sly Cooper</Title>
            <Description> A witty game that is fun for everybody</Description>
            <Image>images\S lyCooper.jpg</Image>
            </GameList>
            <GameList>
            <ID>2</ID>
            <Console>PS2</Console>
            <Title>Ratche t and Clank</Title>
            <Description>Fu n</Description>
            </GameList>
            </Entertainment>

            The wanted result is produced and displayed nicely in IE6:

            <h2 xmlns:lc="http://mark/DevelopmentWebs ite">My Game Collection</h2>
            <table xmlns:lc="http://mark/DevelopmentWebs ite" border="1">
            <tr>
            <th colspan="2">Sly Cooper</th>
            </tr>
            <tr>
            <td><IMG SRC="images\Sly Cooper.jpg"></td>
            <td>A witty game that is fun for everybody</td>
            </tr>
            </table>


            =====
            Cheers,

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



            "Mark Constant" <constants@mi x-net.net> wrote in message
            news:ce43fdea.0 311152205.4ff5b 24b@posting.goo gle.com...[color=blue]
            > "Dimitre Novatchev" <dnovatchev@yah oo.com> wrote in message[/color]
            news:<bp4fpm$1k omnk$1@ID-152440.news.uni-berlin.de>...[color=blue][color=green][color=darkred]
            > > > Even if I change the line xslProc.output; to Title.innerHTML =
            > > > xslProc.output nothing happens.[/color]
            > >
            > > So, what is your complete example?
            > >
            > > I'd recommend that you have a look at the examples from the MSXML SDK[/color][/color]
            and[color=blue][color=green]
            > > try them, like this one:
            > >
            > > <HTML>
            > > <HEAD>
            > > <TITLE>sample </TITLE>
            > > <SCRIPT language = "javascript ">
            > > function init()
            > > {
            > > var srcTree = new ActiveXObject(" Msxml2.DOMDocum ent.4.0");
            > > srcTree.async=f alse;
            > > srcTree.load("h ello.xml");
            > >
            > > var xsltTree= new ActiveXObject(" Msxml2.DOMDOCUM ENT.4.0");
            > > xsltTree.async = false;
            > > xsltTree.load(" hello.xsl");
            > >
            > > resTree.innerHT ML = srcTree.transfo rmNode(xsltTree );
            > > }
            > > </SCRIPT>
            > > </HEAD>
            > >
            > > <BODY onload = "init()" >
            > > <div id="resTree"></div>
            > > </BODY>
            > >
            > > </HTML>You can incrementally add your code step by step, until you get[/color][/color]
            your[color=blue][color=green]
            > > application working.=====
            > > Cheers,
            > >
            > > Dimitre Novatchev.
            > > http://fxsl.sourceforge.net/ -- the home of FXSL[/color]
            >
            > I tried what you gave for an example above and it worked fine. It is
            > when I try to start using the .addParameter() function. All I am
            > getting for an output now is the header from my .xslt page which is
            > more then I was getting before. Basically what I want to be outputted
            > for right now is everything I have for Sly Cooper from my xml file.
            >
            > Here is my Javascript function
            > <script language="javas cript">
            > function CallXML()
            > {
            > var xsltTree = new ActiveXObject(" Msxml2.FreeThre adedDOMDocument .4.0");
            > xsltTree.async = false;
            > xsltTree.load(" Games.xslt")
            >
            > var srcTree = new ActiveXObject(" Msxml2.DOMDocum ent.4.0");
            > srcTree.async = false;
            > srcTree.load("G ames.xml");
            >
            > var xsltThread = new ActiveXObject(" Msxml2.XSLTempl ate.4.0");
            > xsltThread.styl esheet = xsltTree;
            > var xsltProc = xsltThread.crea teProcessor();
            > xsltProc.input = xsltTree;
            > xsltProc.addPar ameter("Title", "Sly Cooper");
            >
            > resTree.innerHT ML = srcTree.transfo rmNode(xsltTree );
            > }
            > </script>
            >
            > Here is my Games.Xslt file
            > <?xml version="1.0" encoding="ISO-8859-1"?>
            > <xsl:styleshe et version="1.0"
            > xmlns:xsl="http ://www.w3.org/1999/XSL/Transform"
            > xmlns:lc="http://mark/DevelopmentWebs ite">
            > <xsl:output method="html"/>
            > <xsl:param name="Title"/>
            > <xsl:template match="/">
            >
            > <h2>My Game Collection</h2>
            > <table border="1">
            > <xsl:for-each select="lc:Ente rtainment/lc:GameList[lc:Title =
            > $Title]">
            > <tr>
            > <th colspan="2"><xs l:value-of select="lc:Titl e"/></th>
            > </tr>
            > <tr>
            > <td>
            > <xsl:element name="IMG">
            > <xsl:attribut e name="SRC">
            > <xsl:value-of select="lc:Imag e"/>
            > </xsl:attribute>
            > </xsl:element>
            > </td>
            > <td><xsl:valu e-of select="lc:Desc ription"/></td>
            > </tr>
            > </xsl:for-each>
            > </table>
            >
            > </xsl:template>
            > </xsl:stylesheet>
            >
            > and here is what I have in the Games.xml file for Sly Cooper to show
            > you that I do have something in the xml file for Sly Cooper.
            > <?xml version="1.0" encoding="utf-8" ?>
            > <Entertainmen t xmlns="http://mark/DevelopmentWebs ite">
            > <GameList>
            > <ID>1</ID>
            > <Console>PS2</Console>
            > <Title>Sly Cooper</Title>
            > <Description> A witty game that is fun for everybody</Description>
            > <Image>images\S lyCooper.jpg</Image>
            > </GameList>
            > <GameList>
            > <ID>2</ID>
            > <Console>PS2</Console>
            > <Title>Ratche t and Clank</Title>
            > <Description>Fu n</Description>
            > </GameList>
            > </Entertainment>[/color]


            Comment

            • Dimitre Novatchev

              #7
              Re: Using the .addParameter() function

              Oooppss...

              The errors are in your script:
              [color=blue]
              > function CallXML()
              > {
              > var xsltTree = new ActiveXObject(" Msxml2.FreeThre adedDOMDocument .4.0");
              > xsltTree.async = false;
              > xsltTree.load(" Games.xslt")
              >
              > var srcTree = new ActiveXObject(" Msxml2.DOMDocum ent.4.0");
              > srcTree.async = false;
              > srcTree.load("G ames.xml");
              >
              > var xsltThread = new ActiveXObject(" Msxml2.XSLTempl ate.4.0");
              > xsltThread.styl esheet = xsltTree;
              > var xsltProc = xsltThread.crea teProcessor();
              > xsltProc.input = xsltTree;[/color]

              Must be:

              xsltProc.input = srcTree;

              [color=blue]
              > xsltProc.addPar ameter("Title", "Sly Cooper");
              >[/color]

              [color=blue]
              > resTree.innerHT ML = srcTree.transfo rmNode(xsltTree );[/color]

              Must be:

              xsltProc.transf orm();
              resTree.innerHT ML = xsltProc.output ;


              [color=blue]
              > }[/color]


              The complete correct function is:

              function CallXML()
              {
              var xsltTree = new ActiveXObject(" Msxml2.FreeThre adedDOMDocument .4.0");
              xsltTree.async = false;
              xsltTree.load(" Games.xslt")

              var srcTree = new ActiveXObject(" Msxml2.DOMDocum ent.4.0");
              srcTree.async = false;
              srcTree.load("G ames.xml");

              var xsltThread = new ActiveXObject(" Msxml2.XSLTempl ate.4.0");
              xsltThread.styl esheet = xsltTree;
              var xsltProc = xsltThread.crea teProcessor();
              xsltProc.input = srcTree;
              xsltProc.addPar ameter("Title", "Sly Cooper");

              xsltProc.transf orm();
              resTree.innerHT ML = xsltProc.output ;
              }


              =====
              Cheers,

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



              "Dimitre Novatchev" <dnovatchev@yah oo.com> wrote in message
              news:bp7ad3$1ku api$1@ID-152440.news.uni-berlin.de...[color=blue]
              > This works perfectly for me -- I haven't changed your xslt code and[/color]
              probably[color=blue]
              > the reason for the problem is in your html:
              >
              > 1. Html
              >
              > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
              >
              > <html>
              > <head>
              > <script language="javas cript">
              > function CallXML()
              > {
              > var xsltTree = new ActiveXObject(" Msxml2.FreeThre adedDOMDocument .4.0");
              > xsltTree.async = false;
              > xsltTree.load(" Games.xslt")
              >
              > var srcTree = new ActiveXObject(" Msxml2.DOMDocum ent.4.0");
              > srcTree.async = false;
              > srcTree.load("G ames.xml");
              >
              > var xsltThread = new ActiveXObject(" Msxml2.XSLTempl ate.4.0");
              > xsltThread.styl esheet = xsltTree;
              > var xsltProc = xsltThread.crea teProcessor();
              > xsltProc.input = xsltTree;
              > xsltProc.addPar ameter("Title", "Sly Cooper");
              >
              > resTree.innerHT ML = srcTree.transfo rmNode(xsltTree );
              > }
              > </script>
              > <title>Untitled </title>
              > </head>
              >
              > <body onload="CallXML ()">
              > <div id="resTree"></div>
              >
              >
              >
              > </body>
              > </html>
              >
              > 2. XSLT code (Games.xslt):
              >
              > <?xml version="1.0" encoding="ISO-8859-1"?>
              > <xsl:styleshe et version="1.0"
              > xmlns:xsl="http ://www.w3.org/1999/XSL/Transform"
              > xmlns:lc="http://mark/DevelopmentWebs ite">
              >
              > <xsl:output method="html"/>
              > <xsl:param name="Title" select="'Sly Cooper'"/>
              >
              > <xsl:template match="/">
              > <h2>My Game Collection</h2>
              > <table border="1">
              > <xsl:for-each
              > select="lc:Ente rtainment/lc:GameList
              > [lc:Title = $Title]">
              > <tr>
              > <th colspan="2">
              > <xsl:value-of select="lc:Titl e"/>
              > </th>
              > </tr>
              > <tr>
              > <td>
              > <xsl:element name="IMG">
              > <xsl:attribut e name="SRC">
              > <xsl:value-of select="lc:Imag e"/>
              > </xsl:attribute>
              > </xsl:element>
              > </td>
              > <td>
              > <xsl:value-of select="lc:Desc ription"/>
              > </td>
              > </tr>
              > </xsl:for-each>
              > </table>
              > </xsl:template>
              > </xsl:stylesheet>
              >
              > 3. XML source (Games.xml):
              >
              > <?xml version="1.0" encoding="utf-8" ?>
              > <Entertainmen t xmlns="http://mark/DevelopmentWebs ite">
              > <GameList>
              > <ID>1</ID>
              > <Console>PS2</Console>
              > <Title>Sly Cooper</Title>
              > <Description> A witty game that is fun for everybody</Description>
              > <Image>images\S lyCooper.jpg</Image>
              > </GameList>
              > <GameList>
              > <ID>2</ID>
              > <Console>PS2</Console>
              > <Title>Ratche t and Clank</Title>
              > <Description>Fu n</Description>
              > </GameList>
              > </Entertainment>
              >
              > The wanted result is produced and displayed nicely in IE6:
              >
              > <h2 xmlns:lc="http://mark/DevelopmentWebs ite">My Game Collection</h2>
              > <table xmlns:lc="http://mark/DevelopmentWebs ite" border="1">
              > <tr>
              > <th colspan="2">Sly Cooper</th>
              > </tr>
              > <tr>
              > <td><IMG SRC="images\Sly Cooper.jpg"></td>
              > <td>A witty game that is fun for everybody</td>
              > </tr>
              > </table>
              >
              >
              > =====
              > Cheers,
              >
              > Dimitre Novatchev.
              > http://fxsl.sourceforge.net/ -- the home of FXSL
              >
              >
              >
              > "Mark Constant" <constants@mi x-net.net> wrote in message
              > news:ce43fdea.0 311152205.4ff5b 24b@posting.goo gle.com...[color=green]
              > > "Dimitre Novatchev" <dnovatchev@yah oo.com> wrote in message[/color]
              > news:<bp4fpm$1k omnk$1@ID-152440.news.uni-berlin.de>...[color=green][color=darkred]
              > > > > Even if I change the line xslProc.output; to Title.innerHTML =
              > > > > xslProc.output nothing happens.
              > > >
              > > > So, what is your complete example?
              > > >
              > > > I'd recommend that you have a look at the examples from the MSXML SDK[/color][/color]
              > and[color=green][color=darkred]
              > > > try them, like this one:
              > > >
              > > > <HTML>
              > > > <HEAD>
              > > > <TITLE>sample </TITLE>
              > > > <SCRIPT language = "javascript ">
              > > > function init()
              > > > {
              > > > var srcTree = new ActiveXObject(" Msxml2.DOMDocum ent.4.0");
              > > > srcTree.async=f alse;
              > > > srcTree.load("h ello.xml");
              > > >
              > > > var xsltTree= new ActiveXObject(" Msxml2.DOMDOCUM ENT.4.0");
              > > > xsltTree.async = false;
              > > > xsltTree.load(" hello.xsl");
              > > >
              > > > resTree.innerHT ML = srcTree.transfo rmNode(xsltTree );
              > > > }
              > > > </SCRIPT>
              > > > </HEAD>
              > > >
              > > > <BODY onload = "init()" >
              > > > <div id="resTree"></div>
              > > > </BODY>
              > > >
              > > > </HTML>You can incrementally add your code step by step, until you get[/color][/color]
              > your[color=green][color=darkred]
              > > > application working.=====
              > > > Cheers,
              > > >
              > > > Dimitre Novatchev.
              > > > http://fxsl.sourceforge.net/ -- the home of FXSL[/color]
              > >
              > > I tried what you gave for an example above and it worked fine. It is
              > > when I try to start using the .addParameter() function. All I am
              > > getting for an output now is the header from my .xslt page which is
              > > more then I was getting before. Basically what I want to be outputted
              > > for right now is everything I have for Sly Cooper from my xml file.
              > >
              > > Here is my Javascript function
              > > <script language="javas cript">
              > > function CallXML()
              > > {
              > > var xsltTree = new ActiveXObject(" Msxml2.FreeThre adedDOMDocument .4.0");
              > > xsltTree.async = false;
              > > xsltTree.load(" Games.xslt")
              > >
              > > var srcTree = new ActiveXObject(" Msxml2.DOMDocum ent.4.0");
              > > srcTree.async = false;
              > > srcTree.load("G ames.xml");
              > >
              > > var xsltThread = new ActiveXObject(" Msxml2.XSLTempl ate.4.0");
              > > xsltThread.styl esheet = xsltTree;
              > > var xsltProc = xsltThread.crea teProcessor();
              > > xsltProc.input = xsltTree;
              > > xsltProc.addPar ameter("Title", "Sly Cooper");
              > >
              > > resTree.innerHT ML = srcTree.transfo rmNode(xsltTree );
              > > }
              > > </script>
              > >
              > > Here is my Games.Xslt file
              > > <?xml version="1.0" encoding="ISO-8859-1"?>
              > > <xsl:styleshe et version="1.0"
              > > xmlns:xsl="http ://www.w3.org/1999/XSL/Transform"
              > > xmlns:lc="http://mark/DevelopmentWebs ite">
              > > <xsl:output method="html"/>
              > > <xsl:param name="Title"/>
              > > <xsl:template match="/">
              > >
              > > <h2>My Game Collection</h2>
              > > <table border="1">
              > > <xsl:for-each select="lc:Ente rtainment/lc:GameList[lc:Title =
              > > $Title]">
              > > <tr>
              > > <th colspan="2"><xs l:value-of select="lc:Titl e"/></th>
              > > </tr>
              > > <tr>
              > > <td>
              > > <xsl:element name="IMG">
              > > <xsl:attribut e name="SRC">
              > > <xsl:value-of select="lc:Imag e"/>
              > > </xsl:attribute>
              > > </xsl:element>
              > > </td>
              > > <td><xsl:valu e-of select="lc:Desc ription"/></td>
              > > </tr>
              > > </xsl:for-each>
              > > </table>
              > >
              > > </xsl:template>
              > > </xsl:stylesheet>
              > >
              > > and here is what I have in the Games.xml file for Sly Cooper to show
              > > you that I do have something in the xml file for Sly Cooper.
              > > <?xml version="1.0" encoding="utf-8" ?>
              > > <Entertainmen t xmlns="http://mark/DevelopmentWebs ite">
              > > <GameList>
              > > <ID>1</ID>
              > > <Console>PS2</Console>
              > > <Title>Sly Cooper</Title>
              > > <Description> A witty game that is fun for everybody</Description>
              > > <Image>images\S lyCooper.jpg</Image>
              > > </GameList>
              > > <GameList>
              > > <ID>2</ID>
              > > <Console>PS2</Console>
              > > <Title>Ratche t and Clank</Title>
              > > <Description>Fu n</Description>
              > > </GameList>
              > > </Entertainment>[/color]
              >
              >[/color]


              Comment

              • Mark Constant

                #8
                Re: Using the .addParameter() function

                Well everything works now thank you. I just have one more question.
                (Atleast I hope). I added an option in the select box called All that
                will just display everything. <OPTION value="All">All Titles</OPTION>.
                Now in the xslt code I added this condition.
                <xsl:choose>
                <xsl:when test="$Title = 'All'">
                <xsl:for-each select="lc:Ente rtainment/lc:GameList">
                </xsl:when>
                <xsl:otherwis e>
                <xsl:for-each select="lc:Ente rtainment/lc:GameList[lc:Title =
                $Title]">
                </xsl:otherwise>
                </xsl:choose>

                It is giving the error "The stylesheet does not contain a document
                elment. The stylesheet may be empty, or it may not be a well-formed
                XML document.

                Comment

                • Dimitre Novatchev

                  #9
                  Re: Using the .addParameter() function

                  So what is your complete xslt code?

                  I hope that you'll learn to provide your code when asking about problems in
                  it.


                  =====
                  Cheers,

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

                  "Mark Constant" <constants@mi x-net.net> wrote in message
                  news:ce43fdea.0 311161659.1c4d4 92f@posting.goo gle.com...[color=blue]
                  > Well everything works now thank you. I just have one more question.
                  > (Atleast I hope). I added an option in the select box called All that
                  > will just display everything. <OPTION value="All">All Titles</OPTION>.
                  > Now in the xslt code I added this condition.
                  > <xsl:choose>
                  > <xsl:when test="$Title = 'All'">
                  > <xsl:for-each select="lc:Ente rtainment/lc:GameList">
                  > </xsl:when>
                  > <xsl:otherwis e>
                  > <xsl:for-each select="lc:Ente rtainment/lc:GameList[lc:Title =
                  > $Title]">
                  > </xsl:otherwise>
                  > </xsl:choose>
                  >
                  > It is giving the error "The stylesheet does not contain a document
                  > elment. The stylesheet may be empty, or it may not be a well-formed
                  > XML document.[/color]


                  Comment

                  • Mark Constant

                    #10
                    Re: Using the .addParameter() function

                    "Dimitre Novatchev" <dnovatchev@yah oo.com> wrote in message news:<bp9mb1$1k 9b3k$1@ID-152440.news.uni-berlin.de>...[color=blue]
                    > So what is your complete xslt code?
                    >
                    > I hope that you'll learn to provide your code when asking about problems in
                    > it.
                    >
                    >
                    > =====
                    > Cheers,
                    >
                    > Dimitre Novatchev.
                    > http://fxsl.sourceforge.net/ -- the home of FXSL
                    >
                    > "Mark Constant" <constants@mi x-net.net> wrote in message
                    > news:ce43fdea.0 311161659.1c4d4 92f@posting.goo gle.com...[color=green]
                    > > Well everything works now thank you. I just have one more question.
                    > > (Atleast I hope). I added an option in the select box called All that
                    > > will just display everything. <OPTION value="All">All Titles</OPTION>.
                    > > Now in the xslt code I added this condition.
                    > > <xsl:choose>
                    > > <xsl:when test="$Title = 'All'">
                    > > <xsl:for-each select="lc:Ente rtainment/lc:GameList">
                    > > </xsl:when>
                    > > <xsl:otherwis e>
                    > > <xsl:for-each select="lc:Ente rtainment/lc:GameList[lc:Title =
                    > > $Title]">
                    > > </xsl:otherwise>
                    > > </xsl:choose>
                    > >
                    > > It is giving the error "The stylesheet does not contain a document
                    > > elment. The stylesheet may be empty, or it may not be a well-formed
                    > > XML document.[/color][/color]

                    I am sorry for not including all of my code. Like I said all I want is
                    if the user chooses All then it will display everything. If the user
                    chooses a Title then it only displays the title they want. I thought I
                    could do this by using a <xsl:choose> statement that looks first to
                    see if the selected value was All and if not it would call the
                    <xsl:otherwis e> statement and just display the title that the user
                    selected.

                    Games.xslt
                    <?xml version="1.0" encoding="ISO-8859-1"?>
                    <xsl:styleshe et version="1.0"
                    xmlns:xsl="http ://www.w3.org/1999/XSL/Transform"
                    xmlns:lc="http://mark/DevelopmentWebs ite">
                    <xsl:output method="html"/>
                    <xsl:param name="Title"/>
                    <xsl:template match="/">

                    <h2>My Game Collection</h2>
                    <table border="0">
                    <xsl:choose>
                    <xsl:when test="$Title = 'All'">
                    <xsl:for-each select="lc:Ente rtainment/lc:GameList">
                    </xsl:when>
                    <xsl:otherwis e>
                    <xsl:for-each select="lc:Ente rtainment/lc:GameList[lc:Title =
                    $Title]">
                    </xsl:otherwise>
                    </xsl:choose>
                    <tr>
                    <th colspan="2" bgcolor="Green" ><xsl:value-of
                    select="lc:Titl e"/></th>
                    </tr>
                    <tr>
                    <td>
                    <xsl:element name="IMG">
                    <xsl:attribut e name="SRC">
                    <xsl:value-of select="lc:Imag e"/>
                    </xsl:attribute>
                    </xsl:element>
                    </td>
                    <td><xsl:valu e-of select="lc:Desc ription"/></td>
                    </tr>
                    </xsl:for-each>
                    </table>

                    </xsl:template>
                    </xsl:stylesheet>

                    Here is my Games.xml file
                    <?xml version="1.0" encoding="utf-8" ?>
                    <Entertainmen t xmlns="http://mark/DevelopmentWebs ite">
                    <GameList>
                    <ID>1</ID>
                    <Console>PS2</Console>
                    <Title>Sly Cooper</Title>
                    <Description> A witty game that is fun for everybody</Description>
                    <Image>images\S lyCooper.jpg</Image>
                    </GameList>
                    <GameList>
                    <ID>2</ID>
                    <Console>PS2</Console>
                    <Title>Ratche t and Clank</Title>
                    <Description>Fu n</Description>
                    </GameList>
                    </Entertainment>

                    And here is the Javascript function in my HTML
                    <script language="javas cript">
                    function CallXML(dropdow n)
                    {
                    var myIndex = dropdown.select edIndex;
                    var SelValue = dropdown.option s[myIndex].value;
                    var xsltTree = new
                    ActiveXObject(" Msxml2.FreeThre adedDOMDocument .4.0");
                    xsltTree.async = false;
                    xsltTree.load(" Games.xslt")

                    var srcTree = new ActiveXObject(" Msxml2.DOMDocum ent.4.0");
                    srcTree.async = false;
                    srcTree.load("G ames.xml");

                    var xsltThread = new ActiveXObject(" Msxml2.XSLTempl ate.4.0");
                    xsltThread.styl esheet = xsltTree;
                    var xsltProc = xsltThread.crea teProcessor();
                    xsltProc.input = srcTree;
                    xsltProc.addPar ameter("Title", SelValue);

                    xsltProc.transf orm();
                    resTree.innerHT ML = xsltProc.output ;
                    }
                    </script>

                    Comment

                    • Dimitre Novatchev

                      #11
                      Re: Using the .addParameter() function

                      > I am sorry for not including all of my code. Like I said all I want is[color=blue]
                      > if the user chooses All then it will display everything. If the user
                      > chooses a Title then it only displays the title they want. I thought I
                      > could do this by using a <xsl:choose> statement that looks first to
                      > see if the selected value was All and if not it would call the
                      > <xsl:otherwis e> statement and just display the title that the user
                      > selected.
                      >
                      > Games.xslt
                      > <?xml version="1.0" encoding="ISO-8859-1"?>
                      > <xsl:styleshe et version="1.0"
                      > xmlns:xsl="http ://www.w3.org/1999/XSL/Transform"
                      > xmlns:lc="http://mark/DevelopmentWebs ite">
                      > <xsl:output method="html"/>
                      > <xsl:param name="Title"/>
                      > <xsl:template match="/">
                      >
                      > <h2>My Game Collection</h2>
                      > <table border="0">
                      > <xsl:choose>
                      > <xsl:when test="$Title = 'All'">
                      > <xsl:for-each select="lc:Ente rtainment/lc:GameList">
                      > </xsl:when>[/color]

                      This is non-well-formed XML! The xsl:for-each element above has no ending
                      tag.

                      Correct the code and then it may run.


                      =====
                      Cheers,

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


                      [color=blue]
                      > <xsl:otherwis e>
                      > <xsl:for-each select="lc:Ente rtainment/lc:GameList[lc:Title =
                      > $Title]">
                      > </xsl:otherwise>
                      > </xsl:choose>
                      > <tr>
                      > <th colspan="2" bgcolor="Green" ><xsl:value-of
                      > select="lc:Titl e"/></th>
                      > </tr>
                      > <tr>
                      > <td>
                      > <xsl:element name="IMG">
                      > <xsl:attribut e name="SRC">
                      > <xsl:value-of select="lc:Imag e"/>
                      > </xsl:attribute>
                      > </xsl:element>
                      > </td>
                      > <td><xsl:valu e-of select="lc:Desc ription"/></td>
                      > </tr>
                      > </xsl:for-each>
                      > </table>
                      >
                      > </xsl:template>
                      > </xsl:stylesheet>
                      >
                      > Here is my Games.xml file
                      > <?xml version="1.0" encoding="utf-8" ?>
                      > <Entertainmen t xmlns="http://mark/DevelopmentWebs ite">
                      > <GameList>
                      > <ID>1</ID>
                      > <Console>PS2</Console>
                      > <Title>Sly Cooper</Title>
                      > <Description> A witty game that is fun for everybody</Description>
                      > <Image>images\S lyCooper.jpg</Image>
                      > </GameList>
                      > <GameList>
                      > <ID>2</ID>
                      > <Console>PS2</Console>
                      > <Title>Ratche t and Clank</Title>
                      > <Description>Fu n</Description>
                      > </GameList>
                      > </Entertainment>
                      >
                      > And here is the Javascript function in my HTML
                      > <script language="javas cript">
                      > function CallXML(dropdow n)
                      > {
                      > var myIndex = dropdown.select edIndex;
                      > var SelValue = dropdown.option s[myIndex].value;
                      > var xsltTree = new
                      > ActiveXObject(" Msxml2.FreeThre adedDOMDocument .4.0");
                      > xsltTree.async = false;
                      > xsltTree.load(" Games.xslt")
                      >
                      > var srcTree = new ActiveXObject(" Msxml2.DOMDocum ent.4.0");
                      > srcTree.async = false;
                      > srcTree.load("G ames.xml");
                      >
                      > var xsltThread = new ActiveXObject(" Msxml2.XSLTempl ate.4.0");
                      > xsltThread.styl esheet = xsltTree;
                      > var xsltProc = xsltThread.crea teProcessor();
                      > xsltProc.input = srcTree;
                      > xsltProc.addPar ameter("Title", SelValue);
                      >
                      > xsltProc.transf orm();
                      > resTree.innerHT ML = xsltProc.output ;
                      > }
                      > </script>[/color]


                      Comment

                      • Mark Constant

                        #12
                        Re: Using the .addParameter() function

                        "Dimitre Novatchev" <dnovatchev@yah oo.com> wrote in message news:<bpb3p6$1m jcb8$1@ID-152440.news.uni-berlin.de>...[color=blue][color=green]
                        > > I am sorry for not including all of my code. Like I said all I want is
                        > > if the user chooses All then it will display everything. If the user
                        > > chooses a Title then it only displays the title they want. I thought I
                        > > could do this by using a <xsl:choose> statement that looks first to
                        > > see if the selected value was All and if not it would call the
                        > > <xsl:otherwis e> statement and just display the title that the user
                        > > selected.
                        > >
                        > > Games.xslt
                        > > <?xml version="1.0" encoding="ISO-8859-1"?>
                        > > <xsl:styleshe et version="1.0"
                        > > xmlns:xsl="http ://www.w3.org/1999/XSL/Transform"
                        > > xmlns:lc="http://mark/DevelopmentWebs ite">
                        > > <xsl:output method="html"/>
                        > > <xsl:param name="Title"/>
                        > > <xsl:template match="/">
                        > >
                        > > <h2>My Game Collection</h2>
                        > > <table border="0">
                        > > <xsl:choose>
                        > > <xsl:when test="$Title = 'All'">
                        > > <xsl:for-each select="lc:Ente rtainment/lc:GameList">
                        > > </xsl:when>[/color]
                        >
                        > This is non-well-formed XML! The xsl:for-each element above has no ending
                        > tag.
                        >
                        > Correct the code and then it may run.
                        >
                        >
                        > =====
                        > Cheers,
                        >
                        > Dimitre Novatchev.
                        > http://fxsl.sourceforge.net/ -- the home of FXSL
                        >
                        >
                        >[color=green]
                        > > <xsl:otherwis e>
                        > > <xsl:for-each select="lc:Ente rtainment/lc:GameList[lc:Title =
                        > > $Title]">
                        > > </xsl:otherwise>
                        > > </xsl:choose>
                        > > <tr>
                        > > <th colspan="2" bgcolor="Green" ><xsl:value-of
                        > > select="lc:Titl e"/></th>
                        > > </tr>
                        > > <tr>
                        > > <td>
                        > > <xsl:element name="IMG">
                        > > <xsl:attribut e name="SRC">
                        > > <xsl:value-of select="lc:Imag e"/>
                        > > </xsl:attribute>
                        > > </xsl:element>
                        > > </td>
                        > > <td><xsl:valu e-of select="lc:Desc ription"/></td>
                        > > </tr>
                        > > </xsl:for-each>
                        > > </table>
                        > >
                        > > </xsl:template>
                        > > </xsl:stylesheet>
                        > >
                        > > Here is my Games.xml file
                        > > <?xml version="1.0" encoding="utf-8" ?>
                        > > <Entertainmen t xmlns="http://mark/DevelopmentWebs ite">
                        > > <GameList>
                        > > <ID>1</ID>
                        > > <Console>PS2</Console>
                        > > <Title>Sly Cooper</Title>
                        > > <Description> A witty game that is fun for everybody</Description>
                        > > <Image>images\S lyCooper.jpg</Image>
                        > > </GameList>
                        > > <GameList>
                        > > <ID>2</ID>
                        > > <Console>PS2</Console>
                        > > <Title>Ratche t and Clank</Title>
                        > > <Description>Fu n</Description>
                        > > </GameList>
                        > > </Entertainment>
                        > >
                        > > And here is the Javascript function in my HTML
                        > > <script language="javas cript">
                        > > function CallXML(dropdow n)
                        > > {
                        > > var myIndex = dropdown.select edIndex;
                        > > var SelValue = dropdown.option s[myIndex].value;
                        > > var xsltTree = new
                        > > ActiveXObject(" Msxml2.FreeThre adedDOMDocument .4.0");
                        > > xsltTree.async = false;
                        > > xsltTree.load(" Games.xslt")
                        > >
                        > > var srcTree = new ActiveXObject(" Msxml2.DOMDocum ent.4.0");
                        > > srcTree.async = false;
                        > > srcTree.load("G ames.xml");
                        > >
                        > > var xsltThread = new ActiveXObject(" Msxml2.XSLTempl ate.4.0");
                        > > xsltThread.styl esheet = xsltTree;
                        > > var xsltProc = xsltThread.crea teProcessor();
                        > > xsltProc.input = srcTree;
                        > > xsltProc.addPar ameter("Title", SelValue);
                        > >
                        > > xsltProc.transf orm();
                        > > resTree.innerHT ML = xsltProc.output ;
                        > > }
                        > > </script>[/color][/color]


                        I corrected the problem and everything works!! Within my <xsl:choose>
                        statement I used <xsl:call-template> and from there just called
                        different templates depending on if they selected a genre or all.
                        Thank you for all your help. The absolute last thing I was thinking
                        about doing was pagination. Do you have any websites or suggestions
                        for where I could read about pagination?

                        Comment

                        • Dimitre Novatchev

                          #13
                          Re: Using the .addParameter() function

                          > I corrected the problem and everything works!! Within my <xsl:choose>[color=blue]
                          > statement I used <xsl:call-template> and from there just called
                          > different templates depending on if they selected a genre or all.
                          > Thank you for all your help. The absolute last thing I was thinking
                          > about doing was pagination. Do you have any websites or suggestions
                          > for where I could read about pagination?[/color]

                          Yes, see the XSLT FAQ at:




                          =====
                          Cheers,

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


                          Comment

                          Working...