This is the mail archive of the docbook-apps@lists.oasis-open.org mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Stylesheets] Adding a text the *first* timeyouencounter a given element?


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]