| 1. | How do I generate output for PalmPilot? |
If you want to support AportisDoc convert your SGML source file to TXT first and convert with a command like: makedoc DOCUMENT.txt DOCUMENT.prc If you want to support iSilo convert your SGML source file to HTML first and convert with a command like: iSilo386 -y -d0 -Idef DOCUMENT.html DOCUMENT.pdb Carsten Wartmann pointed me to the following tools, which can convert TXT/HTML files to PalmPilot DOC format: txt2pdbdoc and html2pdbtxt. | |
| 2. | olink usage in DSSSL stylesheets |
The .olink file is a summary of all the xref targets. It is generated by processing the target document with the olink.dsl stylesheet and saving the file to the same filename as your document but with a .olink extension. So if your document is "mybook.sgml" then you do something like: jade -d olink.dsl -o mybook.olink mybook.sgml When the docbook.dsl stylesheet processes another document that includes an olink with attribute targetdocent="mybook" (as an entity reference that points to mybook.sgml), it reads mybook.olink to get the summary data to form the link. Anyone trying to use the existing olink mechanim pretty much needs to keep a copy of Norm's document handy. | |
| 3. | Slides in DSSSL |
I created customization for DSSSL stylesheets to deal with Slides DTD. It gave me better results than provided fo-plain.xsl. You must change path pointing to base DSSSL print stylesheet in <!ENTITY docbook.dsl SYSTEM "/src/db/dsssl/print/docbook.dsl" CDATA in order to use it. <!DOCTYPE style-sheet
PUBLIC "-//James Clark//DTD DSSSL Style Sheet//EN" [
<!ENTITY docbook.dsl SYSTEM
"/src/db/dsssl/print/docbook.dsl" CDATA DSSSL>
]>
<style-specification id="docbook-webapp-print" use="docbook">
(define %visual-acuity% "my")
(define %paper-type% "A4")
(define %body-start-indent% 0pi)
(define %verbatim-size-factor% 0.95)
(define %callout-default-col% 70)
(element property ($mono-seq$))
(define %bf-size%
;; Defines the body font size
(case %visual-acuity%
(("tiny") 8pt)
(("normal") 10pt)
(("eleven") 11pt)
(("my") 14pt)
(("presbyopic") 12pt)
(("large-type") 24pt)))
(define %body-font-family% "Verdana")
(define %title-font-family% "Verdana")
(define %graphic-extensions%
;; List of graphic filename extensions
'("eps" "wmf" "epsf" "gif" "tif" "tiff" "jpg" "jpeg" "png"))
(element slides
(make simple-page-sequence
page-n-columns: %page-n-columns%
page-number-format: ($page-number-format$)
use: default-text-style
left-header: ($left-header$)
center-header: (literal "")
right-header: ($right-header$)
;; left-footer: (literal (data
(select-elements (children
(select-elements (children (current-node))
(normalize "slidesinfo"))) (normalize "title"))))
left-footer: ($left-footer$)
center-footer: ($center-footer$)
right-footer: ($right-footer$)
start-indent: %body-start-indent%
input-whitespace-treatment: 'collapse
quadding: %default-quadding%
(process-children)))
(element slidesinfo
(make sequence
quadding: 'center
(process-children)))
(element (slidesinfo author)
(make paragraph
quadding: 'center
space-before: 96pt
space-after: 96pt
(next-match)))
(element (slidesinfo copyright)
(empty-sosofo))
(element (slidesinfo title)
(let* ((renderas (attribute-string "renderas"))
(hlevel 0)
(hs (HSIZE (- 4 hlevel))))
(make paragraph
font-family-name: %title-font-family%
font-weight: (if (< hlevel 5) 'bold 'medium)
font-posture: (if (< hlevel 5) 'upright 'italic)
font-size: hs
line-spacing: (* hs %line-spacing-factor%)
space-before: (* hs %head-before-factor%)
space-after: (* hs %head-after-factor%)
start-indent: (if (< hlevel 3)
0pt
%body-start-indent%)
first-line-start-indent: 0pt
quadding: 'center
keep-with-next?: #t
(process-children))))
(element (slidesinfo subtitle)
(let* ((renderas (attribute-string "renderas"))
(hlevel 2)
(hs (HSIZE (- 4 hlevel))))
(make paragraph
font-family-name: %title-font-family%
font-weight: (if (< hlevel 5) 'bold 'medium)
font-posture: (if (< hlevel 5) 'upright 'italic)
font-size: hs
line-spacing: (* hs %line-spacing-factor%)
space-before: (* hs %head-before-factor%)
space-after: (* hs %head-after-factor%)
start-indent: (if (< hlevel 3)
0pt
%body-start-indent%)
first-line-start-indent: 0pt
quadding: 'center
keep-with-next?: #t
(process-children))))
(element foil
;; (make paragraph
;; break-before: 'page
(make simple-page-sequence
page-n-columns: %page-n-columns%
page-number-format: ($page-number-format$)
use: default-text-style
left-header: (literal (data
(select-elements (children (parent (current-node))) (normalize "title"))))
center-header: ($center-header$)
right-header: (literal (data
(select-elements (children (current-node)) (normalize "title"))))
left-footer: (literal (data
(select-elements
(children
(select-elements
(children
(select-elements
(parent
(select-elements
(parent (current-node))
(normalize "section")))
(normalize "slides")))
(normalize "slidesinfo")))
(normalize "title"))))
center-footer: ($center-footer$)
right-footer: ($right-footer$)
start-indent: %body-start-indent%
input-whitespace-treatment: 'collapse
quadding: %default-quadding%
(process-children)))
(element (foil title)
(let* ((renderas (attribute-string "renderas"))
(hlevel 1)
(hs (HSIZE (- 4 hlevel))))
(make paragraph
font-family-name: %title-font-family%
font-weight: (if (< hlevel 5) 'bold 'medium)
font-posture: (if (< hlevel 5) 'upright 'italic)
font-size: hs
line-spacing: (* hs %line-spacing-factor%)
space-before: (* hs %head-before-factor%)
space-after: (* hs %head-after-factor%)
start-indent: (if (< hlevel 3)
0pt
%body-start-indent%)
first-line-start-indent: 0pt
quadding: 'center
keep-with-next?: #t
(process-children))))
(element (foil subtitle)
(let* ((renderas (attribute-string "renderas"))
(hlevel 2)
(hs (HSIZE (- 4 hlevel))))
(make paragraph
font-family-name: %title-font-family%
font-weight: (if (< hlevel 5) 'bold 'medium)
font-posture: (if (< hlevel 5) 'upright 'italic)
font-size: hs
line-spacing: (* hs %line-spacing-factor%)
space-before: (* hs %head-before-factor%)
space-after: (* hs %head-after-factor%)
start-indent: (if (< hlevel 3)
0pt
%body-start-indent%)
first-line-start-indent: 0pt
quadding: 'center
keep-with-next?: #t
(process-children))))
(element section
(process-children))
(element (section title)
(empty-sosofo))
(define (named-formal-objects)
(list (normalize "figure")
(normalize "equation")))
</style-specification>
<external-specification id="docbook" document="docbook.dsl">
| |
| 4. | String->character nodes |
Thanks! I wound up with (define (string->nodes s)
;; Escape XML characters...
(let* ((achars (string-replace s "&" "&#38;#38;"))
(bchars (string-replace achars "<" "&#38;#60;"))
(cchars (string-replace bchars ">" "&#38;#62;")))
(let ((doc (string-append "<literal><!DOCTYPE doc [ <!ELEMENT "
"doc - - (#PCDATA)> ]><doc>" cchars ";</doc>")))
(children (node-property 'docelem (sgml-parse doc))))))
so that markup characters in the string wouldn't cause the parser to barf. This will still fail, I think, if the string contains characters not in the character set of the SGML declaration in effect, but I'm not sure what to do about that. |