Connecting Tech Pros Worldwide Help | Site Map

[XSLT]Passing values from Javascript to a XSLT variable

 
LinkBack Thread Tools Search this Thread
  #1  
Old July 20th, 2005, 06:12 AM
Benjamin Hillsley
Guest
 
Posts: n/a
Default [XSLT]Passing values from Javascript to a XSLT variable

Hi,

I have a xml file that catalogs my cd and dvd collection, and I am currently
writing a web page to access this catalog.

I would like to include a selection box that lists the CD's by artist, and
then have the XSLT select only what artist is chosen in the selection box.

So far I have been able to create the selection box, and populate it with
the artist's names. I have also created the <XSL:IF> statement that will
choose the artists records. The problem I have is the javascript I have
written to grab the selection box's current value cannot write this to an
XSLT variable to be referenced by the IF statement.

(1) Is it possible to have XSL directly reference the selection box, or
another way to have this work?

(2) Is there a way to strip multiple records of the same artist from the
selection box, e.g. If I have 2 cd's by Metallica then Metallica appears
twice in the selection box?

Thanks

Ben
bkhillsley@removeme.iprimus.com.au



  #2  
Old July 20th, 2005, 06:12 AM
Dimitre Novatchev
Guest
 
Posts: n/a
Default Re: [XSLT]Passing values from Javascript to a XSLT variable

> The problem I have is the javascript I have[color=blue]
> written to grab the selection box's current value cannot write this to an
> XSLT variable to be referenced by the IF statement.
>
> (1) Is it possible to have XSL directly reference the selection box, or
> another way to have this work?[/color]

No.

You have to pass the value as parameter to the transformation. How this is
done depends on the particular XSLT processor you're using.

For example with MSXML3 or MSXML4 one uses IXSLProcessor.addParameter()


=====
Cheers,

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


  #3  
Old July 20th, 2005, 06:12 AM
Benjamin Hillsley
Guest
 
Posts: n/a
Default Re: [XSLT]Passing values from Javascript to a XSLT variable

Thank you for your answer, and I will now display my ignorance by asking a
further question...

I am self taught in XML, XSL, and Javascript, and tend to learn by solving
these problems that I create myself.

I am using MSXML3.0 shipped with IE6sp1, and so how would I use this
IXSLProcessor.addParameter()?

If you require my source files, please ask and I will post them here.
Thanks.


  #4  
Old July 20th, 2005, 06:12 AM
Dimitre Novatchev
Guest
 
Posts: n/a
Default Re: [XSLT]Passing values from Javascript to a XSLT variable

See the example that comes with the MSXML SDK documentation -- locally or
at:

http://msdn.microsoft.com/library/en...asp?frame=true


=====
Cheers,

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



"Benjamin Hillsley" <bkhillsley@iprimus.com.au> wrote in message
news:3f724fa3_1@news.iprimus.com.au...[color=blue]
> Thank you for your answer, and I will now display my ignorance by asking a
> further question...
>
> I am self taught in XML, XSL, and Javascript, and tend to learn by solving
> these problems that I create myself.
>
> I am using MSXML3.0 shipped with IE6sp1, and so how would I use this
> IXSLProcessor.addParameter()?
>
> If you require my source files, please ask and I will post them here.
> Thanks.
>
>[/color]


 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,662 network members.