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] Appending image after xref (TOC vs. xref-to-suffix mode)

Hi Thomas,
I think you are understanding it correctly, and this seems to be a deficiency. I agree that the "xref-to-suffix" and "xref-to-prefix" modes should get the referrer element as a param, as well as xrefstyle like "xref-to" does.

Bob Stayton
Sagehill Enterprises

From: "Thomas Schraitle" <tom_schr@web.de>
Sent: Thursday, September 12, 2013 12:37 AM
To: <docbook-apps@lists.oasis-open.org>
Subject: [docbook-apps] Appending image after xref (TOC vs. xref-to-suffix mode)


I'm struggeling about the xref-to-suffix mode and how to use it

Let's assume I would like to append some image for all <xref/>s. One
solution could be to customize the xref template and insert the image
there. Depending on what you need and where, this could be more work
than it need to be, so I would like to avoid this.

Another solution could be to to write a template for the
"xref-to-suffix" mode (which does nothing by default):

 <xsl:template match="*" mode="xref-to-suffix">
    <!-- Add an image here -->

This works and would be exactly what I need. However, the image appears
also in the TOC. How can I avoid this? I would like to have the image
only inline inside paras.

Another issue:
If I understand it correctly, when I'm inside the "xref-to-suffix" mode
the current node is the "target node" (the element being referenced).
This confirms the following snippet from the <xref/> template:

 <xsl:when test="$target">
   <xsl:if test="not(parent::citation)">
      <xsl:apply-templates select="$target"

   <xsl:apply-templates select="$target" mode="xref-to">
      <xsl:with-param name="referrer" select="."/>
      <xsl:with-param name="xrefstyle" select="$xrefstyle"/>

   <xsl:if test="not(parent::citation)">
      <xsl:apply-templates select="$target"

So, if I need the @linkend from the xref for some reason, I have no
chance to get it, right? It seems, the xref-to-prefix and
xref-to-suffix modes need a referrer parameter as well as the xref-to

Or do I miss something? Thanks!

   Thomas Schraitle

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]