This is the mail archive of the
docbook-apps@lists.oasis-open.org
mailing list .
Re: [docbook-apps] xalan and ulink
- From: Bob Stayton <bobs at sco dot com>
- To: Marius Scurtescu <mscurtescu at healthmetrx dot com>
- Cc: Docbook-Apps <docbook-apps at lists dot oasis-open dot org>
- Date: Mon, 20 Oct 2003 16:00:56 -0700
- Subject: Re: [docbook-apps] xalan and ulink
- References: <INEPKANEJCBOPHOOJHNEKENPCIAA.mscurtescu@healthmetrx.com>
On Mon, Oct 20, 2003 at 03:59:01PM -0700, Marius Scurtescu wrote:
> Hi,
>
> I brought this issue up the other week and I am
> mentioning it again just for the record.
>
> Using Xalan 2.5.1 under Win2K and the 1.62.4
> XHTML stylesheets will generate broken <a>
> tags. The HTML stylesheets do not have this
> problem, quite strange since the template converting
> the ulink to an <a> tag is almost the same.
>
> The problem seems to be with the generation of the
> <a> tag into a temporary variable, it is at this
> stage that it gets broken. The ulink template is
> in the xref.xsl file.
>
> I tried all kind of permutations and changes to
> the template without success. It looks like the
> first attribute of the <a> tag will always have
> both the name and value missing ( ="").
>
> This is a known bug of Xalan, here is the report:
> http://nagoya.apache.org/bugzilla/show_bug.cgi?id=22564
>
> I will let you know if a future version fixes this.
Well, I can confirm that this same bug manifests
itself on Linux as well, and it also appears
in version 2.4.1 of Xalan. The difference between
the html and xhtml versions must be because the
output type is "xml" rather than "html". The
bug must be in the xml serializer.
It does indeed appear to be the diversion into a
variable that is the problem for Xalan. This customization
eliminates the variable (it is useful only when Saxon
is the processor, using a saxon extension):
<xsl:template match="ulink" name="ulink">
<a>
<xsl:if test="@id">
<xsl:attribute name="id">
<xsl:value-of select="@id"/>
</xsl:attribute>
</xsl:if>
<xsl:attribute name="href"><xsl:value-of select="@url"/></xsl:attribute>
<xsl:if test="$ulink.target != ''">
<xsl:attribute name="target">
<xsl:value-of select="$ulink.target"/>
</xsl:attribute>
</xsl:if>
<xsl:choose>
<xsl:when test="count(child::node())=0">
<xsl:value-of select="@url"/>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates/>
</xsl:otherwise>
</xsl:choose>
</a>
</xsl:template>
--
Bob Stayton 400 Encinal Street
Publications Architect Santa Cruz, CA 95060
Technical Publications voice: (831) 427-7796
The SCO Group fax: (831) 429-1887
email: bobs@sco.com
To unsubscribe from this list, send a post to docbook-apps-unsubscribe@lists.oasis-open.org, or visit http://www.oasis-open.org/mlmanage/.