Re: some basic questions

Subject: Re: some basic questions
From: Chris Maden <crism@xxxxxxx>
Date: Fri, 10 Apr 1998 13:10:55 -0400
[W. Eliot Kimber]
> What Jade doesn't support is the query *feature* of the style
> language, which means that you can't use query construction
> rules. However, you can get around this by replacing the normal
> construction rules with a single default rule that uses a COND
> expression to apply queries to the current node, e.g.:
> 
> (default
>   (cond
>    ((query-function-one (current-node))
>      (make x))
>    ((query-function-two (current-node))
>      (make y))
>    (else
>      (process-children)))
> 
> It's ham fisted, but it works. I don't know how efficient it is
> (probably not very).

It's not very effective.  That rule is a default element construction
rule, and only applies to element nodes.  Those can easily be handled
by the regular element construction rules; indeed, if an applicable
element construction rule exists, the default rule won't be called at
all.

The times I've wished for the query feature, it's been to match non-
element nodes, like processing instructions and sdata entities.

-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
  • some basic questions
    • Jason Williams - from mail1.ability.netby web4-1.ability.net (8.8.5/8.6.12) with ESMTP id RAA26234Thu, 9 Apr 1998 17:10:29 -0400 (EDT)
      • Daniel Speck - from mail1.ability.netby web4-1.ability.net (8.8.5/8.6.12) with ESMTP id KAA11225Fri, 10 Apr 1998 10:07:16 -0400 (EDT)
      • <Possible follow-ups>
      • Reynolds, Gregg - from mail1.ability.netby web4-1.ability.net (8.8.5/8.6.12) with ESMTP id LAA12075Fri, 10 Apr 1998 11:28:43 -0400 (EDT)
      • W. Eliot Kimber - from mail1.ability.netby web4-1.ability.net (8.8.5/8.6.12) with ESMTP id MAA13136Fri, 10 Apr 1998 12:46:56 -0400 (EDT)
        • Chris Maden - from mail1.ability.netby web4-1.ability.net (8.8.5/8.6.12) with ESMTP id NAA13581Fri, 10 Apr 1998 13:11:02 -0400 (EDT) <=
      • Reynolds, Gregg - from mail1.ability.netby web4-1.ability.net (8.8.5/8.6.12) with ESMTP id SAA17954Fri, 10 Apr 1998 18:55:23 -0400 (EDT)
        • Chris Maden - from mail1.ability.netby web4-1.ability.net (8.8.5/8.6.12) with ESMTP id TAA18307Fri, 10 Apr 1998 19:28:41 -0400 (EDT)
          • Gregg Reynolds - from mail1.ability.netby web4-1.ability.net (8.8.5/8.6.12) with ESMTP id JAA04988Mon, 13 Apr 1998 09:59:55 -0400 (EDT)