473,320 Members | 1,916 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,320 software developers and data experts.

Javascript inside a XSLT file and how to handle parameters.

13
My xslt file contains a passed parameters

<xsl;param name="Widths">70px,70px,70px,100px,100px</xsl;param>

which I want to use to sets the widths of my table columns .

when I create my table I make the following call.

<tr>
<th valign="bottom" width="{foo:GetWidth(0)}">Length<br/>(units)</th>
<th valign="bottom" width="{foo:GetWidth(1)}">Width<br/>(units)</th>
.
.// rest of the table headers.
.
</tr>
.
.// rest of the table display
.
.
</table>

GetWidth calls some javascript embeded in the xslt file

<msxsl:script implements-prefix="foo" language="Javascript">
<![CDATA[

function GetWidth(item)
{
var str= "";
str = <make reference to 'Widths' values, bit I don't understand!!>

str = str.split(",");

return str[item];
}
]]>
</msxsl:script>

which I want to return the element of the node.

My problem is that I cant make any reference to param 'Widths' or any variables I may create, from within the javascript function. Is there a simple solution?
Feb 7 '07 #1
1 2484
dorinbogdan
839 Expert 512MB
Hi,
Did you succeed to solve the problem ?
If yes, please let me know, in order to close the thread.
Thanks,
Dorin.
Feb 15 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: ted | last post by:
Was wondering if XSLT alone is appropriate for the following situation. From XML, I'm creating a small website (around 50 pages) with pages that link to each other through a nav menu and a...
6
by: dSchwartz | last post by:
What I think I'm looking for is a way (in XSL stylesheet) to get the contents of a directory. How can this be accomplished? more detailed: /root index.aspx xsl_style.xsl /xml...
2
by: Jon Martin Solaas | last post by:
For java programmers there exist a framework called Millstone (www.millstone.org) for programming web user-interfaces in a component oriented way. Millstone uses xslt transformations to render...
1
by: Matt | last post by:
Is it possible to put XSL instructions inside JavaScript? For example, pop up a message box with the xml value: alert(value in xml); Approach #1: <script type="text/javascript">...
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...
2
by: Richard L Rosenheim | last post by:
Is it possible to include addition tags in a XSLT file, that the XSLT processor will, for all practical purposes, ignore? What I'm looking to do is to include a section to contain information...
7
by: Harolds | last post by:
The code below worked in VS 2003 & dotnet framework 1.1 but now in VS 2005 the pmID is evaluated to "" instead of what the value is set to: .... xmlItems.Document = pmXML // Add the pmID...
1
by: Max Evans | last post by:
I have a XML file, which contains itemid-elements, e.g.: <itemid>3</itemid> <itemid>12</itemid> Now I want to convert these IDs to the corresponding name via XSLT. I thought I could do it this...
6
by: Dan H | last post by:
I'm trying to apply CSS to an XML file and interject a JavaScript function into the page. I have the following source code: foo.xml ====== <?xml version="1.0" encoding="UTF-8"?>...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.