Altova Mailing List Archives

Re: [xsl] links don't work when IE transforms XSL document

From: Jakob Fix <jakob.fix@--------->
Date: 9/30/2004 8:39:00 AM
have you tried putting an <xsl:comment> </xsl:comment> in between the
opening and closing <a> tags, for this result: <a name="id1"><!--

this worked for me in a similar situation.

On Thu, 30 Sep 2004 10:30:50 +0200, Anton Triest <anton@xxxxxxxx> wrote:
> Hello everybody,
> I want to create a html document (client-side transformation) with
> internal hyperlinks
> (links to anchors within the document). This is my stylesheet (anchors.xsl):
> <?xml version="1.0" encoding="utf-8"?>
> <?xml-stylesheet type="text/xsl" href="anchors.xsl"?>
> <xsl:stylesheet version="1.0"
>     xmlns=""
>     xmlns:xsl="">
>     <xsl:output method="xml" encoding="utf-8" indent="yes"
>         doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
>         doctype-system=""/>
>     <xsl:template match="/">
>         <html lang="en" xml:lang="en">
>             <head>
>                 <title>anchors</title>
>                 <style type="text/css">
>                     div { padding-bottom: 800px; }
>                 </style>
>             </head>
>             <body>
>                 <div>
>                     <p>contents</p>
>                     <ul>
>                         <li><a href="#s1">Section 1</a></li>
>                         <li><a href="#s2">Section 2</a></li>
>                         <li><a href="#s3">Section 3</a></li>
>                     </ul>
>                 </div>
>                 <div><a id="s1"></a><h1>Section 1</h1></div>
>                 <div><a id="s2"></a><h1>Section 2</h1></div>
>                 <div><a id="s3"></a><h1>Section 3</h1></div>
>             </body>
>         </html>
>     </xsl:template>
> </xsl:stylesheet>
> Against any input file, this should display a file with 3 hyperlinks (a
> href) to their appropriate
> anchor (a id). This all works well... except when I use an xsl
> stylesheet as input file: in IE,
> the links don't work (clicking them results in "Cannot find server or
> DNS Error").
> I tried using '<a name=' instead of '<a id=', and also tried putting
> something inside the anchor
> element (<a id="s1">&#160;</a>), but it doesn't help.
> Is this a bug in IE or MSXML? (I'm using IE 6.0.2800.1106, MSXML
> 4.20.9818.0). In Mozilla it
> works as expected. And when I generate a html file with Saxon, the
> resulting file works, also in IE.
> If anybody wonders why I want to use an xsl as input: the above code is
> a simplified example,
> for a similar problem occuring here:
> TIA,
> Anton



These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.