Re: Need help for the query example

Subject: Re: Need help for the query example
From: Peter Nilsson <pnidv96@xxxxxxxxxxxxxx>
Date: Wed, 21 Jul 1999 15:44:41 +0200 (CEST)
On Tue, 20 Jul 1999, Brandon Ibach wrote:

>    Right... if you want this rule to match *every* PI in the entire
> document, then (assuming that only PI's have systemData) something
> like the following should work:
> 	(query (node-list-filter
>                  (lambda (n) (node-property "systemData" n default: #f))
>                  (descendants (current-root)))
>                (construction-rule-here))
> 
>    Unless Jade (or whatever processor would be doing this) is quite
> clever, this would be a fairly inefficient process, of course, as it
> forces the engine to go through every node in the grove, checking for
> that property.  I'm not sure, offhand, if there is a better way to do
> this, but this should work, at least.
> 
I'm not sure if I remember correctly, but wouldn't
(q-class 'pi)
find all the PI:s? q-class is in 10.2.5. So
(query (q-class 'pi) (construction-rule))
would do construction-rule with every pi. Or
(query (node-list-filter
        (lambda (n)
         (is-what-you-want (node-property 'system-data n)))
        (q-class 'pi))
       (make paragraph
             (literal "One of my wanted pis: "
                      (node-property 'system-data
                                     (current-node)))))

(define (is-what-you-want str)
  ; Return a true value if the PIs system data is ok. (Note that str is a
string)
)

could maybe be the base for some example? I think this is correct (I've
tried to check with the standard), but it is hard to test it...

Regards,
/Peter Nilsson
--
'(?P . (?e . (?t . (?e . (?r)))))


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


Current Thread