.\"Generated by db2man.xsl. Don't modify this, modify the source. .de Sh \" Subsection .br .if t .Sp .ne 5 .PP \fB\\$1\fR .PP .. .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Ip \" List item .br .ie \\n(.$>=3 .ne \\$3 .el .ne 3 .IP "\\$1" \\$2 .. .TH "OPENJADE" 1 "January 2002" "OpenJade" "" .SH NAME openjade \- apply a DSSSL stylesheet to an SGML or XML document .SH "SYNOPSIS" .nf \fBopenjade\fR [\fB-vCegG2s\fR] [\fB-b \fIencoding\fR\fR] [\fB-f \fIerror_file\fR\fR] [\fB-c \fIcatalog_sysid\fR\fR] [\fB-D \fIdir\fR\fR] [\fB-a \fIlink_type\fR\fR] [\fB-A \fIarch\fR\fR] [\fB-E \fImax_errors\fR\fR] [\fB-i \fIentity\fR\fR] [\fB-w \fIwarning_type\fR\fR] [\fB-d \fIdsssl_spec\fR\fR] [\fB-V \fIvariable\fB=\fIvalue\fR\fR\fR\fR] [\fB-t \fIoutput_type\fR\fR] [\fB-o \fIoutput_file\fR\fR] [\fB\fIsysid\fR\fR...] .fi .SH "DESCRIPTION" .PP \fBopenjade\fR is an implementation of the ISO/IEC 10179:1996 standard DSSSL language. The DSSSL engine receives as input an SGML or XML document and transforms it into formats like: .PP * XML representation of the flow object tree. .PP * RTF format that can be rendered and printed with Microsoft's free Word Viewer 97 .PP * TeX format .PP * MIF format that can be rendered and printed with Framemaker .PP * SGML or XML format. This is used in conjunction with non-standard flow object classes to generate SGML, thus allowing \fBopenjade\fR to be used for SGML/XML transformations. .PP The system identifier of the document to be processed is specified as an argument to \fBopenjade\fR. If this is omitted, standard input will be read. .PP \fBopenjade\fR determines the system identifier for the DSSSL specification as follows: .PP 1. If the -d option is specified, it will use the argument as the system identifier. .PP 2. Otherwise, it will look for processing instructions in the prolog of the document. Two kinds of processing instruction are recognized: .PP .PP 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. .PP .PP The system identifier is the portion of the system data of the processing instruction following the initial name and any whitespace. .PP 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. .PP 3. Otherwise, it will use the system identifier of the document with any extension changed to .dsl. .PP A DSSSL specification document can contain more than one style-specification. If the system identifier of the DSSSL specification is followed by #id, then \fBopenjade\fR will use the style-specification whose unique identifier is id. This is allowed both with the \fB-d\fR option and with the processing instructions. .PP The DSSSL specification must be an SGML document conforming to the DSSSL architecture. For an example, see \fIdsssl/demo.dsl\fR. .PP \fBopenjade\fR supports the following options in addition to the normal OpenSP (see \fBonsgmls(1)\fR) options (note that all options are case-sensitive, ie \fB-g\fR and \fB-G\fR are different options): .TP \fB-d \fIdsssl_spec\fR\fR This specifies that dsssl_spec is the system identifier of the DSSSL specification to be used. .TP \fB-G\fR Debug mode. When an error occurs in the evaluation of an expression, \fBopenjade\fR will display a stack trace. Note that this disables tail-call optimization. .TP \fB-c \fIfilename\fR\fR The filename arguments specify catalog files rather than the document entity. The document entity is specified by the first DOCUMENT entry in the catalog files. .TP \fB-s\fR 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. .TP \fB-t \fIoutput_type\fR\fR \fIoutput_type\fR specifies the type of output as follows: \fBfot \fR An XML representation of the flow object tree \fBrtf\fR \fBrtf-95 \fR RTF (used for SGML/XML to RTF transformations) Microsoft's Rich Text Format. rtf-95 produces output optimized for Word 95 rather than Word 97. \fBtex\fR TeX (used for SGML/XML to TeX transformations) \fBsgml\fR \fBsgml-raw\fR SGML (used for SGML/XML to SGML transformations). sgml-raw doesn't emit linebreaks in tags. \fBxml\fR \fBxml-raw\fR XML (used for SGML/XML to XML transformations). xml-raw doesn't emit linebreaks in tags. \fBhtml \fR HTML (used for SGML/XML to HTML transformations) \fBmif\fR MIF (used for SGML/XML to MIF transformations) .TP \fB-o \fIoutput_file\fR\fR Write output to \fIoutput_file\fR 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. .TP \fB-V \fIvariable\fR\fR This is equivalent to doing (define variable #t) except that this definition will take priority over any definition of variable in a style-sheet. .TP \fB-V \fIvariable=value\fR\fR This is equivalent to doing (define \fIvariable\fR "\fIvalue\fR") except that this definition will take priority over any definition of variable in a style-sheet. .TP \fB-V (define \fIvariable\fR value)\fR 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. .TP \fB-w\fItype\fR\fR Control warnings and errors. Multiple \fB-w\fR options are allowed. The following values of type enable warnings: \fBxml\fR Warn about constructs that are not allowed by XML. \fBmixed\fR Warn about mixed content models that do not allow #pcdata anywhere. \fBsgmldecl\fR Warn about various dubious constructions in the SGML declaration. \fBshould\fR 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''.) \fBdefault\fR Warn about defaulted references. \fBduplicate\fR Warn about duplicate entity declarations. \fBundefined\fR Warn about undefined elements: elements used in the DTD but not defined. \fBunclosed\fR Warn about unclosed start and end-tags. \fBempty\fR Warn about empty start and end-tags. \fBnet\fR Warn about net-enabling start-tags and null end-tags. \fBmin-tag\fR Warn about minimized start and end-tags. Equivalent to combination of unclosed, empty and net warnings. \fBunused-map\fR 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. \fBunused-param\fR Warn about parameter entities that are defined but not used in a DTD. Unused internal parameter entities whose text is INCLUDE or IGNORE won't get the warning. \fBnotation-sysid\fR Warn about notations for which no system identifier could be generated. \fBall\fR 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, empty and unclosed. A warning can be disabled by using its name prefixed with no-. Thus \fB-wall\fR \fB-wno-duplicate\fR will enable all warnings except those about duplicate entity declarations. The following values for \fIwarning_type\fR disable errors: \fBno-idref\fR 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. \fBno-significant\fR 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. \fBno-valid\fR Do not require the document to be type-valid. This has the effect of changing the SGML declaration to specify VALIDITY NOASSERT and IMPLYDEF ATTLIST YES ELEMENT YES. An option of \fB-wvalid\fR has the effect of changing the SGML declaration to specify VALIDITY TYPE and IMPLYDEF ATTLIST NO ELEMENT NO. If neither \fB-wvalid\fR nor \fB-wno-valid\fR are specified, then the VALIDITY and IMPLYDEF specified in the SGML declaration will be used. .SH "ENVIRONMENT" .PP 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. .SH "OPENJADE EXTENSIONS" .PP 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: .PP (define name (external-procedure "UNREGISTERED::James Clark//Procedure::name")) .PP 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. .PP For external procedures added by the OpenJade team, use a public identifier of the form "UNREGISTERED::OpenJade//Procedure::name". .PP 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. .PP \fBDebugging\fR .PP (debug obj) .PP Generates a message including the value of obj and then returns obj. .PP \fBSimple-page-sequence header/footer control\fR .PP (if-first-page sosofo1 sosofo2) .PP 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. .PP (if-front-page sosofo1 sosofo2) .PP 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. .PP \fBNumbering\fR .PP (all-element-number) .PP (all-element-number osnl) .PP 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. .PP \fBExternal entity access\fR .PP (read-entity string) .PP 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). .PP \fBPOSIX locale access\fR .PP (language lang country) .PP This procedure returns an object of type language, if the system supports the specified language. lang is a string or symbol giving the two letter language code. country is a string or symbol giving the two letter country code. .PP This procedure uses POSIX locales. It is an OpenJade addition. It is not supported on all operating systems. .PP \fBExtended standard procedures\fR .PP (sgml-parse sysid #!key active: parent: architecture:) .PP This allows you to specify an SGML architecture with respect to which the document should be parsed. It is an OpenJade addition. .PP (expt q k) .PP This allows you to raise a quantity to an integral power. It is an OpenJade addition. .SH "LIMITATIONS" .PP This section describes the limitations of the front-end (the general-purpose DSSSL engine); each backend also has its own limitations. .PP \fBopenjade\fR doesn't allow internal definitions at the beginning of bodies and the (test => recipient) variant of cond clauses. .PP \fBopenjade\fR supports only a single, fixed grove plan which comprises the following modules: .PP * baseabs .PP * prlgabs0 .PP * prlgabs1 .PP * instabs .PP * basesds0 .PP * instsds0 .PP * subdcabs .PP It doesn't implement the following parts of SDQL: HyTime support, auxiliary parsing, node regular expressions. .PP Query rules, sosofo synchronization, indirect sosofos, reference values, decoration areas and font properties are not supported. .PP Note that only inherited characteristics that are applicable to some supported flow object can be specified. .PP \fBCharacter/glyph handling\fR .PP 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. .PP 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. .PP 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". .PP \fBValidation\fR .PP Several things that it would be desirable to have checked aren't checked: .PP * 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; #t and #f are treated as a special kind of symbol in this case. .PP * OpenJade doesn't check whether a flow object is occurring in a context where it is allowed. .PP * 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. .PP * Most type-checking is done at run-time not compile-time. .PP * OpenJade does not check for non-inherited characteristics that are required to be specified. .PP * It doesn't check that optional features that have been used were declared in the features form. .PP \fBOther limitations\fR .PP The following primitives are just stubs: .PP \fBchar-script-case\fR Always returns last argument. .PP \fBaddress-visited?\fR Always returns #f. .SH "EXAMPLES" .PP Given an SGML file \fBfile.sgml\fR, use the stylesheet \fBfile.dsl\fR and publish as an rtf file. .PP openjade -t rtf file.sgml .PP Using a different stylesheet: .PP openjade -t rtf -d docbook.dsl file.sgml .PP Using the \fBprint\fR style specification contained within the stylesheet .PP openjade -t rtf -d docbook.dsl#print file.sgml .PP And use the html specification within the style sheet to convert to html .PP openjade -t sgml -i html -d docbook.dsl#html file.sgml .SH "SEE ALSO" .PP \fBonsgmls(1)\fR .SH AUTHORS James Clark, Ian Castle .