RE: (dsssl) "Default" processing rule? (summary of responses)

Subject: RE: (dsssl) "Default" processing rule? (summary of responses)
From: "Christopher R. Maden" <crism@xxxxxxxxx>
Date: Wed, 04 Apr 2001 00:19:26 -0700
At 12:50 3-04-2001, Wroth, Mark wrote:
I asked

[...]


and Christopher Maden replied

>Try something like
>
>(default (process-node-list (element-children)))

This solution does exactly what I was looking for. Thank you.

You're welcome.


As a result, I did not try to implement Peter Nilsson's suggestion

P> Couldn't you do a query on the subtree for the elements yoy want to
process
P> (the programlisting elements) and then use (process-node-list) to process
P> the result. Something like:
P> (process-node-list (q-element 'programlisting))
P> (untested.)

although that approach seems reasonable.

Peter's approach will be better in some situations. If there's really only one element type in which you're interested, and it's not likely to change, then his approach might be more efficient. (I'm not completely sure; depends whether walking the tree to collect the elements to process is better than walking the tree and deciding not to process the elements by matching construction rules.) It would probably be clearer to the reader. However, my approach works better, I think, if you're starting with "transparent" processing, and then slowly adding construction rules to get the desired effect. I'm more prone to work that way, so it's the response that immediately came to mind.


-Chris
--
Christopher R. Maden, XML Consultant
DTDs/schemas - conversion - ebooks - publishing - Web - B2B - training
<URL: http://crism.maden.org/consulting/ >
PGP Fingerprint: BBA6 4085 DED0 E176 D6D4  5DFC AC52 F825 AFEC 58DA


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


Current Thread