OPENJADE(1)
π OPENJADE π
okay bestie, section 1 of the manual, the openjade page. this is part 1 of 2 so buckle up, we are NOT done yet π
π NAME π
openjade β apply a DSSSL stylesheet to an SGML or XML document. that's the whole thing. that's the assignment. slay π
β¨ 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 πΈ
okay so openjade is literally a whole implementation of the ISO/IEC 10179:1996 standard DSSSL language. and the DSSSL engine? it takes an SGML or XML document as input and transforms it into formats like:
- XML representation of the flow object tree. icon behavior.
- 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 one gets used in conjunction with non-standard flow object classes to generate SGML, which is what lets openjade be used for SGML/XML transformations. no cap.
the system identifier of the document to be processed is specified as an argument to openjade. if that's omitted, bestie, standard input will be read. simple as.
openjade figures out the system identifier for the DSSSL specification like this:
- 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 the 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. (yes "the the", we said what we said, it's in the original π«Ά)
- 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.
the DSSSL specification must be an SGML document conforming to the DSSSL architecture. for an example, see dsssl/demo.dsl. go look, it's cute.
openjade supports the following options in addition to the normal OpenSP (see onsgmls(1)) options (and bestie, note that all options are case-sensitive, ie -g and -G are different options. do not mix them up i'm begging):
-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, openjade will display a stack trace. note that this disables tail-call optimization. it's giving detective mode π-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 that jade doesn'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. it's the "no shortcuts" mode π-toutput_type β output_type specifies the type of output as follows:fotβ an XML representation of the flow object treertfrtf-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. queen behavior honestly.-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. good luck with that one bestie, the shell is not your friend here π-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 with "should", as distinct from requirements which are usually expressed with "shall".)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. chef's kiss β¨
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. so basically only the SP_ENCODING environment variable is relevant to OpenJade's handling of character sets. that's the whole tea. π΅
bestie this is only part 1, so do not touch that dial π
β¨ OPENJADE EXTENSIONS β¨
okay so bestie, listen up π these external procedures? they're available. They're defined by a prototype in the same way as in the standard. To use one of these external procedures, you gotta use the standard external-procedure procedure, with a public identifier of "UNREGISTERED::James Clark//Procedure::name" where name is the name given here. Typically you'd include this in your DSSSL spec:
(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. fr fr.
For external procedures added by the OpenJade team, use a public identifier of the form "UNREGISTERED::OpenJade//Procedure::name".
An easy way to get access to all external procedures is to use the style specification dsssl/extensions.dsl#procedures. The file dsssl/extensions.dsl also contains style specifications which make the nonstandard flow object classes and inherited characteristics supported by the backends available in a convenient way. slay. π
π Debugging π
(debug obj)β Generates a message including the value ofobjand then returnsobj.
π Simple-page-sequence header/footer control π
(if-first-page sosofo1 sosofo2)β This can be used only in the specification of the value of one of the header/footer characteristics ofsimple-page-sequence. It returns a sosofo that will display assosofo1if the page is the first page of thesimple-page-sequenceand assosofo2otherwise.(if-front-page sosofo1 sosofo2)β This can be used only in the specification of the value of one of the header/footer characteristics ofsimple-page-sequence. It returns a sosofo that will display assosofo1if the page is a front (ie recto, odd-numbered) page and assosofo2if it is a back (ie verso, even-numbered) page.
π’ Numbering π’
(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. iconic.
π External entity access π
(read-entity string)β This returns a string containing the contents of the external entity with system identifierstring. This should be used only for textual entities (CDATA and SDATA), and not for binary entities (NDATA). no cap.
π POSIX locale access π
(language lang country)β This procedure returns an object of typelanguage, if the system supports the specified language.langis a string or symbol giving the two letter language code.countryis a string or symbol giving the two letter country code.
This procedure uses POSIX locales. It is an OpenJade addition. It is not supported on all operating systems. π
π§© Extended standard procedures π§©
(sgml-parse sysid #!key active: parent: architecture:)β This allows you to specify an SGML architecture with respect to which the document should be parsed. It is an OpenJade addition.(expt q k)β This allows you to raise a quantity to an integral power. It is an OpenJade addition.
π LIMITATIONS π
This section describes the limitations of the front-end (the general-purpose DSSSL engine); each backend also has its own limitations.
openjade doesn't allow internal definitions at the beginning of bodies and the (test => recipient) variant of cond clauses. π
openjade supports only a single, fixed grove plan which comprises the following modules:
baseabsprlgabs0prlgabs1instabsbasesds0instsds0subdcabs
It doesn't implement the following parts of SDQL: HyTime support, auxiliary parsing, node regular expressions.
Query rules, sosofo synchronization, indirect sosofos, reference values, decoration areas and font properties are not supported.
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. 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.
OpenJade now supports the standard-chars, map-sdata-entity, add-name-chars, add-separator-chars and char-repertoire declaration element forms, allowing a style-sheet to 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. It has the public identifier "UNREGISTERED::OpenJade//Character Repertoire::OpenJade". πΈ
β Validation β
Several things that it would be desirable to have checked aren't checked:
- 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 features form.
πͺ¦ Other limitations πͺ¦
The following primitives are just stubs:
char-script-caseAlways returns last argument.address-visited?Always returns#f.
π EXAMPLES π
Given an SGML file file.sgml, use the stylesheet file.dsl and 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
π SEE ALSO π
π AUTHORS π
James Clark, Ian Castle <ian.castle@looksystems.co.uk>.
This masterpiece is from OpenJade, January 2002, and it's OPENJADE(1) β periodt. π
β¨
π¦ where this page comes from
- debian bookworm: openjade 1.4devel1-22
- debian trixie: openjade 1.4devel1-23.3
- ubuntu jammy: openjade 1.4devel1-22
- ubuntu noble: openjade 1.4devel1-23.1build1
- ubuntu questing: openjade 1.4devel1-23.3
- ubuntu resolute: openjade 1.4devel1-23.3build1
- ubuntu stonking: openjade 1.4devel1-23.3build1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms