[Fwd: Fw: [xsl] XSLT Cookbook - HELP]

Subject: [Fwd: Fw: [xsl] XSLT Cookbook - HELP]
From: Sal R Mangano <Sal.Mangano@xxxxxxxxxxxxxxxxx>
Date: Wed, 10 Sep 2003 09:38:27 -0400
See below

> ----- Original Message ----- 
> From: "Mitchell, Lincoln L." <Lincoln.Mitchell@xxxxxxxxxxxxxxx>
> To: "XSL-List (E-mail)" <XSL-List@xxxxxxxxxxxxxxxxxxxxxx>;
> "svg-Developers@Yahoogroups. Com (E-mail)"
> Sent: Sunday, August 31, 2003 6:08 AM
> Subject: [xsl] XSLT Cookbook - HELP
> > Hi all,
> > I am newish to XSLT and brought the book 'XSLT Cookbook', after reading
> "Beginning XSLT". I am trying to work through the "XML to SVG" chapter.
> However, I find the book VERY disorganized. I
> >have spent the best part of my weekend trying to marry up code in the
> with the downloaded code files and then trying to get the examples to run.
> In some cases the code is very different, where
> >comments are removed (fair enough) but also whole new blocks of code are
> added ??????????. I think even advanced XML/XSLT users would find this a
> hassle.
> >
> > The online reviews I have read for this book say it's excellent! And I
> hoping it is just my lack of experience with XML and XSLT that is the main
> problem and that someone out there can help (Sol?,
> > Jenny?).
> >
> > Q1. How do I run the code on page 338 ("test-axis3" not "test-axis1" as
> expected), using Xalan? It seems to me that there is no XML data file to
> transform and produce "axis3.svg". ?
 Your first problem here (and admittedly this is my fault) is that the
 of the code in this chapter will only work with Saxon. The code in this
 chapter is some of the most complex in the book and it relies on
 ability to transparently convert result tree fragments to nodesets when
 <xsl:stylesheet version="1.1"  as used in svg-utils.xslt. This does not
 with Xalan. I attempted to port the svg chapter to Xalan by introducing
 version of svg-utils that used the exsl:node-set conversion function
 instead, but I then ran into some legitimate Xalan bugs and gave up. I
 try to resurrect that Xalan version and if I get it to work I will post
 on the O'Reilly site. Possibly the latest Xalan version will work
 than the one I was using at the time.

 If you are willing to use Saxon then this and all the other
 files can be run on any input whatsoever since the tests are self
 I often use the transform as the input file.

 For example:

 saxon test-axis3.xslt test-axis3.xslt > axis.svg

 produces axis.svg containing:

 <?xml version="1.0" encoding="UTF-8"?>

 <!DOCTYPE svg
   PUBLIC "-//W3C//DTD SVG 1.0/EN"
 <svg width="300" height="300">
    <svg:g xmlns:svg="http://www.w3.org/2000/svg";
 xmlns:emath="http://www.exslt.org/math"; transform="translate(30,270)
 scale(24,-1) translate(0,0)">
       <svg:line x1="0" y1="0" x2="10" y2="0" id="_xaxis"
       <svg:line x1="0" y1="4" x2="0" y2="-4"/>
       <svg:text x="0" y="-4" transform="translate(0,-4)
 scale(0.041666666666666664,-1) translate(0,4)"
       <svg:line x1="0.25" y1="2" x2="0.25" y2="-2"/>
       <svg:line x1="0.5" y1="2" x2="0.5" y2="-2"/>
       <svg:line x1="0.75" y1="2" x2="0.75" y2="-2"/>

 etc ...

 > Q2. Is there additional support info about this book about the
> code and how to run them. If there is not, I strongly recommend one be
> created.
> The readme files were intened to provide this but I seemed to miss some of
> the chapters including this one. I will remedy that and provide some
> introductory help and post it on the O'Reilly site.

 1) My name is Sal not Sol.
2) Jenny was the tech editor so I would not expect her to provide tech
 support post production! :-)

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

Current Thread