• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

javascript: onload function with xsl

 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
girl power ... turns out to be about a hundred watts. But they seriuosly don't like being connected to the grid. Tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic