[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Re: [docbook-apps] Antwort: Re: [docbook-apps] DocBook 5 - differentcolor for hyperlinks in PDF output
If this is DocBook 5.0, aren't you missing the default DocBook 5.0
namespace?
xmlns="http://docbook.org/ns/docbook"
So in your stylesheet you would need:
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0" xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:fo="http://www.w3.org/1999/XSL/Format"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns="http://docbook.org/ns/docbook"
exclude-result-prefixes="#default">
<!-- macht die externen links in pdfs blau, xrefs gr�n, see also links
in glossaries grau -->
<xsl:attribute-set name="xref.properties">
<xsl:attribute name="color">
<xsl:choose>
<xsl:when test="self::link and @linkend">grey</xsl:when>
<xsl:when test="self::link and
@xlink:href">blue</xsl:when>
<xsl:when test="self::xref and
@linkend">green</xsl:when>
<xsl:when test="self::glossseealso and
@otherterm">grey</xsl:when>
<xsl:otherwise>black</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
</xsl:attribute-set>
Best regards,
--Scott
On 17-Dec-09 7:22 AM, benno.wolf@gi-de.com wrote:
>
> I am sorry, but I tried that in every possible constellation and with
> every xpath-expression known to man (me ;-) and it seems that every
> element and attribute can be resolved with the exeption of exactly the
> xlink:href-attribute.
> Have a look at this:
>
> <!-- macht die externen links in pdfs blau, xrefs gr�n, see also links
> in glossaries grau -->
> <xsl:attribute-set name="xref.properties">
> <xsl:attribute name="color">
> <xsl:choose>
> <xsl:when test="self::link and @linkend">grey</xsl:when>
> *<xsl:when** test=**"self::link and @xlink:href"**>**blue**</xsl:when>*
> <xsl:when test="self::xref and @linkend">green</xsl:when>
> <xsl:when test="self::glossseealso and @otherterm">grey</xsl:when>
> <xsl:otherwise>black</xsl:otherwise>
> </xsl:choose>
> </xsl:attribute>
> </xsl:attribute-set>
>
> What am I missing? Is it a namespace-problem with xlink: ? I put the
> namespace on top of my customization layer:
>
>
> <?xml version="1.0"?>
> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> version="1.0" xmlns:dc="http://purl.org/dc/elements/1.1/"
> xmlns:fo="http://www.w3.org/1999/XSL/Format"
> xmlns:xlink="http://www.w3.org/1999/xlink"
> exclude-result-prefixes="#default">
>
> What is wrong?
>
> Regards,
> Benno
>
>
>
>
> *Johannes Katelaan <jk@e-integration.de>*
>
> 04.12.2009 10:28
>
>
> An
> Bob Stayton <bobs@sagehill.net>
> Kopie
> <docbook-apps@lists.oasis-open.org>
> Thema
> Re: [docbook-apps] DocBook 5 - different color for hyperlinks in PDF output
>
>
>
>
>
>
>
>
> Yes, correct. So the DocBook-5-Version would be as follows:
>
> <xsl:attribute-set name="xref.properties">
> <xsl:attribute name="color">
> <xsl:choose>
> <xsl:when test="self::d:link and @xlink:href">blue</xsl:when>
> <xsl:otherwise>inherit</xsl:otherwise>
> </xsl:choose>
> </xsl:attribute>
> <xsl:attribute name="text-decoration">
> <xsl:choose>
> <xsl:when test="self::d:link and @xlink:href">underline</xsl:when>
> <xsl:otherwise>inherit</xsl:otherwise>
> </xsl:choose>
> </xsl:attribute>
> </xsl:attribute-set>
>
> Thanks!
>
> Johannes
>
> Am 03.12.2009 um 18:02 schrieb Bob Stayton:
>
> > Yes, xref.properties usually affects all links. However, an
> xsl:choose statement inside the attribute body can be more selective, as
> the example in the referenced documentation shows.
> >
> > Bob Stayton
> > Sagehill Enterprises
> > bobs@sagehill.net
> >
> >
> > ----- Original Message ----- From: "Johannes Katelaan"
> <jk@e-integration.de>
> > To: "Bob Stayton" <bobs@sagehill.net>
> > Cc: <docbook-apps@lists.oasis-open.org>
> > Sent: Thursday, December 03, 2009 8:58 AM
> > Subject: Re: [docbook-apps] DocBook 5 - different color for
> hyperlinks in PDF output
> >
> >
> > Hi Bob,
> >
> > it's intended only for external links. I'm creating internal links
> using olink. These must not be affected by this customization. So I
> think I may not use xref.properties. Is this correct?
> >
> > Regards
> >
> > Johannes
> >
> > Am 03.12.2009 um 17:47 schrieb Bob Stayton:
> >
> >> Hi,
> >> The attribute-set named 'xref.properties' is available to add
> properties like color to links. See this reference:
> >>
> >> http://www.sagehill.net/docbookxsl/CustomXrefs.html#CustomXrefStyle
> >>
> >> However, it isn't clear from your message if you indent this for all
> links or only links to external documents.
> >>
> >> Bob Stayton
> >> Sagehill Enterprises
> >> bobs@sagehill.net
> >>
> >>
> >> ----- Original Message ----- From: "Johannes Katelaan"
> <jk@e-integration.de>
> >> To: <docbook-apps@lists.oasis-open.org>
> >> Sent: Thursday, December 03, 2009 5:47 AM
> >> Subject: [docbook-apps] DocBook 5 - different color for hyperlinks
> in PDF output
> >>
> >>
> >>> Hi,
> >>>
> >>> how can I change the color of hyperlinks created with
> >>> <link xlink:href="some url">text I want in different color</link>
> >>>
> >>> Johannes
> >>>
> >>>
> >>>
> >>> ---------------------------------------------------------------------
> >>> To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.org
> >>> For additional commands, e-mail: docbook-apps-help@lists.oasis-open.org
> >>>
> >>>
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.org
> >> For additional commands, e-mail: docbook-apps-help@lists.oasis-open.org
> >>
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.org
> > For additional commands, e-mail: docbook-apps-help@lists.oasis-open.org
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.org
> For additional commands, e-mail: docbook-apps-help@lists.oasis-open.org
>
>
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]