Subject: RE: searching for closest previous element From: "Reynolds, Gregg" <greynolds@xxxxxxxxxxxxxx> Date: Wed, 18 Mar 1998 17:14:00 -0600 |
You might also try using functions from the "Counting" section, 10.2.4.2, p.144. 1. Use (element-number-list '("Y") (current-node)) to get the number k of Y elements in the entire grove preceding the current node. 2. Use select-elements to gather all the Y elements in a node list Ynl. 3. Use (node-list-ref Ynl k) to get at the desired Y element. Haven't tested it so I don't know how fast it would be but it should do the trick while avoiding recursive searches. -gr > -----Original Message----- > From: stephenng@xxxxxxxxxxxx [SMTP:stephenng@xxxxxxxxxxxx] > Sent: Wednesday, March 18, 1998 5:58 AM ... > When handling element "X", I would like to find the closest previous > occurrence of element "Y" in the document, because I need to look up > some attribute of element "Y". For perverse reasons, elements "X" > and "Y" can occur anywhere in the document, at any level, so the > occurrence of "Y" that I need to look up would be the closest > previous element if you flattened the whole tree. > > I have a routine to do this, but it's really really slow. ... DSSSList info and archive: http://www.mulberrytech.com/dsssl/dssslist
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: searching for closest previous , stephenng | Thread | RE: The DSSSList Digest V1 #262, WROTH, MARK B |
Re: modular docbook stylesheets spe, Norman Walsh | Date | RE: modular docbook stylesheets spe, Frank A. Christoph |
Month |