Re: Separating and including library routines

Subject: Re: Separating and including library routines
From: "Stephen J. Tinney" <stinney@xxxxxxxxxxxxx>
Date: Thu, 29 May 1997 09:26:09 -0400 (EDT)
Thanks for the suggestions.  Following Sebastian's example I am now
happily using external-style-specification.  Here it is step-by-step
for the archives.

 Steve

Including Common DSSSL Routines as Libraries.
=============================================

1. Define your library specification:

---libsgml.dsl---
<!doctype style-sheet PUBLIC "-//James Clark//DTD DSSSL Style Sheet//EN">

<style-specification id=sgml>

(declare-flow-object-class element
  "UNREGISTERED::James Clark//Flow Object Class::element")
(declare-flow-object-class formatting-instruction
  "UNREGISTERED::James Clark//Flow Object Class::formatting-instruction")

(define (newline)
  (make formatting-instruction data: "&#13;"))

</style-specification>
------------------

2. Invoke the library specification via a 'use' command, and declare
it after the style-specification body using external-specification:

---tst.dsl---
<!doctype style-sheet PUBLIC "-//James Clark//DTD DSSSL Style Sheet//EN"[
<!ENTITY libsgml system cdata dsssl >
]>
<style-specification id=main use="sgml">

(element TST 
  (make sequence 
	(process-children)
	(newline)))

</style-specification>

<external-specification id=sgml document=libsgml >
-------------

3. Point a CATALOG entry at the relevant entity:

---CATALOG---
ENTITY libsgml "libsgml.dsl"
-------------

4. Here is a test file:

---tst.sgm---
<!DOCTYPE tst [
<!ELEMENT tst - - (#PCDATA)>
]>

<tst>Hello world.</tst>
-------------

5. Test (under Unix) with ./do-tst:

---do-tst---
#!/bin/sh
jade -c /usr/src/jade/dsssl/catalog -c ./CATALOG -t sgml tst.sgm
------------

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


Current Thread