[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

including xsl variables inside of a javascript function

Subject: including xsl variables inside of a javascript function
From: Heather Lindsay <heather.lindsay@xxxxxxxxxxxxx>
Date: Fri, 21 Jul 2000 14:17:06 -0400
xsl inside javascript
hi all,
	I have a javascript table imbedded inside of "<![CDATA[" "]]>".
Right now the table includes static data.  I want the table data to be from
an xml file.  Since the javascript must be inside of the CDATA tags, I can't
just put "<xsl:value-of select="whatever"/>" as the value of a javascript
variable.  Please tell me there is some way to do what I need to do.  Thanks
for any suggestions you can offer.   Let me know if this is not enough
information.  

Desperate for help,
Heather


<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="/">

<html>
<head>

<title>Dynamic Table</title>
<link rel="stylesheet" type="text/css"/>

<SCRIPT language="javascript"
src="../../../TDF/dev/js/browsercheck.js"></SCRIPT>
<SCRIPT language="javascript" src="../../../TDF/dev/js/TDFPane.js"></SCRIPT>
<SCRIPT language="javascript" src="../js/DTable.js"></SCRIPT>

<xsl:variable name="user" select="Login/UserInfo/UserName"/>
<!-- I would like to use this variable inside the javascript -->

<SCRIPT language="JavaScript">
<![CDATA[
function init() {
	
	var html = '<nobr>Trying another table file</nobr>'

    var myTable = new_DTable('Table1', null, 100, 100, 350, 350)


    myTable.add_column('firstColumn', 'data1')
    myTable.add_column('secondColumn', 'data2')
    myTable.add_column('thirdColumn', 'data3')

    rowA = new Object()
    rowA.data1 = 'Heather'      <!-- I would like to say "rowA.data1 =
$user" here but of course can't-->
    rowA.data2 = 'needs'
    rowA.data3 = 'help'
    myTable.append_row(rowA)

    rowB = new Object()
    rowB.data1 = 'Mickey'
    rowB.data2 = 'Disney Land'
    rowB.data3 = 'California'
    myTable.append_row(rowB)

    rowC = new Object()
    rowC.data1 = 'Minnie'
    rowC.data2 = 'Disney World is the place to be'
    rowC.data3 = 'Florida'
    myTable.append_row(rowC)

    rowD = new Object()
    rowD.data1 = 'Alphabet Soup'
    rowD.data2 = 'Burger Stew'
    rowD.data3 = 'Camel flavored milk'
    rowD.data4 = 'just a try'
    myTable.append_row(rowD)


    var myHeader = myTable.get_header()
    myHeader.name= 'The Table that must be!'
    myTable.show_header(myHeader,true)

    myTable.show_table()
    ]]>
}
</SCRIPT>
</head>


<BODY onLoad="init()" BGCOLOR="#FFFFFF">


</BODY>

</html>


</xsl:template>

</xsl:stylesheet>


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.