Re: Filtering nodes on other attributes

Subject: Re: Filtering nodes on other attributes
From: Brandon Ibach <bibach@xxxxxxxxxxxxxx>
Date: Sat, 6 May 2000 16:51:22 -0500
Quoting Gary Lawrence Murphy <garym@xxxxxxxxxx>:
> I'd like to filter a document printout to only include chapters with
> specific attribute values; I'd hoped this would be as easy as
> giving the command
> 
>     jade -V STATUS=review tex book.sgml
> 
> And having my local stylesheet include
> 
   What's really needed, here, is a way to "catch" the processing when
it gets to each chapter.  In dbcompon.dsl of the print stylesheets,
you will find a line like:

	(element chapter ($component$))

This tells DSSSL to call the $component$ procedure whenever it has to
process a <chapter>.  The $component$ procedure will return a SOSOFO
for the chapter.  So, you just need to override the above line with an
element rule that will only call $component$ for matching chapters.
This would be placed into your customization layer (which is, I
assume, what you mean by "local stylesheet").

   Something like this should work:

	(element chapter
	  (if (equal? STATUS (attribute-string "status"))
	      ($component$) (empty-sosofo)))

   With something like this, you want to avoid any (process-*)
constructs, as that would alter the processing flow of the
stylesheets, and given the complexity of the Docbook stylesheets, you
probably do not want to go there. :)

-Brandon :)


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


Current Thread