XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Conferences Close Tree View
+ Stylus Studio Feature Requests (1192)
+ Stylus Studio Technical Forum (14621)
+ Website Feedback (249)
- XSLT Help and Discussion (7625)
-> + Mapping complex document with ... (8)
-> + Sorting in XSLT (2)
-> + xsl date time adding... (16)
-> - Flat XML to nested XML convers... (1)
-> + parser for parsing XSL file (2)
-> - q on group function (1)
-> + compare 2 date value using xsl (2)
-> - Remove namespaces from SOAP pa... (1)
-> + Numeric string not displaying ... (3)
-> + where is the old HTM to XSL wi... (2)
-> + XSLT variable path (2)
-> + Sort by lookup values & styles... (2)
-> + Hi without hard code filed na... (2)
-> + XSLT output does not work (2)
-> - How can I do this javascript i... (2)
-> ->How can I do this javascr...
-> + Paging with XSL and passing UR... (2)
-> + XPath Condition Query (3)
-> + Xalan Multiple XML Output Over... (3)
-> + Inserting Line Break (2)
-> + Get Value from non-standard xm... (2)
-- Previous [541-560] [561-580] [581-600] Next
+ XQuery Help and Discussion (2017)
+ Stylus Studio FAQs (159)
+ Stylus Studio Code Samples & Utilities (364)
+ Stylus Studio Announcements (113)
Topic  
Postnext
mi leeSubject: How can I do this javascript in XSLT
Author: mi lee
Date: 22 Sep 2008 11:06 PM
Hello,
I'm really new with XSLT,
but the project I'm starting to join is using XSLT, and I need to add java script in that.

First I had Calendar javascript before, and I need to put that calendar thingy inside the .xsl file

Here is the html file that used calendar javascript I used before.


Code:
<!DOCTYPE html PUBLIC "-//W3C/DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title> New Post </title>
<meta http-equiv="Content-Type"
content="text/html; charset=iso-8859-1 "/>
<script type="text/javascript" src="calendarDateInput.js">
/***********************************************
* Jason's Date Input Calendar- By Jason Moon http://calendar.moonscript.com/dateinput.cfm
* Script featured on and available at http://www.dynamicdrive.com
* Keep this notice intact for use.
***********************************************/
</script>
</head>
<body>
....
<label>On Date : </label>
<script>DateInput('onDate', true, 'YYYY-MM-DD', '<?=shownDate($onDate);?>')</script>
...
</body>
</html>

And here is the xsl file I tried to add java script


Code:
<xsl:template match="node()" mode="head">
<head>
<script type="text/javascript">
<xsl:attribute name="src">calendarDateInput.js</xsl:attribute>
<xsl:comment>Comment added so script is recognised</xsl:comment>
</script>

</head>
</xsl:template>

<xsl:template name="report-params-dates">
<!-- Start Date We use calendar widget -->
<label for="start" id="start_label">
<xsl:text>Start Date: </xsl:text>
<script>DateInput('onDate', true, 'YYYY-MM-DD')</script>
</label>
</xsl:template>

The result? There is nothing shown and said there is error in that page. I know I didn't do correctly, but I don't know how to fix it.

I really appreciate your help.

Thanks,

Posttop
(Deleted User) Subject: How can I do this javascript in XSLT
Author: (Deleted User)
Date: 01 Oct 2008 03:22 PM
Hi,
it's hard to say anything, as we don't see how (or if) the templates are being called by the root template. Could you attach the entire XSL with the source XML, and tell us which version of Stylus Studio are you using, and which XSLT processor are you running?

Thanks,
Alberto

   
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.