Skip to content

ctipper/perspective

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Perspective XSLT stylesheets

"Perspective" is a stylesheet distribution that allows you to publish structured documents to web and print, using a custom DTD. The stylesheets in this distribution allow the creation and transformation of XML to HTML, PDF (using Formatting-Objects via XSLT) and DocBook, a widely used XML standard.

The importance of semantic markup is that you will have a clear separation between style and content, the same content being used to generate layouts in many media. Other solutions based on Wiki style markup of plain text don't properly take into account document meta information, and they certainly don't handle bibliographic data. This package provides that as well as defining a compact and semantically meaningful XML that can be transformed to any other schema. This package produces XML to the Docbook schema, for example. DocBook may then be used for transforming to present and future formats such as the epub format (using the most recent versions of the DocBook XSL stylesheets) used in the Sony Reader and Adobe Digital Editions.

The perspective-schema DTD allows the creation of articles with hyperlinks, footnote entries, itemised lists, tables, image inclusions and citations, as well as certain inline elements such as superscripts, bold, underline and italic. It also handles proper quotation marks and a useful subset of foreign characters and currency symbols. The XSLT stylesheet will insert a drop cap at the start of the text body, process footnotes to provide forward and backward links, and create author initials in bibliographic entries.

Perspective provides a DTD for a reduced markup language,

  Namespace https://www.e-conomist.me.uk/xml/dtd/perspective-schema.dtd
  PUBLIC    "-//CTIPPER//DTD perspective XML V2.1//EN" 

A workflow can be defined as follows:

  1. Create perspective DTD-based XML document based documents from the samples in xml folder.

  2. Output may be produced by using the supplied Tcl/Tk scripts which use:

    • Output HTML using stylesheets/html-perspective.xsl
    • Output PDF by transforming to formatting-objects with stylesheets/fo-perspective.xsl and then using the fop renderer
    • Output Docbook XML using stylesheets/dbk-perspective.xsl

Notes:

The supplied Tcl scripts use xsltproc and jing validator. You may use GNOME libxml2 to process the pages. Libxml2 is bundled by default on macOS versions are available for other OS linked from http://xmlsoft.org/

tx.tcl

To produce PDF you will need a FO renderer, such as Apache FOP Installation is somewhat involved see documentation particularly if you need non-standard fonts and hyphenation.

Typical command-lines as follows though using the Tcl scripts is highly recommended.

XHTML

xsltproc.exe --stringparam file-name e-template 
             --stringparam path-name "" --output ..\site\e-template.html 
..\stylesheets\html-perspective.xsl e-template.xml

PDF

xsltproc.exe --stringparam file-name e-template 
             --stringparam path-name ../ --stringparam fo-processor fop 
             --output ..\site\pdf\e-template.fo 
..\stylesheets\fo-perspective.xsl e-template.xml

then

fop -c ../config/fop.xconf -fo ..\site\pdf\e-template.fo 
    -pdf ..\site\pdf\e-template.pdf 

The variable path-name refers to the path to images/ from the output directory: uses the Unix path syntax i.e. forward slash.

Docbook

xsltproc.exe --output ..\docbook\e-template.xml
..\stylesheets\dbk-perspective.xsl e-template.xml

LICENSE

The license for this product ("LICENSE") is fairly standard. Modification of the software is at the user's own risk, all derivative products must give proper attribution.

-- Copyright © 2005 Christopher Tipper. All Rights Reserved.

About

'Perspective' is a stylesheet distribution that allows you to publish structured documents to web and print

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published