RE: Unregistered flow objects

Subject: RE: Unregistered flow objects
From: "Didier PH Martin" <martind@xxxxxxxxxxxxx>
Date: Thu, 1 Jul 1999 00:25:09 -0400
Hi Darell,

Darell said:
I'm not sure I fully understand what the purpose is of unregistered flow
objects. It seems that you make one declaration of them at the outset of
your DSSSL, then go about creating your file. How does Jade know how to
process them? And if it is as simple as a one line declaration, why aren't
they in Jade to begin with?

I am very new to DSSSL and I have been running into all sorts of problems. I
think the answer might be in a new flow object, but I just don't understand
them.

Didier Says:
Darell you touched something fundamental here. James wanted to distinguish
what's part of the official DSSSL specs and what is an extension that is not
part of the specification. This is why you have these annoying declarations.
This is a mechanism James found to tell an eventual alternative DSSSL
processor that this is an extension. However, the script would not work on
this alternative processor because it would not support these extensions.
There is actually a hole in DSSSL about the extension mechanism and ways to
use new domain languages based on XML.

DSSSL-2 could correct this situation if we include in the specs a mechanism
to allow extensions to the basic set of objects or more simply, to include
as the core set of objects, Flow objects like "element" etc...

Why?

When XSL work started, it came very soon to the table that the capability to
transform a XML document into a HTML document could allow the usage of HTML
object which are in a certain way formatting objects. Take for example the
HTML <P> element. There is an implicit rule present in most browsers on how
to render this element. The rule may differ a bit from browsers to browsers
but if you just take Netscape, Explorer and Opera, the element is rendered
about the same way. Thus, most of HTML objects are displayable objects (not
all, elements like "script" are not) . James, included the "element" flow
object to allow the creation of any SGML (and therefore XML) output. Because
HTML is also an SGML document, you can then output HTML elements. By
including this new Flow object, James also introduced the capability to do
transformation from one DTD to an other. From one document architecture to
an other.

So, actually the "element" flow object is not part of the DSSSL
specification document. If you search for it in this document, you won't
find it. The official DSSSL specification contains a certain set of flow
objects. By default, Openjade, is DSSSL-1 compliant. this means that the set
of valid objects is the set specified in the ISO document. In fact, to be
more precise, OpenJade support a subset not the full set. The DSSSL
extension declaration you include at the beginning of your DSSSL script are
kind of switches telling OpenJade that now, you include to the actual DSSSL
objects, some objects that are part of the extension set (not part of the
standard).

The official DSSSL specification lists a certain number of flow objects.
These are:
Sequence flow object class
Display-group flow object class
Simple-page-sequence flow object class
Page-sequence flow object class
Column-set-sequence flow object class
Paragraph flow object class
Paragraph-break flow object class
Line-field flow object class
Sideline flow object class
Anchor flow object class
Character flow object class
Leader flow object class
Embedded-text flow object class
Rule flow object class
External-graphic flow object class
Included-container-area flow object class
Score flow object class
Box flow object class
Side-by-side flow object class
Glyph-annotation flow object class
Alignment-point flow object class
Aligned-column flow object class
Multi-line-inline-note flow object class
Emphasizing-mark flow object class
Flow object classes for mathematical formulae
Flow object classes for tables
Flow object classes for online display

To these objects OpenJade adds new objects and these are:
element
empty-element
processing-instruction
document-type
entity
entity-ref
formatting-instruction

To tell the OpenJade engine to use these objects, you have to set the
interpretation switch to ON for these object (tell OpenJade that you want to
use them). YOu do this by including at the beginning of your script:
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")
(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)

These objects are quite powerful because they let you do something like
Tony's library (I encourage you to read the article talking about Tony's
library. You'll get the link form the OpenJade home page at:
http://www.netfolder.com/DSSSL/ the article is named: Simple XML to HTML
Conversion and Rendition Example, by Didier PH Martin) Tony made a procedure
that uses these extensions. Because of this you can create a very simple
SGML/XML document transformation into a HTML document. For example, you can
declare a DSSSL rule as follow:

(element par
    (make div

css-style:"font-family:helvetica,sanssherif;font-size:12pt;background-color:
#EEEEEE"
     )
)

This script fragment is in fact converted into:
(declare-flow-object-macro div
  ((align #f)
   (css-style #f)
   #!contents children)
  (make-element "div" children
		"align" align "style" css-style))

The make-element procedure uses the OpenJade extension set of objects like
the "element" object as shown below:
(define (make-element gi
		      #!optional (children (empty-sosofo))
		      #!rest attributes)
  (make element
    gi: gi
    attributes: (let loop ((attr-list attributes)
			   (result-list '()))
		  (if (null? attr-list)
		      result-list
		      (let ((name (car attr-list))
			    (value (cadr attr-list)))
			(if (and (string? name)
				 (string? value))
			    (append
			     (list (list name value))
			     (loop (cddr attr-list)
				   result-list))
			    (loop (cddr attr-list)
				  result-list)))))
    children))

Like I said, these extensions lead to very powerful capabilities. For
example, there are several languages actually based on XML. We call these
languages "domain languages". Take for instance, aural rendition, there are
several XML based languages like TalkML, SpeechML and their respective
interpreter that interpret a speechML or talkML document into speech. Thus,
we can design with the OPenJade extension a library (based on Tony's macro:
make-element) that encapsulate the speech domain language and then allows
DSSSL to have new speech flow objects. In fact, this extension is probably
the most powerful construct that OpenJade possess because it allows OpenJade
to be extended and then have new flow objects added to the basic core. To
take a last example, Actually, W3 is working on a new vector drawing
language based on XML. It is called SVG. Thus, if we use the OpenJade
extension (and therefore Tony's make-element procedure) we can design a
library allowing the transformation of a SGML or XML document into vector
drawing, or do a conversion from a XML or SGML based drawing language into
an other.

I hope I brought some more light on this not well known but powerful side of
OpenJade.

regards
Didier PH Martin
mailto:martind@xxxxxxxxxxxxx
http://www.netfolder.com


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


Current Thread