Jade is an implementation of the DSSSL style language. The current version is 1.2.1.
For general information about DSSSL, see my DSSSL page.
You can discuss Jade and get help from other users on DSSSList, the DSSSL Users' Mailing List. I will announce new versions of Jade on DSSSList. To subscribe send mail to majordomo@mulberrytech.com with "subscribe dssslist" as the body of your message. To subscribe to the digest instead, the body should be "subscribe dssslist-digest". The list is archived.
Jade includes the following components:
The source is in the grove directory.
This is multi-threaded (on Win32 only at the moment): the grove can be accessed before it is complete and access to a property of a node will block until that property becomes available. This allows the style engine to produce output before it has read all the document.
The source is in the spgrove directory.
The source is in the style directory.
jade
, that combines the style
engine with the spgrove grove interface and five backends:
The source is in the jade directory.
Jade is licensed under the same terms as SP. This imposes almost no restrictions even for commercial use.
If you do use Jade in a commercial product, I would ask you, as a courtesy, to let me know about it and acknowledge the use of Jade.
If you're using Windows 95 or Windows NT, then you all you need is in the binary distribution.
Otherwise you will need to build it yourself from source. The Jade sources are available in two forms:
The distributions include the sources for a compatible version of SP (which may be different from the latest released version of SP).
Only Microsoft Visual C++ 6.0 is supported. To build using the Visual
Studio GUI, open the workspace jade.dsw
and build the
Win32 Release
configuration of the all
project. To build on the command line, ensure that the directory
containing msdev
is in your path, typically by executing
the command:
path C:/Program Files/Microsoft Visual Studio/Common/MSDev98/Bin;%path%
then run the command:
msdev jade.dsw /make "all - Win32 Release"
The following compilers should work:
Only the first has been tested by me.
If you use gcc 2.7.2 with -O on an x86 processor you must use -fno-strength-reduce. gcc 2.7.2.1 fixes this problem.
Edit Makefile
, then build with make
. Note
that you must use -DSP_MULTI_BYTE. If you plan to do any development,
also do make depend
.
Alternatively you can build using the experimental autoconf support.
Add the directory containing the jade binary to your path, change directory to the dsssl directory, and do
jade demo.sgm
If everything is working, there should be a well-formed
XML file demo.fot
created.
The system identifier of the document to be processed is specified as an argument to Jade. If this is omitted, standard input will be read.
Jade determines the system identifier for the DSSSL specification as follows:
-d
option is specified, it will use the
argument as the system identifier.
<?stylesheet href="sysid" type="text/dsssl">
stylesheet
, xml-stylesheet
or
xml:stylesheet
. The processing instruction will be
ignored unless the value of the type
attribute is one of
text/dsssl
, text/x-dsssl
,
application/dsssl
, or application/x-dsssl
.
The value of href
attribute is the system identifier of
the DSSSL specification.
<?dsssl sysid>
Although the processing instruction is only recognized in the prolog, it need not occur in the document entity. For example, it could occur in a DTD. The system identifier will be interpreted relative to where the the processing instruction occurs.
.dsl
.
A DSSSL specification document can contain more than one
style-specification.
If the system identifier of the DSSSL specification is followed
by #id
,
then jade will use the style-specification whose unique identifier is
id
.
This is allowed both with the -d
option and with
the processing instructions.
The DSSSL specification must be an SGML document
conforming to the DSSSL architecture.
For an example, see dsssl/demo.dsl
.
Jade supports the following options in addition to the normal SP options:
-d dsssl_spec
dsssl_spec
is the system
identifier of the DSSSL specification to be used.
-G
-t output_type
output_type
specifies the type of output as follows:
fot
rtf
rtf-95
rtf-95
produces output optimized for Word 95 rather than Word 97.
tex
sgml
xml
-o output_file
output_file
instead of
the default.
The default filename is the name of the last input file with its
extension replaced by the name of the type of output.
If there is no input filename, then the extension is added onto
jade-out
.
-V variable
(define variable #t)except that this definition will take priority over any definition of variable in a style-sheet.
Jade ignores the SP_CHARSET_FIXED and SP_SYSTEM_CHARSET environment variables and always uses Unicode as its internal character set, as if SP_CHARSET_FIXED was 1 and SP_SYSTEM_CHARSET was unset. Thus only the SP_ENCODING environment variable is relevant to Jade's handling of character sets.
The following external procedures are available. These external
procedures are defined by a prototype in the same manner as in the
standard. To use one of these external procedures, you must make use
of the standard external-procedure
procedure, using a
public identifier of "UNREGISTERED::James
Clark//Procedure::name"
where
name
is the name given here, typically by
including the following in the DSSSL specification:
(define name (external-procedure "UNREGISTERED::James Clark//Procedure::name"))
Note that external-procedure
returns #f
if
it doesn't know about the specified public identifier. You can use
this to enable your DSSSL specifications to work gracefully with other
implementations which do not support these extensions.
(debug obj)
Generates a message including the value of obj
and
then returns obj
.
(if-first-page sosofo1 sosofo2)
This can be used only in the specification of the value of one of the
header/footer characteristics of simple-page-sequence. It returns a
sosofo that will display as sosofo1
if the
page is the first page of the simple-page-sequence and as
sosofo2
otherwise.
(if-front-page sosofo1 sosofo2)
This can be used only in the specification of the value of one of the
header/footer characteristics of simple-page-sequence. It returns a
sosofo that will display as sosofo1
if the
page is a front (ie recto, odd-numbered) page and as
sosofo2
if it is a back (ie verso,
even-numbered) page
(all-element-number) (all-element-number osnl)
This is the same as element-number
except it counts
elements with any generic identifier. If osnl
is not an element returns #f, otherwise returns 1 plus the number of
elements that started before osnl
. This
provides an efficient way of creating a unique identifier for any
element in a document.
(read-entity string)
This returns a string containing the contents of the external entity
with system identifier string
. This should be
used only for textual entities (CDATA and SDATA), and not for binary
entities (NDATA).
This section describes the limitations of the front-end (the general-purpose DSSSL engine): each backend also has its own limitations.
Only the DSSSL Online subset of DSSSL is implemented with the following additions (all part of full DSSSL)
Note that only inherited characteristics that are applicable to some supported flow object can be specified.
Jade supports only a single, fixed grove plan which comprises the following modules:
It only supports a single pre-defined character repertoire. A
character name of the form U-XXXX
where
XXXX
are four upper-case hexadecimal digits,
is recognized as referring to the Unicode character with that code.
For many characters, it is also
possible to use the ISO/IEC 10646 name in lower-case with words
separated by hyphens.
Some common SDATA entity names from the ISO entity sets are recognized
and mapped to characters. In addition an SDATA entity name of the
form U-XXXX
, where
XXXX
are four upper-case hexadecimal digits,
is mapped to the Unicode character with that code.
Jade does not make use of any of the declaration architectural forms related to characters and glyphs.
The following style language declarations (as well as the non-DSSSL Online declarations) are ignored:
declare-char-characteristic+property declare-char-property add-char-properties define-language declare-default-language
Several things that it would be desirable to have checked aren't checked:
The following primitives are just stubs:
char-script-case
char-property
address-visited?
Only the following flow object classes are implemented:
sequence
character
paragraph
paragraph-break
line-field
display-group
simple-page-sequence
score
after
and through
rule
box
leader
external-graphic
notation-system-id:
a formal system
identifier whose storage manager is CLSID
and whose
storage object identifier is the COM CLSID (including surrounding
braces). The system identifier may also be just
<CLSID>
(that is, the storage object identifier may
be empty); in this case, the OLE default CLSID for the file (usually
chosen based on the file's extension) will be used.
link
table
table-part
table-column
table-row
table-cell
table-border
Many DSSSL characteristics cannot be implemented in RTF. The backend does the best it can.
In order to get correct page numbers in Microsoft Word, type the following after opening the document:
In Word Viewer 97, you must instead do:
The RTF backend supports some additional characteristics. To
use a characteristic named here as C
, declare
it using declare-characteristic
with the public
identifier:
"UNREGISTERED::James Clark//Characteristic::C"
heading-level
0
page-number-format
"1"
.
It applies to simple-page-sequence flow objects.
page-number-restart?
#f
.
It applies to simple-page-sequence flow objects.
page-n-columns
page-column-sep
.5in
.
It applies to simple-page-sequence flow objects.
page-balance-columns?
#f
.
It applies to simple-page-sequence flow objects.
superscript-height
subscript-depth
over-mark-height
under-mark-depth
grid-row-sep
grid-column-sep
The DTD for the XML generated is in dsssl/fot.dtd
.
Characteristics declared with declare-characteristic
are
not reported.
Flow objects of classes declared with declare-flow-object
are not reported.
Start with the following headers:
grove/Node.h style/FOTBuilder.h style/StyleEngine.h
If you find a bug in Jade, please take the time to report it. If Jade crashes on any input whatever, that's a bug and I want to hear about it. If Jade fails to process a specification that conforms to the DSSSL standard in the manner required by the DSSSL standard in a way that is not documented here as a current limitation nor is documented as an error in the proposed Technical Corrigendum to the DSSSL standard, that's a bug and I want to hear about it.
Please report bugs by email to me, jjc@jclark.com
. Do not
post them to comp.text.sgml nor to the sp-prog mailing list nor to the DSSSList
mailing list.
I do not want to get bug reports about documented limitations, so please read the list of limitations carefully. However, feel free to let me know which of the current limitations you would most like to see addressed.
I also at this stage do not want to hear about bugs in your C++ compiler that prevent it from compiling Jade: if your compiler refuses to compile Jade, I want to hear about it only if
Before reporting a bug, please check that your version is current.
The most important thing in reporting a bug is to include a complete set of files on which I can run jade and reproduce the problem. Include all DTDs that you use, whether or not they are standard. Also tell me what command line I should use, and what is incorrect about the behaviour of jade. If the files are large package them up as a tar or zip file and upload them to ftp://ftp.jclark.com/incoming.
It is useful if you have a fix for a bug, but please don't delay sending in the bug while you work on a fix and don't send in a fix without giving me the files to reproduce the bug it fixes.
Here are some ways you can contribute to Jade:
James Clark