Re: sgml-parse

Subject: Re: sgml-parse
From: Brandon Ibach <bibach@xxxxxxxxxxxxxx>
Date: Tue, 19 Oct 1999 13:36:06 -0500
Quoting Pieter Rijken <pieter.rijken@xxxxxx>:
> I noticed that the resulting nodelist of a succesfull sgml-parse can be
> processed with 'process-node-list' but that other operations like,
> children, descendants, process-node-list, etc fail.
> Is this behaviour OpenJade specific, or according to the DSSSL
> standard, or is it left unspecified by DSSSL?
> 
   The reason that (children) and (descendants) return empty node
lists when applied to the result of (sgml-parse) is that the result is
a nodelist containing the "sgml-document" node which forms the root of
the grove.  By definition, this node has no children.  The
(process-children) procedure works around this by "pretending" that
the "document-element" property contains the single child of the
sgml-document.
   The following alternative to (children) duplicates this:
	(define kids (lambda (#!optional (nd (current-node)))
	  (if (equal? 'sgml-document (node-property 'class-name nd))
              (node-list-property 'document-element nd) (children nd))))

-Brandon :)


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


Current Thread
  • sgml-parse
    • Pieter Rijken - Tue, 19 Oct 1999 03:53:52 -0400 (EDT)
      • Brandon Ibach - Tue, 19 Oct 1999 14:30:58 -0400 (EDT) <=
      • <Possible follow-ups>
      • Pieter Rijken - Wed, 20 Oct 1999 03:25:36 -0400 (EDT)