OPENJADE(1)
π OPENJADE π β the openjade(1) manual, but make it make sense π
okay bestie, buckle up, because this is the openjade page and she is long. we're in part 1 of 2, so hydrate and stay with me π«Ά
β¨ NAME β¨
openjade β apply a DSSSL stylesheet to an SGML or XML document. literally that's the whole job. iconic.
πΈ SYNOPSIS πΈ
openjade [-vCegG2s] [-b encoding] [-f error_file]
[-c catalog_sysid] [-D dir] [-a link_type]
[-A arch] [-E max_errors] [-i entity]
[-w warning_type] [-d dsssl_spec] [-V variable=value]
[-t output_type] [-o output_file] [sysid...]
π DESCRIPTION π
so openjade is an implementation of the ISO/IEC 10179:1996 standard DSSSL language. no cap. the DSSSL engine takes an SGML or XML document as input and transforms it into formats like:
- An XML representation of the flow object tree.
- RTF format that can be rendered and printed with Microsoft's free Word Viewer 97.
- TeX format.
- MIF format that can be rendered and printed with Framemaker.
- SGML or XML format. This is used in conjunction with non-standard flow object classes to generate SGML, thus allowing
openjadeto be used for SGML/XML transformations.
The system identifier of the document to be processed is specified as an argument to openjade. If this is omitted, standard input will be read. (yes bestie, stdin, she's flexible like that π
)
π¦ how openjade figures out the DSSSL system identifier π¦
this is the part where she goes hunting for the spec. here's the order of operations, fr fr:
- If the
-doption is specified, it will use the argument as the system identifier. - Otherwise, it will look for processing instructions in the prolog of the document. Two kinds of processing instruction are recognized:
<?stylesheet href="sysid" type="text/dsssl">
The system data of the processing instruction is parsed like an SGML start-tag. It will be parsed using the reference concrete syntax whatever the actual concrete syntax of the document. The name that starts the processing instruction can be either 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>
The system identifier is the portion of the system data of the processing instruction following the initial name and any whitespace.
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.
- Otherwise, it will use the system identifier of the document with any extension changed to
.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 openjade will use the style-specification whose unique identifier is id. This is allowed both with the -d option and with the processing instructions. (pick your fave by name, she'll respect it π)
The DSSSL specification must be an SGML document conforming to the DSSSL architecture. For an example, see dsssl/demo.dsl.
π OPTIONS π
openjade supports the following options in addition to the normal OpenSP (see onsgmls(1)) options. and listen β all options are case-sensitive, ie -g and -G are different options. she does NOT play about case. π
-ddsssl_spec β This specifies that dsssl_spec is the system identifier of the DSSSL specification to be used.-Gβ Debug mode. When an error occurs in the evaluation of an expression,openjadewill display a stack trace. Note that this disables tail-call optimization.-cfilename β The filename arguments specify catalog files rather than the document entity. The document entity is specified by the firstDOCUMENTentry in the catalog files.-sβ Strict compliance mode. Currently the only effect is thatjadedoesn't use any predefined character names, sdata-entity mappings or name-characters. This is useful for checking that your stylesheet is portable to other DSSSL implementations and that it is strictly compliant to the DSSSL specifications.-toutput_type β output_type specifies the type of output as follows:fotβ An XML representation of the flow object tree.rtfrtf-95β RTF (used for SGML/XML to RTF transformations) Microsoft's Rich Text Format.rtf-95produces output optimized for Word 95 rather than Word 97.texβ TeX (used for SGML/XML to TeX transformations)sgmlsgml-rawβ SGML (used for SGML/XML to SGML transformations).sgml-rawdoesn't emit linebreaks in tags.xmlxml-rawβ XML (used for SGML/XML to XML transformations).xml-rawdoesn't emit linebreaks in tags.htmlβ HTML (used for SGML/XML to HTML transformations)mifβ MIF (used for SGML/XML to MIF transformations)
-ooutput_file β Write output to 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 ontojade-out.-Vvariable β This is equivalent to doing(define variable #t)except that this definition will take priority over any definition of variable in a style-sheet.-Vvariable=value β This is equivalent to doing(define variable "value")except that this definition will take priority over any definition of variable in a style-sheet.-V(define variable value)β This is equivalent to doing(define variable value)except that this definition will take priority over any definition of variable in a style-sheet. Note that you will probably have to use some escaping mechanism for the spaces to get the entire scheme expression parsed as one cmdline argument. π (yes, the shell will fight you. use your quotes. protect her.)-wtypeβ Control warnings and errors. Multiple-woptions are allowed. The following values of type enable warnings:xmlβ Warn about constructs that are not allowed by XML.mixedβ Warn about mixed content models that do not allow#pcdataanywhere.sgmldeclβ Warn about various dubious constructions in the SGML declaration.shouldβ Warn about various recommendations made in ISO 8879 that the document does not comply with. (Recommendations are expressed withshould'', as distinct from requirements which are usually expressed withshall''.)defaultβ Warn about defaulted references.duplicateβ Warn about duplicate entity declarations.undefinedβ Warn about undefined elements: elements used in the DTD but not defined.unclosedβ Warn about unclosed start and end-tags.emptyβ Warn about empty start and end-tags.netβ Warn about net-enabling start-tags and null end-tags.min-tagβ Warn about minimized start and end-tags. Equivalent to combination ofunclosed,emptyandnetwarnings.unused-mapβ Warn about unused short reference maps: maps that are declared with a short reference mapping declaration but never used in a short reference use declaration in the DTD.unused-paramβ Warn about parameter entities that are defined but not used in a DTD. Unused internal parameter entities whose text isINCLUDEorIGNOREwon't get the warning.notation-sysidβ Warn about notations for which no system identifier could be generated.allβ Warn about conditions that should usually be avoided (in the opinion of the author). Equivalent to:mixed,should,default,undefined,sgmldecl,unused-map,unused-param,emptyandunclosed.
A warning can be disabled by using its name prefixed with no-. Thus -wall -wno-duplicate will enable all warnings except those about duplicate entity declarations.
The following values for warning_type disable errors:
no-idrefβ Do not give an error for an ID reference value which no element has as its ID. The effect will be as if each attribute declared as an ID reference value had been declared as a name.no-significantβ Do not give an error when a character that is not a significant character in the reference concrete syntax occurs in a literal in the SGML declaration. This may be useful in conjunction with certain buggy test suites.no-validβ Do not require the document to be type-valid. This has the effect of changing the SGML declaration to specifyVALIDITY NOASSERTandIMPLYDEF ATTLIST YES ELEMENT YES. An option of-wvalidhas the effect of changing the SGML declaration to specifyVALIDITY TYPEandIMPLYDEF ATTLIST NO ELEMENT NO. If neither-wvalidnor-wno-validare specified, then theVALIDITYandIMPLYDEFspecified in the SGML declaration will be used.
π§ ENVIRONMENT π§
OpenJade 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 OpenJade's handling of character sets. β¨ (unicode always, she said. we don't do alternatives here.)
β¨ OPENJADE EXTENSIONS β¨
okay bestie so OpenJade has extra external procedures beyond the standard ones, and they're defined by a prototype exactly the same way the standard does it. π«Ά To use one, you gotta go through the standard external-procedure procedure and hand it a public identifier shaped like "UNREGISTERED::James Clark//Procedure::name" β where name is the name listed down below. In practice that means your DSSSL spec looks like this:
(define name (external-procedure "UNREGISTERED::James Clark//Procedure::name"))
Heads up though: external-procedure returns #f if it doesn't know about the public identifier you gave it. Which is honestly a feature, because it means your DSSSL specs can degrade gracefully on other implementations that don't support these extensions. π
And for the external procedures that the OpenJade team themselves added? Those use a public identifier of the form "UNREGISTERED::OpenJade//Procedure::name".
Easiest way to grab all of them at once is the style specification dsssl/extensions.dsl#procedures. And the file dsssl/extensions.dsl also carries style specifications that make the nonstandard flow object classes and inherited characteristics that the backends support available to you in a convenient way. β¨
π Debugging
(debug obj)β spits out a message with the value ofobjin it, then hands you backobj. It's giving "peek at the vibes, no consequences". π
π Simple-page-sequence header/footer control
(if-first-page sosofo1 sosofo2)β you can ONLY use this when you're specifying the value of one of the header/footer characteristics ofsimple-page-sequence. It returns a sosofo that'll render assosofo1if the page is the first page of thesimple-page-sequence, and assosofo2otherwise. π₯(if-front-page sosofo1 sosofo2)β also ONLY usable when specifying the value of one of the header/footer characteristics ofsimple-page-sequence. It returns a sosofo that renders assosofo1if the page is a front page (that's recto, the odd-numbered ones, bestie) and assosofo2if it's a back page (verso, even-numbered). π¦
π’ Numbering
(all-element-number)(all-element-number osnl)β same energy aselement-number, except it counts elements with any generic identifier. Ifosnlisn't an element it returns#f, otherwise it returns 1 plus the number of elements that started beforeosnl. So it's a super efficient way to cook up a unique identifier for literally any element in a document. π
π¦ External entity access
(read-entity string)β returns a string holding the contents of the external entity whose system identifier isstring. β οΈ ONLY use this for textual entities (that's CDATA and SDATA), never for binary entities (NDATA). Not the move. π
π POSIX locale access
(language lang country)β returns an object of typelanguage, as long as your system supports the language you asked for.langis a string or symbol with the two letter language code, andcountryis a string or symbol with the two letter country code.
This one runs on POSIX locales. It's an OpenJade addition. And ngl, it is not supported on all operating systems. π
π§ Extended standard procedures
(sgml-parse sysid #!key active: parent: architecture:)β lets you specify an SGML architecture that the document should be parsed with respect to. It's an OpenJade addition. ποΈ(expt q k)β lets you raise a quantity to an integral power. Also an OpenJade addition. π
π LIMITATIONS
This bit is all about the limitations of the front-end (aka the general-purpose DSSSL engine). And btw, every backend has its own limitations too, so this isn't the whole story. π
openjade doesn't allow internal definitions at the beginning of bodies, and it doesn't do the (test => recipient) variant of cond clauses.
openjade supports only a single, fixed grove plan, and that plan comprises these modules:
baseabsprlgabs0prlgabs1instabsbasesds0instsds0subdcabs
It doesn't implement the following parts of SDQL: HyTime support, auxiliary parsing, node regular expressions. None of it, bestie.
Query rules, sosofo synchronization, indirect sosofos, reference values, decoration areas and font properties are not supported. π«
Also, note that only inherited characteristics that are applicable to some supported flow object can be specified.
π€ Character/glyph handling
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. And for many characters you can also 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. On top of that, 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.
OpenJade now supports the standard-chars, map-sdata-entity, add-name-chars, add-separator-chars and char-repertoire declaration element forms, which lets a style-sheet define additional character names, sdata entity mappings, name characters (i.e. characters allowed in identifiers) and separator characters. Currently the only recognized character repertoire is the built-in repertoire, and its public identifier is "UNREGISTERED::OpenJade//Character Repertoire::OpenJade". β¨
β Validation
Several things that it would be desirable to have checked justβ¦ aren't checked. Rude, but here we are: π«
- When the allowed value of an inherited characteristic is a symbol, OpenJade checks only that the value is a symbol that is allowed as the value of some characteristic.
#tand#fare treated as a special kind of symbol in this case. - OpenJade doesn't check whether a flow object is occurring in a context where it is allowed.
- OpenJade does not prevent flow objects being attached to the principal port of a flow object when the flow object shouldn't have a principal port.
- Most type-checking is done at run-time, not compile-time. π¬
- OpenJade does not check for non-inherited characteristics that are required to be specified.
- It doesn't check that optional features that have been used were declared in the
featuresform.
πͺ¨ Other limitations
The following primitives are just stubs:
char-script-caseβ always returns the last argument.address-visited?β always returns#f.
πΈ EXAMPLES
So say you've got an SGML file file.sgml, you're using the stylesheet file.dsl, and you wanna publish as an rtf file:
openjade -t rtf file.sgml
Using a different stylesheet:
openjade -t rtf -d docbook.dsl file.sgml
Using the print style specification contained within the stylesheet:
openjade -t rtf -d docbook.dsl#print file.sgml
And use the html specification within the style sheet to convert to html:
openjade -t sgml -i html -d docbook.dsl#html file.sgml
Slay. π β¨
π SEE ALSO
π AUTHORS
James Clark, Ian Castle <ian.castle@looksystems.co.uk>. π«Ά
and that's the whole page, bestie!! π this one's from OpenJade, dated January 2002, and the manual page itself is OPENJADE(1). ily, go read a grove plan or something ππ
π¦ where this page comes from
- arch rolling: openjade 1.3.2-10 Β· LicenseRef-openjade
- centos-stream 10: openjade 1.3.2-82.el10 Β· LicenseRef-DMIT
- centos-stream 9: openjade 1.3.2-72.el9 Β· DMIT
- centos-stream 9: openjade 1.3.2-72.el9 Β· DMIT
- fedora 43: openjade 1.3.2-83.fc43 Β· LicenseRef-DMIT
- fedora 43: openjade 1.3.2-83.fc43 Β· LicenseRef-DMIT
- fedora 44: openjade 1.3.2-85.fc44 Β· LicenseRef-DMIT
- fedora 44: openjade 1.3.2-85.fc44 Β· LicenseRef-DMIT
- opensuse-leap 16.0: openjade 1.3.2-160000.2.2 Β· MIT
- opensuse-leap 16.0: openjade 1.3.2-160000.2.2 Β· MIT
- opensuse-leap 16.0: openjade 1.3.2-160000.2.2 Β· MIT
- opensuse-leap 16.0: openjade 1.3.2-160000.2.2 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms