473,545 Members | 2,011 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

[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********@remo veme.iprimus.co m.au
Jul 20 '05 #1
3 10791
> 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.a ddParameter()
=====
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.a ddParameter()?

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********@ipr imus.com.au> wrote in message
news:3f******** @news.iprimus.c om.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.a ddParameter()?

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
2684
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 extension responsible for the xslt functions. The problem i have is that the obtained transformation is not the waited one. I try to proccess the...
1
4314
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 result will be stored in to the <xsl:variable> how will i do that? Or is it really possible to do that or is there other way of doing it? Your help...
6
4671
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 xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:output method="html" /> <xsl:template match="/">
12
3387
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 apply-templates and passes a node set to it. This template in turn defines approximately 15 variables that dictate how the following template should proceed....
6
1566
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"; data.load(dataUrl) ; var transform = new ActiveXObject("Microsoft.XMLDOM"); transform.async = false ;
7
11047
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, need to iterate through pages page2 - e.g. allow user to update the fields there) On page1 I have a bunch of checkboxes with the same name v1...
1
1322
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 matching the root node, containing the HTML page, with lots of <xsl:value-of.../>, etc.). However, I've recently got a task that got me stumped, and I...
4
1608
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 http://www.w3.org/TR/xslt (chapter 12.1). When using "<xsl:variable name="test" select="document('Resources.xml')/root/test"/>" the variable test is...
7
1552
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 is appreciated in advance. Cheers
0
7475
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7409
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7664
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7437
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
5982
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5343
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3465
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3446
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1900
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.