473,563 Members | 2,857 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Javascript inside a XSLT file and how to handle parameters.

13 New Member
My xslt file contains a passed parameters

<xsl;param name="Widths">7 0px,70px,70px,1 00px,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:Get Width(0)}">Leng th<br/>(units)</th>
<th valign="bottom" width="{foo:Get Width(1)}">Widt h<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="Javas cript">
<![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 2502
dorinbogdan
839 Recognized Expert Contributor
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
3891
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 "crumb-trail" of links. I'm transforming the XML with XSLT through Saxon. The nav menu and "crumb-trail" show the user where they are within the site...
6
2699
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 newsletter_001.xml
2
2377
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 components as html. I'm trying to modify millstone so that it can display a html editor widget called HTMLArea instead of the usual html <textarea>...
1
3334
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"> alert(<xsl:value-of select="@id"/>); </script> It will have javascript errors
12
3393
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....
2
1452
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 regarding what parameters the XSLT file is expecting. Then my program can retrieve the information from the style sheet and prompt the user for the...
7
2839
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 parameter to the XSLT stylesheet XsltArgumentList xsltArgList = new XsltArgumentList(); xsltArgList.AddParam("pmID", "", pmID);...
1
1349
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 way (XSLT): <xsl:apply-templates select="itemid" /> <xsl:template match="itemid"> <xsl:value-of select="itemnames" /> </xsl:template> And I'd like...
6
1357
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"?> <?xml-stylesheet href="foo.css" type="text/css"?> <doc> <element1>
0
7664
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
7583
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
8106
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7948
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5484
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
3642
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
3626
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2082
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
0
923
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.