Discussion:
PDF output should contain only the URL for ulinks
Lars Vogel
2014-06-02 07:11:19 UTC
Permalink
Hi,


I have the following statement in my Docbook 4.5 XML.
----------
You find it under the following URL: <ulink url="
http://www.eclipse.org/legal/clafaq.php">Eclipse CLA FAQ</ulink>.

---------

For PDF output I would like to include only the link and not the text. I
though the following might work but it didn't.

<xsl:template match="ulink">
<fo:inline font-style="italic">
<xsl:value-of select=".//ulink/@url" />
</fo:inline>
</xsl:template>

Any suggestions how to solve that?

Best regards, Lars
Frank Steimk
2014-06-02 17:19:34 UTC
Permalink
Hi Lars,
Are you sure that this template is called the way you want? I would add a
xsl:message to check this.

Regards, Frank
Post by Lars Vogel
Hi,
I have the following statement in my Docbook 4.5 XML.
----------
You find it under the following URL: <ulink url="
http://www.eclipse.org/legal/clafaq.php">Eclipse CLA FAQ</ulink>.
---------
For PDF output I would like to include only the link and not the text. I
though the following might work but it didn't.
<xsl:template match="ulink">
<fo:inline font-style="italic">
</fo:inline>
</xsl:template>
Any suggestions how to solve that?
Best regards, Lars
Bob Stayton
2014-06-02 17:50:49 UTC
Permalink
Hi Lars,
This custom template won't work as written. The context for the
template is the matched element, which is ulink. In the XPath statement
in the select attribute, the "." means the context element. So the
current statement is equivalent to this path:

<xsl:value-of select="ulink//ulink/@url"

Since the ulink does not contain a ulink as an descendant, that won't
select anything. Try:

select="./@url"

or just

select="@url"

Bob Stayton
Sagehill Enterprises
Post by Lars Vogel
Hi,
I have the following statement in my Docbook 4.5 XML.
----------
You find it under the following URL: <ulink url="
http://www.eclipse.org/legal/clafaq.php">Eclipse CLA FAQ</ulink>.
---------
For PDF output I would like to include only the link and not the text. I
though the following might work but it didn't.
<xsl:template match="ulink">
<fo:inline font-style="italic">
</fo:inline>
</xsl:template>
Any suggestions how to solve that?
Best regards, Lars
Lars Vogel
2014-07-31 09:09:56 UTC
Permalink
Thanks Bob, works fine. Here is the templates:

<xsl:template match="ulink">
<fo:inline font-style="italic">
<xsl:value-of select="@url" />
</fo:inline>
</xsl:template>


Best regards, Lars
Post by Frank Steimk
Hi Lars,
This custom template won't work as written. The context for the template
is the matched element, which is ulink. In the XPath statement in the
select attribute, the "." means the context element. So the current
Since the ulink does not contain a ulink as an descendant, that won't
or just
Bob Stayton
Sagehill Enterprises
Post by Lars Vogel
Hi,
I have the following statement in my Docbook 4.5 XML.
----------
You find it under the following URL: <ulink url="
http://www.eclipse.org/legal/clafaq.php">Eclipse CLA FAQ</ulink>.
---------
For PDF output I would like to include only the link and not the text. I
though the following might work but it didn't.
<xsl:template match="ulink">
<fo:inline font-style="italic">
</fo:inline>
</xsl:template>
Any suggestions how to solve that?
Best regards, Lars
Loading...