[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: xslt used for anything wacky?

Subject: Re: xslt used for anything wacky?
From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx>
Date: Sun, 13 Jul 2003 16:33:50 -0400
name tent
At 2003-07-11 17:28 -0500, Lars Huttar wrote:
What examples does anyone have (in real life!) of XSLT being used for unexpected things?

An unexpected real-life application in our training is the production of name tents (one per page), name badges (15 per page, with a command line parameter for skipping a number of used labels at the end of a sheet), and certificates (on request), all from a single instance of XML and using pure XSLT and XSL-FO without extensions.


The front of the name tent is in a 180deg rotated block container, with the forename large and the surname small. The back of the name tent has the forename medium size (for those sitting behind the student) and an enumerated list of all of the other students in the class (filtering out the student for the tent), and the cities in which they live. Because of the filtering, each name tent is then personalized for each student. Sorting is done by forename since that is the name used by everyone in the class.

I tried to think of everything I've wanted to know about how ineffective name tents have been for me in the past when I am a student and what would allow me to participate with other students without being embarrassed.

Interestingly (for me) I wrapped the name and the city in respective keep-together.within-line properties so that long names in the list broke lines without disturbing either part of the one line, and it made for a good looking result:

     UUUU UUUUUUUUU      VVVVVVVVV, VV
     WWWWWWWW WWWWWWWWWW
            XXXXXXX XXXXXXX, XX, XXXXX
     YYYYYYYYY YYYYYY         YYYY, YY

(this requires that a leader be included in the latter keep-together and that the last line justification be turned on for the above to work properly).

Since we run two courses during the week, and some students are for only one course and others for both courses, I used keys for the list of names in a particular class, and generate-id() to filter out the name from the list of the name for the tent. I used similar methods to personalize the background of each person's name tag to list which of the courses they were on during the week.

What started off as just a word processing mail merge task to make some simple name tents became a fun XSL-FO task of "gee, what more useful information could I put on all this real-estate I have on a name tent and a name badge?".

The name badge project turned into a general purpose paper label formatting project because if I only need five labels of a sheet of 15, they get printed at the end of the sheet (keeps the paper stronger for feeding from the top), and the next time I need to do some labels I just enter a "5" on the command line and the XSLT calculates where from the bottom-most available label to start and works up, starting a new sheet if possible. I now use it for my shipping labels and diskette labels as well.

While this all isn't rocket science by any sense, it opened my eyes to the flexibility of using stylesheets for more publishing tasks that I had envisioned when I looked at XSL-FO just for book publishing. The application was quite unexpected for me.

I hope this is considered useful.

...................... Ken

--
Upcoming hands-on courses: in-house corporate training available;
North America public:  XSL-FO Aug 4,2003; XSLT/XPath Aug 12, 2003

G. Ken Holman                mailto:gkholman@xxxxxxxxxxxxxxxxxxxx
Crane Softwrights Ltd.         http://www.CraneSoftwrights.com/s/
Box 266, Kars, Ontario CANADA K0A-2E0   +1(613)489-0999 (F:-0995)
ISBN 0-13-065196-6                      Definitive XSLT and XPath
ISBN 0-13-140374-5                              Definitive XSL-FO
ISBN 1-894049-08-X  Practical Transformation Using XSLT and XPath
ISBN 1-894049-11-X              Practical Formatting Using XSL-FO
Member of the XML Guild of Practitioners:    http://XMLGuild.info
Male Breast Cancer Awareness http://www.CraneSoftwrights.com/s/bc


XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list



Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.