OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]

Subject: Re: [docbook-apps] Antenna House XSLFormatter and internal links (xref)

I traced this problem to what may be a difference of interpretation of the
XSL-FO spec.  The anchor element is converted by the FO stylesheet to an
empty fo:wrapper element with an id attribute.  This works as an internal
xref target in FOP and XEP, but not in XSL Formatter.  If I change the
anchor template to output an empty fo:inline instead, then it works.  You
can make that customization in your stylesheet:

<xsl:template match="anchor">
  <fo:inline id="{@id}"/>

You might also write to Antenna House and ask them about whether an empty
wrapper should serve as a valid target for a cross reference.  Since it does
accept an id attribute, I would think it should.

Bob Stayton
Sagehill Enterprises
DocBook Consulting

----- Original Message ----- 
From: "Marco Baumgartl" <Marco_Baumgartl@yahoo.de>
To: <docbook-apps@lists.oasis-open.org>
Sent: Monday, February 14, 2005 10:22 AM
Subject: [docbook-apps] Antenna House XSLFormatter and internal links (xref)

> Hallo,
> I use XSLT to convert HTML (from a CMS) to DocBook. This seems to work
> great so far. I can produce HTML, HTML Help and PDF (with Apache's FOP
> renderer) using my created DocBook file.
> Today I tried an another renderer (evaluation version of XSLFormatterV3
> from Antenna House, Version 3,2,2005,0111 MR2). I noticed that my way of
> creating links does not work with this renderer (but with FOP it does).
> Here is the part of my stylesheet that produces the link:
> <xsl:template match="a">
>    <xsl:if test="@href">
>      <xsl:choose>
>        <xsl:when test="starts-with(@href, 'http') or starts-with(@href,
> 'ftp') or starts-with(@href, 'mailto')">
>          <ulink url="{@href}"><xsl:value-of select="." /></ulink>
>        </xsl:when>
>        <xsl:otherwise>
> <!-- insert a dummy element (i.e. anchor's text child produces no
> output) we can use to refer to in xref's attribute 'endterm' (to produce
> some output) -->
>          <anchor>
>            <xsl:attribute name="id">
>              <xsl:value-of select="generate-id(@href)" />
>            </xsl:attribute>
>            <xsl:value-of select="." />
>          </anchor>
>          <xref>
>            <xsl:attribute name="linkend">
>              <xsl:value-of select="substring-after(@href, '#')" />
>            </xsl:attribute>
>            <xsl:attribute name="endterm">
>              <xsl:value-of select="generate-id(@href)" />
>            </xsl:attribute>
>          </xref>
>        </xsl:otherwise>
>      </xsl:choose>
>    </xsl:if>
>    <xsl:if test="@name">
>      <xsl:value-of select="text()" />
>      <anchor>
>        <xsl:attribute name="id">
>          <xsl:value-of select="@name" />
>        </xsl:attribute>
>      </anchor>
>    </xsl:if>
> </xsl:template>
> I use a dummy anchor element to create a (hidden) output which I can
> refer to in xref's endterm attribute. As I mentioned before, this
> solution works well with FOP, but the XSLFormatter does nothing if I
> click on an internal link (external links (ulink) work fine).
> I don't know what the problem is or where to look for a solution.
> Can anybody give me a hint?
> regards
> Marco
> PS: The files are transformed with Saxon 6.5.3 (JDK 1.4.2-06) and
> DocBook stylesheets 1.68.1 under Win2000.

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]