472,371 Members | 1,562 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,371 software developers and data experts.

[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
bk********@removeme.iprimus.com.au
Jul 20 '05 #1
3 10729
> 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?


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
Jul 20 '05 #2
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.
Jul 20 '05 #3
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" <bk********@iprimus.com.au> wrote in message
news:3f********@news.iprimus.com.au...
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.

Jul 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Sergio del Amo | last post by:
Hi, I use the xslt functions provided by php. I am running in my computer the package xampp(www.apachefriends.org) which includes php/apache/mysql .. In this package the php includes the sablotron...
1
by: ms_chika | last post by:
Please help! I just want to know how can i pass the return value of a javascript function to a xsl variable. I have an xsl file and from that file i will call a javascript function then the...
6
by: RC | last post by:
Hello World, I am try do call a JavaScript function from XSLT, but I got function not avaible error. See "????" below. Would someone out there tell me how? Thank Q! <xsl:stylesheet...
12
by: Keith Chadwick | last post by:
I have a fairly hefty XSLT file that for the sake of debugging and clarity I wish to split into some separate sub-templates contained within the same file. The master template calls an...
6
by: Steve B. | last post by:
Hello everybody In a webpage, I use JS display data from an xml file and a xsl file: var data = new ActiveXObject("Microsoft.XMLDOM"); data.async = false; var dataUrl = "data.aspx";...
7
by: Oleg Konovalov | last post by:
Hi, I am trying to pass a bunch of checked checkboxes (Javascript array) from page1 to the Java action class on subsequent web page (page2). (on page 1 I have a bunch of DB rows with a checkbox,...
1
by: tslettebo | last post by:
Hi all. I've read Michael Kay's "XSLT" book, and used XSLT successfully as an HTML template system at our company (using basically the "fill-in-the-blanks" pattern of XSLT use: A template...
4
by: Michal | last post by:
Hi everyone, Microsoft states that the System.XML 1.0 included in framework 1.1 supports the W3C XSLT Specification. However, I am having a problem using the document() fuction specified in...
7
by: elsheh | last post by:
Hi 2 all Iím using XSLT to transform XML document into XHTML doc. Xhtml formís elements need to be validated. Any idea tells how to link javaScripts functions with xhtml formís elements. any help...
1
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web server and have made sure to enable curl. I get a...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS starter kit that's not only easy to use but also...
2
by: Ricardo de Mila | last post by:
Dear people, good afternoon... I have a form in msAccess with lots of controls and a specific routine must be triggered if the mouse_down event happens in any control. Than I need to discover what...
1
by: Johno34 | last post by:
I have this click event on my form. It speaks to a Datasheet Subform Private Sub Command260_Click() Dim r As DAO.Recordset Set r = Form_frmABCD.Form.RecordsetClone r.MoveFirst Do If...
1
by: ezappsrUS | last post by:
Hi, I wonder if someone knows where I am going wrong below. I have a continuous form and two labels where only one would be visible depending on the checkbox being checked or not. Below is the...
0
by: jack2019x | last post by:
hello, Is there code or static lib for hook swapchain present? I wanna hook dxgi swapchain present for dx11 and dx9.
0
DizelArs
by: DizelArs | last post by:
Hi all) Faced with a problem, element.click() event doesn't work in Safari browser. Tried various tricks like emulating touch event through a function: let clickEvent = new Event('click', {...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.