Subject: Re: default element construction rule From: Chris Maden <crism@xxxxxxx> Date: Mon, 16 Mar 1998 15:05:01 -0500 |
[Steve] > I'm feeding Jade some HTML, and would like to it to emit stuff only > for elements I'm interested in. For example, I'd like it to only > print out all <H1> text. Unfortunately, by default, it spits > something out for every character in the HTML document. One way to > get what I want would be to create an element construction rule for > all the elements other than the ones I want, and have them generate > (empty-sosofo). But that seems like a lot of work. > > I've tried changing the default element construction rule, but > > (default (empty-sosofo)) > > winds up killing all my output, even if I have a more specific > construction rule for H2. I change the default rule to: (default (process-node-list (element-children))) ;; (element-children) returns the children of a node of class element. (define (element-children #!optional (snl (current-node))) (node-list-filter (lambda (node) (equal? (node-property 'class-name node) 'element)) (children snl))) -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 -> |
---|---|---|
default element construction rule, stephenng | Thread | RE: default element construction ru, Reynolds, Gregg |
default element construction rule, stephenng | Date | RE: default element construction ru, Reynolds, Gregg |
Month |