#63 keeps <a name=...> in xhtml output

closed-out-of-date
XSL (122)
5
2004-12-10
2002-05-22
No

This is a simple patch to keep the name attribute in
anchor tags when html2xhtml runs. This is so Netscape 4
users will still be able to click a link to scroll to
that place in a document.

My understanding of the xhtml spec allows the name
attribute while prefering the id attribute.

I would really like if it this was included.

Index: xhtml/html2xhtml.xsl

RCS file: /cvsroot/docbook/xsl/xhtml/html2xhtml.xsl,v
retrieving revision 1.4
diff -u -r1.4 html2xhtml.xsl
--- xhtml/html2xhtml.xsl 1 Mar 2002 09:16:51
-0000 1.4
+++ xhtml/html2xhtml.xsl 22 May 2002 21:25:16 -0000
@@ -93,6 +93,7 @@
<xsl:template match="a[@name]">
<xsl:element name="{local-name(.)}"
namespace="http://www.w3.org/1999/xhtml">
<xsl:attribute name="id"><xsl:value-of
select="@name"/></xsl:attribute>
+ <xsl:attribute name="name"><xsl:value-of
select="@name"/></xsl:attribute>
<xsl:for-each select="@*">
<xsl:if test="local-name(.) != 'name'">
<xsl:attribute name="{name(.)}"><xsl:value-of
select="."/></xsl:attribute>

Discussion

  • Robert Stayton

    Robert Stayton - 2004-12-10

    Logged In: YES
    user_id=193218

    This patch can no longer be applied because the code has
    changed too much. Also, it is not good XHTML practice to
    output the same ID in both an id and name attribute.

     
  • Robert Stayton

    Robert Stayton - 2004-12-10
    • assigned_to: nobody --> bobstayton
    • status: open --> closed-out-of-date
     
  • Robert Stayton

    Robert Stayton - 2004-12-10

    Logged In: YES
    user_id=193218

    This patch can no longer be applied because the code has
    changed too much. Also, it is not good XHTML practice to
    output the same ID in both an id and name attribute.

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks