This is the mail archive of the
docbook@lists.oasis-open.org
mailing list for the DocBook project.
Re: Creating a transformation into an <a href>
- To: docbook at lists dot oasis-open dot org
- Subject: DOCBOOK: Re: Creating a transformation into an <a href>
- From: Norman Walsh <ndw at nwalsh dot com>
- Date: Wed, 22 Mar 2000 05:48:44 -0500
- CC: dlparker at facstaff dot wisc dot edu
- References: <4.2.2.20000321142327.00aadcd0@facstaff.wisc.edu>
- Reply-To: docbook at lists dot oasis-open dot org
[Please don't crosspost articles over multiple mailing lists.]
/ David Parker <dlparker@facstaff.wisc.edu> was heard to say:
| Attempting to grab the url attribute from a <ulink> node (DocBook XML file).
| The click able text is added on at the end of the parent node <para>.
[...]
| <!--================================================================-->
| <!-- Template for the <ulink> tag -->
| <!--================================================================-->
| <xsl:template match="ulink">
| <xsl:param name="link"><xsl:value-of select="."/></xsl:param>
| <a href="{$link}">
| <xsl:apply-templates select="citetitle"/>
| </a>
| </xsl:template>
Without seeing more of your templates (particularly para), I can't quite
see why it's doing what it's doing, but the tempate for ulink is almost
certainly wrong. (Have you tried running your document through my XSL
stylesheets for DocBook: http://nwalsh.com/docbook/xsl/).
Try:
<!--================================================================-->
<!-- Template for the <ulink> tag -->
<!--================================================================-->
<xsl:template match="ulink">
<a href="{@url}">
<xsl:apply-templates/>
</a>
</xsl:template>
And this looks like a better answer, too:
<!--================================================================-->
<!-- Template for the <citetitle> tag -->
<!--================================================================-->
<xsl:template match="citetitle">
<xsl:apply-templates/>
</xsl:template>
Be seeing you,
norm
--
Norman Walsh <ndw@nwalsh.com> | Optimistic, even in the face of
http://www.oasis-open.org/docbook/ | reality.
Chair, DocBook Technical Committee |