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
bobs@sagehill.net--------------------------------------------------
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)
> Hi,
>
> I'm struggeling about the xref-to-suffix mode and how to use it
> correctly.
>
> 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">
>
> </xsl:template>
>
> 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"
> mode="xref-to-prefix"/>
> </xsl:if>
>
> <xsl:apply-templates select="$target" mode="xref-to">
> <xsl:with-param name="referrer" select="."/>
> <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
> </xsl:apply-templates>
>
> <xsl:if test="not(parent::citation)">
> <xsl:apply-templates select="$target"
> mode="xref-to-suffix"/>
> </xsl:if>
> </xsl:when>
>
> 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
> mode.
>
> Or do I miss something? Thanks!
>
>
> --
> Gruß/Regards,
> 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>
>
>