473,403 Members | 2,222 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 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 10779
> 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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.