Re: [Re: First Occurrence of an Element]

Subject: Re: [Re: First Occurrence of an Element]
From: Chris Maden <crism@xxxxxxx>
Date: Wed, 15 Apr 1998 10:51:32 -0400
[Chuck Darney]
> 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.
> Should a switch be set within the executed function to say that it's
> been done and it's not to be done again?

You can't do that; that's a side-effect.  Doesn't

(= (list-ref (element-number-list '("CHAPTER"
				    "SECTION")
				  (current-node))
	     1)
   1)

work to find the first SECTION in the current CHAPTER, regardless of
nesting?

If it doesn't work, can you explain what (element-number-list) does
return in various circumstances?

-Chris
-- 
<!NOTATION SGML.Geek PUBLIC "-//Anonymous//NOTATION SGML Geek//EN">
<!ENTITY crism PUBLIC "-//O'Reilly//NONSGML Christopher R. Maden//EN"
"<URL>http://www.oreilly.com/people/staff/crism/ <TEL>+1.617.499.7487
<USMAIL>90 Sherman Street, Cambridge, MA 02140 USA" NDATA SGML.Geek>


 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)