|
Subject: Re: First Occurrence of an Element From: Chris Maden <crism@xxxxxxx> Date: Tue, 14 Apr 1998 16:51:04 -0400 |
[Chuck Darney]
> Is it possible to know when the first occurrence of an element
> exists? I would like to be able to affect only the first occurrence
> of say the SECTION element.
If they're always on the same level, you can use (child-number):
(= (child-number (current-node))
1)
If they can occur at any level, you can use (element-number-list):
(= (list-ref (element-number-list '("CONTAINER"
"SECTION")
(current-node))
1)
1)
(Now, try finding the first one in the container with a given
attribute name/value pair, as mandated by our house style for cross-
references. Now *that* was fun.)
-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 |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| First Occurrence of an Element, Chuck Darney | Thread | Re: First Occurrence of an Element, James Clark |
| First Occurrence of an Element, Chuck Darney | Date | Re: First Occurrence of an Element, James Clark |
| Month |