(declare-flow-object-class element "UNREGISTERED::James Clark//Flow Object Class::element") (declare-flow-object-class empty-element "UNREGISTERED::James Clark//Flow Object Class::empty-element") (declare-flow-object-class document-type "UNREGISTERED::James Clark//Flow Object Class::document-type") (declare-flow-object-class entity "UNREGISTERED::James Clark//Flow Object Class::entity") (declare-flow-object-class entity-ref "UNREGISTERED::James Clark//Flow Object Class::entity-ref") (declare-flow-object-class formatting-instruction "UNREGISTERED::James Clark//Flow Object Class::formatting-instruction") (declare-characteristic preserve-sdata? "UNREGISTERED::James Clark//Characteristic::preserve-sdata?" #f) (define (empty-element? #!optional (nd (current-node))) (node-property 'must-omit-end-tag? nd) ) (define (element-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 (copy-element #!optional (node (current-node))) (if (empty-element? node) (make empty-element attributes: (element-attributes node)) (make element attributes: (element-attributes node)) ) ) (mode identity-transform (default (copy-element)) )