RE: Flow Object Macros for HTML 3.2

Subject: RE: Flow Object Macros for HTML 3.2
From: "Didier PH Martin" <martind@xxxxxxxxxxxxx>
Date: Thu, 28 Jan 1999 19:43:47 -0500
Hi Tony,

I'll try that and will give you feedback. At first sight, the code is more
lisible and reflect more the desired ouput structure. I also saw that I will
have to adapt the SGML kit to run the experimental extensions.

Didier PH Martin

-----Original Message-----
From: owner-dssslist@xxxxxxxxxxxxxxxx
[mailto:owner-dssslist@xxxxxxxxxxxxxxxx]On Behalf Of Tony Graham
Sent: Thursday, January 28, 1999 2:03 PM
To: dssslist@xxxxxxxxxxxxxxxx
Subject: Flow Object Macros for HTML 3.2

An experimental DSSSL module containing Flow Object Macros for each of
the elements in the HTML 3.2 DTD is available at

The current revision is 0.1.

Since I am ambivalent about the usefulness of this approach, I would
appreciate feedback on its use and suggestions for its improvement.
Obvious improvements include error checking of characteristic values
and allowing numeric characteristic values where appropriate.

This flow object macro technique could also be applied, for example,
to create macros for XSL's formatting objects, for the primitives of
texinfo markup, or for the elements in an arbitrary DTD.


The module declares flow object macros for the elements in the HTML
3.2 DTD.  Using these macros makes, or should make, reading and
writing stylesheets for HTML output easier.

For example, using the flow object macros to generate the HTML:

  <p><a href="#target">Link to a target</a></p>

the DSSSL code is:

  (make p
    (make a
      href: "#target"
      (literal "Link to a target")))

Without using the macros, the DSSSL code is:

  (make element
    gi: "p"
    (make element
      gi: "a"
      attributes: (list '("href" "#target"))
      (literal "Link to a target")))

As the first example shows, the flow object macro for each HTML
element behaves like a DSSSL flow object, and the attributes of the
HTML element are declared as characteristics of the HTML "flow

Since this is still an experimental release, note that:

a. All characteristics are optional

b. All characteristic values are strings

c. No sanity checking is performed on characteristic values, other
   than checking that values are strings.

d. If a characteristic is not declared or its value is not a
   string, the corresponding attribute will not appear in the HTML

e. Characteristics for all of the attributes of the HTML 3.2
   elements are declared, no matter how kludgy.


Since flow object macros are part of Jade's experimental
extensions, include the "-2" option in the Jade command line:

   jade -ccatalog -2 -t sgml -d style.dsl in.sgml > out.html


a. Declare the module as an entity in the internal subset of
   your stylesheet:

<!doctype style-sheet PUBLIC "-//James Clark//DTD DSSSL Style Sheet//EN" [
<!ENTITY html32fom.dsl SYSTEM "html32fom.dsl" CDATA DSSSL>

b. Wrap your DSSSL code in a <style-specification> element:

   <style-specification id="test" use="html32fom">
   (element ....)

c. Include an <external-specification> element for this module in
   your stylesheet:

   <external-specification id="html32fom" document="html32fom.dsl">

   The "use" attribute of the <style-specification> element must
   match the "id" attribute of the <external-specification>

   The "document" attribute of the <external-specification> element
   must match the name of the entity declared in the internal


This module includes in its comments the complete declarations from
the HTML 3.2 DTD.

The comments preceding each flow object macro declaration show both
the usage of the flow object macro and the HTML that is produced.

The following example show the comment containing the declarations
for the <BR> element, the usage and example output comment for the
br flow object macro, and the declaration for the br flow object
macro itself:

;; <!ELEMENT BR    - O EMPTY   -- forced line break -->
;;         clear (left|all|right|none) none -- control of text flow --
;;         >

;; (make br
;;   clear: "CLEAR")
;; => <br clear="CLEAR">
(declare-flow-object-macro br ((clear #f))
  (make-empty-element "br" "clear" clear))


Tony Graham
Tony Graham                            mailto:tgraham@xxxxxxxxxxxxxxxx
Mulberry Technologies, Inc.      
17 West Jefferson Street                    Direct Phone: 301/315-9632
Suite 207                                          Phone: 301/315-9631
Rockville, MD  20850                                 Fax: 301/315-8285
  Mulberry Technologies: A Consultancy Specializing in SGML and XML

 DSSSList info and archive:

 DSSSList info and archive:

Current Thread