Re: [Re: First Occurrence of an Element]

Subject: Re: [Re: First Occurrence of an Element]
From: Daniel Speck <dspeck@xxxxxxxxxxxx>
Date: Wed, 15 Apr 1998 10:50:13 -0400
Chuck Darney wrote:

> These both work to find the lowest level of the element, but not just
> the first time it occurs.  I have an element SECTION.  It can and will
> ocuur throughout the instance.  There can be SECTIONs within
> SECTIONs...  What I need to do is execute a function the first time a
> SECTION element is encountered, but never again.

See section 12.2.4.2 "Counting" of the DSSSL Standard. You want the function
(element-number snl), e.g.,

(element section
    (if (= (element-number (current-node)) 1)
        ; something
        ; otherwise something else
    )
)

> Should a switch be set
> within the executed function to say that it's been done and it's not to
> be done again?
>

No, you can't do this in pure DSSSL because it is side-effect free.

-dan

--
Daniel Speck                              e-mail: dspeck@xxxxxxxxxxxx
Systems Engineer                           voice:     +1 301.548.7818
Thomson Technology Services Group            fax:     +1 301.527.4094
1375 Piccard Drive, Rockville, MD 20850      WWW:    www.thomtech.com



 DSSSList info and archive:  http://www.mulberrytech.com/dsssl/dssslist


Current Thread
  • Re: [Re: First Occurrence of an Element]
    • Chuck Darney - from mail1.ability.netby web4-1.ability.net (8.8.5/8.6.12) with ESMTP id KAA16349Wed, 15 Apr 1998 10:36:48 -0400 (EDT)
      • Chris Maden - from mail1.ability.netby web4-1.ability.net (8.8.5/8.6.12) with ESMTP id KAA16720Wed, 15 Apr 1998 10:51:00 -0400 (EDT)
      • Daniel Speck - from mail1.ability.netby web4-1.ability.net (8.8.5/8.6.12) with ESMTP id KAA16856Wed, 15 Apr 1998 10:54:21 -0400 (EDT) <=
      • Gregg Reynolds - from mail1.ability.netby web4-1.ability.net (8.8.5/8.6.12) with ESMTP id WAA24382Wed, 15 Apr 1998 22:47:00 -0400 (EDT)