Re: Repeated question on selection order

Subject: Re: Repeated question on selection order
From: MARK.WROTH@xxxxxxxxxxx (Wroth, Mark)
Date: Tue, 21 Dec 1999 15:12:01 -0800
Quoting Wroth, Mark <MARK.WROTH@xxxxxxxxxxx> (me):

> But I still have a theoretical question.  When I use the code
> 
> 	(with-mode continuation 
> 	  (make sequence 
> 	    (process-node-list 
> 	      (select-elements (descendants (document-element
> (current-node))) 
> 	        `(scrap (continues ,(attribute-string "id"))))))) 
> 
> I am guaranteed by the DSSSL specification (paragraph 12.4.3) that the
> process-node-list function will process the node list *in order*.
However,
> I can't tell from the text of 10.2.5 whether I can guarantee that
> select-elements will produce a node list in the order I desire (which is
the
> order the matching elements appear in the document instance).  The
practical
> examples I've run seem to indicate that Jade, at least, does so.  But
since
> a variation in the selection order would have ... interesting ...
> possibilities for introducing bugs into the output program source code,
I'd
> like to be sure that this is not mere coincidence.
> 

Brandon Ibach <bibach@xxxxxxxxxxxxxx> replies

BI>    Well, I can't say for sure, as the spec isn't real clear on this
BI> issue, but my money is that you'll find Jade's behavior to be the
BI> consistent model.
BI>    Node lists are (according to the intro to Chapter 10) inherently
BI> ordered, and the select-elements function is only supposed to filter
BI> the node-list.  For it to do anything more than that (including
BI> reordering it) would be outside of its specification, at least in my
BI> mind.
BI>    So, given that the descendants function, according to the spec,
BI> will always return the node list in tree order, you should be safe. :)

OK.  That's probably as good a guarantee as I'm likely to get, anyway.  And
there is always a fall back position (making the defining sections in
essence a linked list). 


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


Current Thread