[KLUG Members] XSLT Transforms

Justin Buist members@kalamazoolinux.org
Mon, 6 Jan 2003 18:43:34 -0500


If you hit http://www.dpawson.co.uk there should be some XSL(t) FAQ's and 
tutorials there.  I was involved with this type of stuff around 2 years ago 
and had a lot of fun with it.  The mailing lists are pretty helpful too --
IIRC an RTFM was rarely ever spouted out :).  Traffic ran about 60 messages or
so a day too.

As far as software goes --- http://xml.apache.org has everything you'll need.
Xerces for XML parsing, Xalan for XSLT, and FOP for XML:FO -> PDF
transformations.  What you end up is something like this:

XML Data + HTML XSLT stylesheet yields HTML output.
XML Data + XML:FO XSLT stylesheet yields XML:FO output, which when run through
FOP yields a PDF file (or postscript).

XSLT can be a bit odd at first, because it's really just a big statemachine
and not a procedural programming langauge.  You have to shift your mindset a
bit before you get comfortable with it.

Hope that helps.

Justin Buist


On Mon, Jan 06, 2003 at 04:36:30PM -0500, Adam Williams wrote:
> 
> The XSLT transforms presentation from 2002 isn't on the web site. :(
> 
> I've used XML quite a bit, but never XSLT before.  Anyone know of a good 
> straight forward intro with examples? (Unless someone wants to walk 
> through it on the list).
> 
> I've got
> <?xml version="1.0"?>
> <customer_price_matrix_report>
>   <salesperson name="" mail="" customercount="0"/>
>   <salesperson name="" mail="" customercount="41">
>     <customer name="1ST AYD CORPORATION" company="ME" 
>       number="10225" city="ELGIN" state="IL"/>
>      <customer name="ASC INCORPORATED" company="ME" 
>        number="10421" city="SOUTHGATE" state="MI"/>
>      <customer name="CITY OF STURGIS" company="ME" 
>        number="10268" city="STURGIS" state="MI">
>         <oem_discount oem="" captive="1.1" noncaptive="1.0" 
>          user="sswonk    " date="2001-03-20 12:09"/>
>        <oem_discount oem="AAA" captive="1.0" noncaptive="1.0" 
>          user="sswonk    " date="2001-03-20 12:09"/>
>       </customer>
>      <customer name="CONVENTION &amp; SHOW SERVICES" company="ME" 
>        number="10229" city="LINCOLN PARK" state="MI"/>
>      <customer name="CPC GROUP GRAND RAPIDS" company="ME" 
>        number="11068" city="FLINT" state="MI"/>
>      <customer name="DAVID A KUIPER" company="ME" number="10124" 
>        city="JENISON" state="MI"/>
>      <customer name="DELTA CHARTER TOWNSHIP" company="ME" 
>        number="11300" city="LANSING" state="MI"/>
>      <customer name="FEDEX GROUND PACKAGE SYSTEM" company="ME" 
>        number="11230" city="PITTSBURGH" state="PA"/>
>     </salesperson>
>  </customer_price_matrix_report>
> 
> and I'd like to transform it into HTML, PDF, etc.. something pretty.  As 
> you can see salesperson has 0..n customer entries,  and a customer has 
> 0..n oem discount entries.
> 
> Any pointers would be appreciated,  in a bit of a time crunch.
> 
> _______________________________________________
> Members mailing list
> Members@kalamazoolinux.org
>