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]

[Stylesheets] Adding a text the *first* time youencounter a given element?


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.

To make things more concrete, here is the way I do it in LaTeX:

% The first time we mention a RFC, add a reference 
\newcounter{rfcfirst}
\newcommand{\rfc}[1]{RFC #1\ifthenelse{\boolean{rfcfootnote}}%
{\ifthenelse{\value{rfcfirst} = 0}%
   {\footnote{Pour voir le RFC de numéro NNN,
   \url{http://www.ietf.org/rfc/rfcNNN.txt}, par exemple
   \url{http://www.ietf.org/rfc/rfc#1.txt}}\stepcounter{rfcfirst}}%
   {}%
}%
{}%	
}






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