Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old November 16th, 2006, 03:11 AM
Authorized User
Join Date: May 2006
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Default named anchors

I have a number of elements in my XML document which are toggled to show/hide.

I do this by changing the value of an attribute with a JavaScript function and then calling refresh() so that the XML is loaded again. The element is then shown or hidden using an if-test for the value of the attribute in the XSLT template.

This works fine, but in newer versions of firefox (later than 1.0.2) the page jumps to the top instead of staying and just revealing/hiding the information. I think I should use a named anchor, but have not idea how.

Here is the relevant template, and you can find the entire thing at
or look at it at http://www.masha.co.za/masters/default.html

<xsl:template match="ns:informalfigure">
<blockquote class="note">
<a href = "#" onclick="{concat (&quot;showHide('informalfigure', '&quot;, @role, &quot;') ; return false&quot;)} ; return false" >Show / hide<b> extra information:</b>
<xsl:if test="@show = 'true'">
 <xsl:apply-templates />

Old November 16th, 2006, 05:03 AM
mhkay's Avatar
Wrox Author
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts

Wrong forum, I'm afraid. If your HTML isn't doing what you want it to do in Firefox, that's an HTML/Firefox problem. It only becomes an XSLT problem once you know what HTML you want to generate.

Michael Kay
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference

Similar Threads
Thread Thread Starter Forum Replies Last Post
please help in anchors diablo17 Dreamweaver (all versions) 1 February 26th, 2007 04:58 PM
linking using anchors debjanib ASP.NET 1.0 and 1.1 Basics 2 November 29th, 2006 01:00 PM
Named arguments Bob Bedell C# 2 March 19th, 2006 09:25 PM
Anchors srotondo Classic ASP Professional 0 February 8th, 2005 07:50 PM
How do you create anchors programatically? ggreen001 Classic ASP Components 1 August 28th, 2003 08:35 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.