You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-dev@xmlgraphics.apache.org by "G. Ken Holman" <gk...@CraneSoftwrights.com> on 2000/08/25 16:42:55 UTC

Command line invocation consistency

Hi folks!

Please excuse me if this has already been covered, I've only just 
resubscribed to this list after a 5-month hiatus.

I set up similar invocation batch files for the Java-based Apache 
processors and found an inconsistency:  when specifying the name of a 
stylesheet file residing on another drive, I'm obliged in FOP to include 
"file:\" prefix, while with Xalan I'm not.

I prefer not having to use the prefix because arbitrarily adding it doesn't 
work for relative path names on the current directory.

Can FOP be changed to not require this prefix?

Thanks!

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

P:\apache\fop\fo>type x:\prog\xsljavaxalan.bat
@echo off
REM xsljavaxalan.bat
REM check arguments: %1=source XML, %2=script XSL, %3=result XML
REM environment: SET xalan=p:\apache\xalan\xsltcurr\
REM environment: SET xerces=p:\apache\xerces\xmlcurr\
echo Invoking Xalan jar....
jre -cp "%xalan%xalan.jar;%xerces%xerces.jar" org.apache.xalan.xslt.Process 
-in %1 -xsl %2 -out %3
REM post-process results

P:\apache\fop\fo>type x:\prog\xsljavafop.bat
@echo off
REM xslfop.bat
REM check arguments: %1=source XML, %2=script XSL, %3=result PDF
REM environment: SET fop=p:\apache\fop\xslcurr\
REM environment: SET xerces=p:\apache\xerces\xmlcurr\
REM environment: SET xalan=p:\apache\xalan\xsltcurr\
echo Invoking Xalan/FOP jar....
jre -cp 
"%fop%fop_bin.jar;%xalan%xalan.jar;%xerces%xerces.jar;%fop%w3c.jar;%fop%ant. 
jar;%fop%xml.jar" org.apache.fop.apps.XalanCommandLine %1 %2 %3
REM post-process results

P:\apache\fop\fo>xsljavaxalan list.fo t:\copyofall.xsl t:\list.out
Invoking Xalan jar....
========= Parsing file:/t:\copyofall.xsl ==========
Parse of file:/t:\copyofall.xsl took 1552 milliseconds
========= Parsing file:/P:\apache\fop\fo\list.fo ==========
Parse of file:/P:\apache\fop\fo\list.fo took 280 milliseconds
=============================
Transforming...
transform took 230 milliseconds
XSLProcessor: done

P:\apache\fop\fo>xsljavafop list.fo file:\t:\copyofall.xsl list.pdf
Invoking Xalan/FOP jar....
FOP-0_14_0
using SAX parser org.apache.xerces.parsers.SAXParser
transforming to xsl:fo markup
using renderer org.apache.fop.render.pdf.PDFRenderer
using element mapping org.apache.fop.fo.StandardElementMapping
using element mapping org.apache.fop.svg.SVGElementMapping
using property list mapping org.apache.fop.fo.StandardPropertyListMapping
using property list mapping org.apache.fop.svg.SVGPropertyListMapping
building formatting object tree
setting up fonts
formatting FOs into areas
  [1]
rendering areas to PDF
writing out PDF

P:\apache\fop\fo>xsljavafop list.fo t:\copyofall.xsl list.pdf
Invoking Xalan/FOP jar....
FOP-0_14_0
using SAX parser org.apache.xerces.parsers.SAXParser
transforming to xsl:fo markup
t:\copyofall.xsl; Line 0; Column 0
XSL Error: Could not parse t:\copyofall.xsl document!
XSL Error: SAX Exception
FATAL ERROR: File "t:\copyofall.xsl" not found.

P:\apache\fop\fo>

--
G. Ken Holman                    mailto:gkholman@CraneSoftwrights.com
Crane Softwrights Ltd.             http://www.CraneSoftwrights.com/s/
Box 266, Kars, Ontario CANADA K0A-2E0   +1(613)489-0999   (Fax:-0995)
Web site: XSL/XML/DSSSL/SGML services, training, libraries, products.
Book: Practical Transformation Using XSLT and XPath ISBN1-894049-05-5
Article:          What is XSLT? http://www.xml.com/pub/2000/08/holman
Next public instructor-led training:     2000-09-19/20,2000-10-03/05,
-        2000-10-09/10,2000-10-19,2000-11-12,2000-12-03/04,2001-01-27


Re: Command line invocation consistency- PROPOSED PATCH

Posted by Arved Sandstrom <Ar...@chebucto.ns.ca>.
On Sat, 26 Aug 2000, G. Ken Holman wrote:
> p.s. I will probably have a number of messages/questions coming up from 
> "the user's perspective" as I am finally starting to write my "Practical 
> Formatting Using XSL" course material ... I'm very comfortable with the XSL 
> concepts I plan to teach, I just have some questions about FOP as I am 
> treating FOP as a black box as would a user who doesn't know Java 
> would.  I'm looking forward to using FOP as the classroom engine for the 
> exercises.

User-perspective comments will be very useful. Might I also add that, with the
XSL CR coming up soon, that if you run across an instance of what looks like
FOP misinterpreting the spec, please draw it to our attention. I don't mean
implementation bugs, I mean spec comprehension bugs. Thanks.

Arved Sandstrom

-- 
Senior Developer
e-plicity.com (www.e-plicity.com)
Halifax, Nova Scotia
"B2B Wireless in Canada's Ocean Playground"

Re: Command line invocation consistency- PROPOSED PATCH

Posted by "G. Ken Holman" <gk...@CraneSoftwrights.com>.
Thank you, Karen, for looking into this issue.

At 00/08/26 00:04 +0200, Karen Lease wrote:
>First the why of the difference:

Thanks for the details.

>Now the answer: I have a modified version of XalanCommandLine,

I hope there is sufficient interest in getting this incorporated into the 
release stream.

>The patch (including some debugging messages) is attached if you or
>someone else wants to test it. I hope it works.

I hope so too, but I'm not in a position to test it.  Regarding Java 
"things" <confession>I am but a simple user of the jar files and haven't 
found the time to delve into what it takes to program or work with 
individual Java files</confession> and I am impressed with those for whom 
this is all so very straightforward.  I just haven't had the time to look 
into *everything*. :{)}

I hope someone can confirm Karen's work and decide it belongs in the release.

Thanks!

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

p.s. I will probably have a number of messages/questions coming up from 
"the user's perspective" as I am finally starting to write my "Practical 
Formatting Using XSL" course material ... I'm very comfortable with the XSL 
concepts I plan to teach, I just have some questions about FOP as I am 
treating FOP as a black box as would a user who doesn't know Java 
would.  I'm looking forward to using FOP as the classroom engine for the 
exercises.

--
G. Ken Holman                    mailto:gkholman@CraneSoftwrights.com
Crane Softwrights Ltd.             http://www.CraneSoftwrights.com/s/
Box 266, Kars, Ontario CANADA K0A-2E0   +1(613)489-0999   (Fax:-0995)
Web site: XSL/XML/DSSSL/SGML services, training, libraries, products.
Book: Practical Transformation Using XSLT and XPath ISBN1-894049-05-5
Article:          What is XSLT? http://www.xml.com/pub/2000/08/holman
Next public instructor-led training:     2000-09-19/20,2000-10-03/05,
-        2000-10-09/10,2000-10-19,2000-11-12,2000-12-03/04,2001-01-27


Re: Command line invocation consistency- PROPOSED PATCH

Posted by Karen Lease <kl...@club-internet.fr>.
Hi Ken,

First the why of the difference: when the Xalan Process class is invoked
directly, it does a lot of complicated processing on its arguments to
turn them into proper URLs; FOP uses a much simpler approach, and
therefore it doesn't handle this case correctly.

Now the answer: I have a modified version of XalanCommandLine, but I
can't test it with this particular case since I'm only running on Linux.
It does work correctly with relative path names.

The patch (including some debugging messages) is attached if you or
someone else wants to test it. I hope it works.

-Karen


"G. Ken Holman" wrote:
> 
> Hi folks!
> 
> Please excuse me if this has already been covered, I've only just
> resubscribed to this list after a 5-month hiatus.
> 
> I set up similar invocation batch files for the Java-based Apache
> processors and found an inconsistency:  when specifying the name of a
> stylesheet file residing on another drive, I'm obliged in FOP to include
> "file:\" prefix, while with Xalan I'm not.
> 
> I prefer not having to use the prefix because arbitrarily adding it doesn't
> work for relative path names on the current directory.
> 
> Can FOP be changed to not require this prefix?
> 
> Thanks!
> 
> ................ Ken
> 
> P:\apache\fop\fo>type x:\prog\xsljavaxalan.bat
> @echo off
> REM xsljavaxalan.bat
> REM check arguments: %1=source XML, %2=script XSL, %3=result XML
> REM environment: SET xalan=p:\apache\xalan\xsltcurr\
> REM environment: SET xerces=p:\apache\xerces\xmlcurr\
> echo Invoking Xalan jar....
> jre -cp "%xalan%xalan.jar;%xerces%xerces.jar" org.apache.xalan.xslt.Process
> -in %1 -xsl %2 -out %3
> REM post-process results
> 
> P:\apache\fop\fo>type x:\prog\xsljavafop.bat
> @echo off
> REM xslfop.bat
> REM check arguments: %1=source XML, %2=script XSL, %3=result PDF
> REM environment: SET fop=p:\apache\fop\xslcurr\
> REM environment: SET xerces=p:\apache\xerces\xmlcurr\
> REM environment: SET xalan=p:\apache\xalan\xsltcurr\
> echo Invoking Xalan/FOP jar....
> jre -cp
> "%fop%fop_bin.jar;%xalan%xalan.jar;%xerces%xerces.jar;%fop%w3c.jar;%fop%ant.
> jar;%fop%xml.jar" org.apache.fop.apps.XalanCommandLine %1 %2 %3
> REM post-process results
> 
> P:\apache\fop\fo>xsljavaxalan list.fo t:\copyofall.xsl t:\list.out
> Invoking Xalan jar....
> ========= Parsing file:/t:\copyofall.xsl ==========
> Parse of file:/t:\copyofall.xsl took 1552 milliseconds
> ========= Parsing file:/P:\apache\fop\fo\list.fo ==========
> Parse of file:/P:\apache\fop\fo\list.fo took 280 milliseconds
> =============================
> Transforming...
> transform took 230 milliseconds
> XSLProcessor: done
> 
> P:\apache\fop\fo>xsljavafop list.fo file:\t:\copyofall.xsl list.pdf
> Invoking Xalan/FOP jar....
> FOP-0_14_0
> using SAX parser org.apache.xerces.parsers.SAXParser
> transforming to xsl:fo markup
> using renderer org.apache.fop.render.pdf.PDFRenderer
> using element mapping org.apache.fop.fo.StandardElementMapping
> using element mapping org.apache.fop.svg.SVGElementMapping
> using property list mapping org.apache.fop.fo.StandardPropertyListMapping
> using property list mapping org.apache.fop.svg.SVGPropertyListMapping
> building formatting object tree
> setting up fonts
> formatting FOs into areas
>   [1]
> rendering areas to PDF
> writing out PDF
> 
> P:\apache\fop\fo>xsljavafop list.fo t:\copyofall.xsl list.pdf
> Invoking Xalan/FOP jar....
> FOP-0_14_0
> using SAX parser org.apache.xerces.parsers.SAXParser
> transforming to xsl:fo markup
> t:\copyofall.xsl; Line 0; Column 0
> XSL Error: Could not parse t:\copyofall.xsl document!
> XSL Error: SAX Exception
> FATAL ERROR: File "t:\copyofall.xsl" not found.
> 
> P:\apache\fop\fo>
> 
> --
> G. Ken Holman                    mailto:gkholman@CraneSoftwrights.com
> Crane Softwrights Ltd.             http://www.CraneSoftwrights.com/s/
> Box 266, Kars, Ontario CANADA K0A-2E0   +1(613)489-0999   (Fax:-0995)
> Web site: XSL/XML/DSSSL/SGML services, training, libraries, products.
> Book: Practical Transformation Using XSLT and XPath ISBN1-894049-05-5
> Article:          What is XSLT? http://www.xml.com/pub/2000/08/holman
> Next public instructor-led training:     2000-09-19/20,2000-10-03/05,
> -        2000-10-09/10,2000-10-19,2000-11-12,2000-12-03/04,2001-01-27