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 (1175)
- Stylus Studio Technical Forum (14538)
-> + PDF Format Help (4)
-> + License check unreliable (2)
-> - XML related issue (1)
-> + Need help regarding pipeline o... (2)
-> + Error converting XML to EDIFAC... (4)
-> + XSLT Profiling for XSLT 1.0 s... (2)
-> + Grouping (2)
-> - Best Toner for Sensitive Skin (1)
-> + Best Practice for Pipeline err... (2)
-> + pdf generation (4)
-> + Problems excuting a Pipeline w... (2)
-> + XML serializer (3)
-> + Supported EDIFACT versions (5)
-> - Anyone know XActimate ESX file... (1)
-> + Stylus Studio with OpenJDK (2)
-> - Encoding error when importing ... (1)
-> - SEO Service in Delhi, India (1)
-> - HP Printer Support (1)
-> + Stylus Studio X16 Professional... (5)
-> + Stylus Studio X16 Enterprise -... (4)
-- [1-20] [21-40] [41-60] Next
+ Website Feedback (247)
+ XSLT Help and Discussion (7621)
+ XQuery Help and Discussion (1946)
+ Stylus Studio FAQs (159)
+ Stylus Studio Code Samples & Utilities (364)
+ Stylus Studio Announcements (113)
Topic  
Postnext
Lorrie NerbasSubject: Help with creating onclick event script in xsl
Author: Lorrie Nerbas
Date: 02 May 2006 03:37 PM
Hello, I am very new to xml and xsl.

I need help understanding how to write event script for my navigation menu. I created the xml and xls files in Style Studio and moved them to ASP.Net and used the <asp:xml control to display the menu, which works fine.

Now I need to write vbscript or javascript onclick_() event code for the buttons to direct the user to a division home page which matches the button name.

The aspx page and xsl pages are attached. Thank you very much in advance for your help with this.

Lorrie


UnknownNew14.xsl


UnknownxmlControl1

Postnext
Ivan PedruzziSubject: Help with creating onclick event script in xsl
Author: Ivan Pedruzzi
Date: 02 May 2006 04:07 PM
Lorrie,

This doesn't sound like a Stylus Studio question.

I suggest you to search on www.google.com you will find plenty of pages describing how to use javascript in HTML.

Hope this helps
Ivan Pedruzzi
Stylus Studio Team

Posttop
Lorrie NerbasSubject: Help with creating onclick event script in xsl
Author: Lorrie Nerbas
Date: 03 May 2006 06:21 PM
You are misunderstanding my question. The code is below. When this is run, 12 buttons are generated from the for-each loop. Each button's value is the division name. I need to run an mybutton_onclick_() event, and get the division name. The user will then be redirected to their division's home page when the event is fired. Can this be accomlished using the value from <xsl:for-each select="cwhome/menu/division">?


<?xml version='1.0' encoding='utf-8'?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxml="urn:schemas-microsoft.com:xslt"
xmlns:user="http://mycompany/mynamespace">
<xsl:output method="html"/>
<xsl:template match="/">
<html><head></head>
<body>
<form name="form1" runat="Server">

<p>
<font style="font-size: 16pt; color: #3642a9; font-family: arial">
<xsl:value-of select="cwhome/title"/>
</font>
</p>
<p>
<table id="Table1" name="Table1" cellSpacing="0" cellPadding="0" width="88" style="table-layout: auto; ; width: 88px; font-family: arial; white-space: nowrap; position: absolute; text-align: center" onclick_="doclick()">
<tbody>
<xsl:for-each select="cwhome/menu/division">
<tr>
<td vAlign="middle" width="50%" id="">
<button id="mybutton" style="border-right: medium none; border-top: medium none; font-size: 10pt; filter: progid:dximagetransform.microsoft.gradient(gradienttype=0,startcolorstr=#bbbbe7,endcolorstr=#ddddff); vertical-align: top; border-left: medium none; width: 110px; color: midnightblue; border-bottom: medium none; font-family: arial; white-space: pre; height: 27px; text-align: center">
<xsl:value-of select="."/>

</button>

</td>
</tr>
</xsl:for-each>
<script language="vbscript" implements-prefix="user">
<![CDATA[
sub doclick()
msgbox(document.form1.elements(mybutton).value)
end sub
]]>
</script>

</tbody>
</table>
</p>
<p>
<xsl:call-template name="NewTemplate0"/>
</p>
</form>
</body>
</html>
</xsl:template>
<xsl:template name="NewTemplate0"/>
</xsl:stylesheet>

Thank-you.

Lorrie


   
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.