File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes HTML, CSS and JavaScript and the fly likes javascript: onload function with xsl Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of Practical Unit Testing with TestNG and Mockito this week in the Testing forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Reply Bookmark "javascript: onload function with xsl" Watch "javascript: onload function with xsl" New topic
Author

javascript: onload function with xsl

Tom Brown
Greenhorn

Joined: Sep 25, 2003
Posts: 22
hey all,
i work with an xml file and xsl file so i get html. i want to implement the <xsl:value-of select="@ANCHOR"/> in the javascriptfunction but he don't accept "<".
do i have to use a variable or so in javascript? how can i do this?
thanks a lot
tom

<script language="JavaScript" type="text/JavaScript">
<!--
function goToSection(sectionName)
{
location.hash = sectionName;
}
//-->
</script>
</head>
<xsl:for-each select="//TREE">
<body leftmargin="0" topmargin="0" bottommargin="0" rightmargin="0" bgcolor="#ffffff" onlload="goToHash('<xsl:value-of select="@ANCHOR"/>');">
</xsl:for-each>
--------------------------------------
or this: didn't work:
---------------------
<script language="javascript">
<![CDATA[
function goToHash() {
location.hash = ']]><xsl:for-each select="//TREE"><xsl:value-of select="@ANCHOR"/></xsl:for-each><![CDATA[';
}
]]>
</script>
</head>
<body leftmargin="0" topmargin="0" bottommargin="0" rightmargin="0" bgcolor="#ffffff" onlload="goToHash();">
[ April 01, 2004: Message edited by: Tom Brown ]
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15003
The questions I always ask:
Where is it failing?
What is the error you are getting?
Did you look at the source code after the page has loaded?
Is that what you meant to be in the tag?
Eric
 
 
subject: javascript: onload function with xsl
 
Threads others viewed
Form Submit to JavaScript in Pop-up
Remove unwanted space before and after the table using javascript
No margins in Netscape?
Controlling applet from html code
xsl: anchor problem
IntelliJ Java IDE