Copyright © 2004 Crane Softwrights Ltd.
$Date: 2004/10/06 14:10:01 $(UTC)
Table of Contents
This is a modular library of XSLT 1.0 stylesheet fragments supporting the printing of a subset of the forms described by the United Nations Layout Key. The Extensible Stylesheet Language Formatting Objects (XSL-FO) 1.0 vocabulary is used to present the layout semantics.
Note that this modular library is not sufficient on its own for transforming instances of any vocabulary. Please download the stylesheet library specific to a given family of document types to be able to render instances of XML.
This library supports the published formatting specifications available in the UBL 1.0 release package, rendering information to A4-sized paper. Please see the UBL stylesheet library for an example of how to utilize this library for both US-letter and HTML renditions. Although the selection of supported fields on the form is currently tailored to UBL, we anticipate expanding this library to be more useful and flexible for document types of other vocabularies. Except for the choice of fields being displayed without a gray background, there are no dependencies on UBL in these stylesheet fragments.
The latest version of this library is available from the download directory at http://www.CraneSoftwrights.com/resources/ublss.
All the stylesheets in this library that are authored by Crane Softwrights Ltd. can be used in any commercial or non-commercial environment or product according to the following copyright and license statements:
Copyright (C) - Crane Softwrights Ltd.
- http://www.CraneSoftwrights.com/links/res-un.htm
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
- The name of the author may not be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Note: for your reference, the above is the "Modified BSD license"; this text was obtained 2002-12-26 at http://www.xfree86.org/3.3.6/COPYRIGHT2.html#5
Any changes you may make to the libraries are not obliged to be forwarded back to Crane, though that courtesy would be very much appreciated in order for any unencumbered modifications to be considered for inclusion in the publicly available library for everyone to use. Please note that the license does require you to acknowledge Crane's copyright and URL
Stylesheet files are found in the xsl/ subdirectory.
The following files are available at this time:
CraneUN220Order.xsl (raw A4 rendering)
CraneUN230OrderChange.xsl (raw A4 rendering)
CraneUN320OrderResponse.xsl (raw A4 rendering)
CraneUN320OrderResponseSimple.xsl (raw A4 rendering)
CraneUN320OrderCancellation.xsl (raw A4 rendering)
CraneUN351DespatchAdvice.xsl (raw A4 rendering)
CraneUN380Invoice.xsl (raw A4 rendering)
CraneUN632ReceiptAdvice.xsl (raw A4 rendering)
These stylesheet files are synthesized using an automatic process analyzing a seeded sample XSL-FO file. This second-generation stylesheet synthesis process, named "ResultXSLT(tm)", was written by Crane Softwrights Ltd. for the purpose of creating importable stylesheet fragments with hooks available to an importing stylesheet.
Each hook comprises a chain of two called templates: one using a namespace to jump out of the fragment, and the other using a different namespace to jump back in to the fragment. Having both calls of the chain in the stylesheet allows the stylesheet to be run without intervention of an importing stylesheet. Importing stylesheets have the opportunity (but not obligation) to override the "jump out" named template with their own handling of the situation, and may or may not elect to "jump in" back to the stylesheet fragment by using the other template call.
An example of these chained hooks from the Order layout is the handling of the purchase order number:
...
<wrapper start-indent="2pt" end-indent="2pt">
<block font-family="Arial" font-size="6pt"
space-after="1pt">Purchase order number</block>
<xsl:call-template name="po-out:po-number"/>
</wrapper>
...
<!--Branch: po-number-->
<xsl:template name="po-out:po-number">
<xsl:call-template name="po-in:po-number"/>
</xsl:template>
<xsl:template name="po-in:po-number">
<block>PO Number</block>
</xsl:template>
In the above example, the box filling process displays the box label and then calls po-out:po-number for the processing of the actual number value. The default chain will simply call po-in:po-number for the display of a placebo string. An importing stylesheet overrides the named template po-out:po-number with whatever processing is required to obtain and display the purchase order number value.
See the UBL stylesheets for many other examples of the use of these called templates, including the rearrangement of meta data contrasting the presentation for print and HTML renderings.
The pdf/ subdirectory contains PDF files in A4 made using the stylesheet files in a standalone fashion, that is, on their own without being imported in the context of working with any particular vocabulary.
The raw/ subdirectory contains raw XSL-FO files and their associated PDF renderings cited above. These files are useful for measuring the capabilities of an XSL-FO engine to support the processing of the results of using this stylesheet library.