Re: passthrough and empty elements.

Subject: Re: passthrough and empty elements.
From: Joerg Wittenberger <Joerg.Wittenberger@xxxxxxxxx>
Date: Wed, 1 Dec 1999 19:04:22 +0100 (CET)
> I have a style sheet that produces another sgml document in order to
> run it through a second style sheet, both using jade. One of the
> constructions in the first style sheet is:
...
> However, for empty elements this does not work. The second pass

Here a working version:

(define (output-element #!optional (node (current-node)))
  (if (node-property "must-omit-end-tag?" node)
      (make empty-element
	attributes: (copy-attributes))
      (make element
	attributes: (copy-attributes))))

(define (copy-attributes #!optional (nd (current-node)))
  (let loop ((atts (named-node-list-names (attributes nd))))
    (if (null? atts)
	'()
	(let* ((name (car atts))
	       (value (attribute-string name nd)))
	  (if value
	      (cons (list name value)
		    (loop (cdr atts)))
	      (loop (cdr atts)))))))

/Jerry

-- 
        You can have it done fast,
        you can have it done cheap,
        and you can have it done well.
        --- But you can only have two of those at once.


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


Current Thread