Jade does not support the DSSSL Transformation Language. However, it provides some simple, non-standardized extensions to the DSSSL Style Language that allow it to be used for SGML transformations.
These extensions are used in conjunction with the SGML backend which is selected with the -t sgml option. Unlike other backends, the SGML backend writes its output to the standard output.
The extensions consist of a collection of flow object classes that are used instead of the standard DSSSL-defined flow object classes:
element
empty-element
element
flow object is a compound flow object (one that
can have child flow objects). Both a start-tag and an end-tag are
generated for this flow object. The empty-element
is an
atomic flow object (one that cannot have child flow objects). Only a
start-tag is output for this. It should should be used for elements
with a declared content of EMPTY or with a content reference
attribute.
Both of these flow objects support the following non-inherited
characteristics:
gi
attribute
processing-instruction
data
document-type
name
system-id
public-id
Each of these flow object classes must be declared using
declare-flow-object-class
in any DSSSL specification that
makes use of it.
A suitable set of declarations is:
(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 processing-instruction "UNREGISTERED::James Clark//Flow Object Class::processing-instruction")
Here's a simple example that does the identity transformation:
<!doctype style-sheet PUBLIC "-//James Clark//DTD DSSSL Style Sheet//EN"> (declare-flow-object-class element "UNREGISTERED::James Clark//Flow Object Class::element") (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))))))) (default (make element attributes: (copy-attributes)))
Note that this does not deal with empty elements nor processing instructions, nor does it include a doctype declaration.
James Clark