Re: (dsssl) RE: (dsssl) siblings

Subject: Re: (dsssl) RE: (dsssl) siblings
From: Brandon Ibach <bibach@xxxxxxxxxxxxxx>
Date: Thu, 28 Feb 2002 10:49:54 -0600
Quoting DPawson@xxxxxxxxxxx <DPawson@xxxxxxxxxxx>:
> My confusion was primarily because I expected an element count,
> I'd forgotten that chars were also included in the node count.
>  Hence my confusion, made worse by the fact that having (or not having)
> a DTD in use makes a difference to the result.
   A quick solution for getting just the elements would be to wrap the
(siblings) call with something like:

        (select-by-class (siblings) 'element)

   I don't recall what the support for (select-by-class) is in various
versions of Jade/OpenJade, so here's an off-the-top-of-my-head,
completely-untested implementation:

        (define (select-by-class nl sym)
          (node-list-filter (lambda (snl) (member sym
                                (list (node-property 'classnm snl)
                                  (node-property 'classnm snl rcs?: #t))))

   If you're missing node-list-filter, there's an implementation in
the standard (or the procedure library, I'm sure).

-Brandon :)

 DSSSList info and archive:

Current Thread