This is the mail archive of the
docbook-apps@lists.oasis-open.org
mailing list .
Re: [Stylesheets] Adding a text the *first* timeyouencounter a given element?
- From: Jirka Kosek <jirka at kosek dot cz>
- To: Stephane Bortzmeyer <bortzmeyer at nic dot fr>
- Cc: docbook-apps at lists dot oasis-open dot org
- Date: Wed, 12 Feb 2003 16:30:52 +0100
- Subject: Re: DOCBOOK-APPS: [Stylesheets] Adding a text the *first* timeyouencounter a given element?
- References: <20030212152200.GA18823@nic.fr>
Stephane Bortzmeyer wrote:
>
> I have a custom element <rfc> to put references to RFC. I want to add
> a small blurb explaining how to get a RFC but, since there are many
> references to RFC in a given text, I want it to appear only the first
> time.
>
> I have no idea on how to do that. Both XSL and DSSSL are stateless so
> I cannot keep a "already_seen" variable.
But both XSL and DSSSL has query language, something which is not
available in LaTeX. Try something like:
<xsl:template match="rfc">
... process element ...
<xsl:if test="not(preceding::rfc)">
... stuff to appear when we are on a first occurence of rfc
element...
</xsl:if>
</xsl:template>
Jirka
--
-----------------------------------------------------------------
Jirka Kosek
e-mail: jirka@kosek.cz
http://www.kosek.cz