passthrough and empty elements.

Subject: passthrough and empty elements.
From: Jon Haugsand <Jon.Haugsand@xxxxx>
Date: 01 Dec 1999 12:48:10 +0100
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:

(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)))))))

(define (pass-through #!optional (nd (current-node)))
  (make element
	gi: (gi nd)
	attributes: (copy-attributes nd)))


(default (pass-through))

However, for empty elements this does not work. The second pass
complains:

jade:hb-unfold.sgml:6080:0:E: end tag for element "BR" which is not open

BR is defined as in HTML:

<!ELEMENT BR    - - EMPTY    -- forced line break -->

The pass-through construction makes an end tag to this element. Is
there any way to know from a node whether this is an empty tag or not?

-- 
Jon Haugsand
  Norwegian Computing Center, <http://www.nr.no/engelsk/> 
  <mailto:Jon.Haugsand@xxxxx>  Pho: +47 22852608 / +47 22852500, 
  Fax: +47 22697660, Pb 114 Blindern, N-0314 OSLO, Norway


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


Current Thread