Subject: Flow Object Macros for HTML 3.2 From: Tony Graham <tgraham@xxxxxxxxxxxxxxxx> Date: Thu, 28 Jan 1999 14:02:44 -0500 (EST) |
An experimental DSSSL module containing Flow Object Macros for each of the elements in the HTML 3.2 DTD is available at ftp://ftp.mulberrytech.com/pub/dsssl/fom/html32fom.zip 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 object". 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 output e. Characteristics for all of the attributes of the HTML 3.2 elements are declared, no matter how kludgy. JADE COMMAND LINE 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 REFERENCING THE MODULE 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 ....) </style-specification> 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> element. The "document" attribute of the <external-specification> element must match the name of the entity declared in the internal subset. READING THE MODULE 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 --> ;; <!ATTLIST BR ;; 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)) Regards, Tony Graham ====================================================================== Tony Graham mailto:tgraham@xxxxxxxxxxxxxxxx Mulberry Technologies, Inc. http://www.mulberrytech.com 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: http://www.mulberrytech.com/dsssl/dssslist
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: Jade for AIX?, David Bolen | Thread | RE: Flow Object Macros for HTML 3.2, Didier PH Martin |
RE: Jade for AIX?, Didier PH Martin | Date | RE: The menu experiment, Peter Nilsson |
Month |