This is the mail archive of the docbook-apps@lists.oasis-open.org mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

VB: [docbook-apps] Custom title templates


Final solution!!!!!!!!!!!

 

Hälsningar

 

Lars Bjerges

Team Verktyg

* FöreningsSparbanken IT

105 34 Stockholm

( +46 (0)8 58 59 43 45

( +46 (0)70 95 27 774

-----Ursprungligt meddelande-----
Från: Bob Stayton [mailto:bobs@sagehill.net]
Skickat: den 9 juni 2004 08:33
Till: Lars Bjerges
Ämne: Re: [docbook-apps] Custom title templates

 

I'm glad to hear that worked.  Would you mind posting this to the list so the solution gets in the list archive?  Thanks.

 

Bob Stayton
Sagehill Enterprises
DocBook Consulting
bobs@sagehill.net

 

 

----- Original Message -----

From: Lars Bjerges

Sent: Tuesday, June 08, 2004 10:43 PM

Subject: RE: [docbook-apps] Custom title templates

 

You are so right.

Actually the position was resolved relative to where I was standing in the filesystem when executing the command, obviously nothing was found there - ergo IO Exception.

The includes originating in the "fo" directory (e.g. in docbook.xsl) where all resolved in their right place so that´s why it worked when I moved the include into the vanillaa docbook.xsl.

I added:

 <uri name="fspafop_titlepage.xsl" uri="file:///E:/docbook-xsl-1.65.1/fspafop_titlepage.xsl"/>

in the catalog.xml and then it worked all-right.

The answer is (almost) very simple when you know what you are looking for.

Thank you veary much for your time,

 

regards Lars 


From: Bob Stayton [mailto:bobs@sagehill.net]
Sent: Tue 6/8/2004
10:47 PM
To: Lars Bjerges
Subject: Re: [docbook-apps] Custom title templates

It looks like the XML catalog resolver is included.  Perhaps that is the source of the problem.  If you can locate the CatalogManager.properties file, perhaps you could increase the verbosity value to 3 to see how it is trying to resolve URIs.

 

Bob Stayton
Sagehill Enterprises
DocBook Consulting
bobs@sagehill.net

 

 

----- Original Message -----

From: Lars Bjerges

Sent: Tuesday, June 08, 2004 11:58 AM

Subject: RE: [docbook-apps] Custom title templates

 

Well, the xalanxmlfspacat is a BAT-file that I call from another BAT. It does the XML2FO translation and after that there is another FOP step that creats the PDF. I do not have access to Saxon or Xsltproc right now (and I´m on a dial-up so I don´t particulary care to download them right now).

However I ran the XSLT transform with echo on and this is the result:

 

E:\download\xmlmind>call E:\fop-0.20.5\xalanxmlfspacat e:\download\xmlmind\copygen.xml e:\docbook-xsl-1.65.1\fspafop.xsl e:\download\xmlmind\foo.fo

E:\download\xmlmind>rem ********************************************************************

E:\download\xmlmind>rem ** Batch file to run XSLT translation

E:\download\xmlmind>rem ** Parameters

E:\download\xmlmind>rem ** e:\download\xmlmind\copygen.xml XML file (in)

E:\download\xmlmind>rem ** e:\docbook-xsl-1.65.1\fspafop.xsl XSL file

E:\download\xmlmind>rem ** e:\download\xmlmind\foo.fo FO file (out)

E:\download\xmlmind>rem ********************************************************************

E:\download\xmlmind>set LOCAL_FOP_HOME=E:\fop-0.20.5\

E:\download\xmlmind>set LIBDIR=E:\fop-0.20.5\lib

E:\download\xmlmind>set LOCALCLASSPATH=build/fop.jar

E:\download\xmlmind>set LOCALCLASSPATH=build/fop.jar;E:\fop-0.20.5\lib\xml-apis.jar

E:\download\xmlmind>set LOCALCLASSPATH=build/fop.jar;E:\fop-0.20.5\lib\xml-apis.jar;E:\fop-0.20.5\lib\xercesImpl-2.2.1.jar

E:\download\xmlmind>set LOCALCLASSPATH=build/fop.jar;E:\fop-0.20.5\lib\xml-apis.jar;E:\fop-0.20.5\lib\xercesImpl-2.2.1.jar;E:\fop-0.20.5\lib\xalan-2.4
.1.jar

E:\download\xmlmind>set LOCALCLASSPATH=build/fop.jar;E:\fop-0.20.5\lib\xml-apis.jar;E:\fop-0.20.5\lib\xercesImpl-2.2.1.jar;E:\fop-0.20.5\lib\xalan-2.4
.1.jar;E:\fop-0.20.5\lib\resolver-1.0.jar

E:\download\xmlmind>set LOCALCLASSPATH=build/fop.jar;E:\fop-0.20.5\lib\xml-apis.jar;E:\fop-0.20.5\lib\xercesImpl-2.2.1.jar;E:\fop-0.20.5\lib\xalan-2.4
.1.jar;E:\fop-0.20.5\lib\resolver-1.0.jar;E:\fop-0.20.5\

E:\download\xmlmind>java -cp build/fop.jar;E:\fop-0.20.5\lib\xml-apis.jar;E:\fop-0.20.5\lib\xercesImpl-2.2.1.jar;E:\fop-0.20.5\lib\xalan-2.4.1.jar;E:\
fop-0.20.5\lib\resolver-1.0.jar;E:\fop-0.20.5\ -Djava.endorsed.dirs=E:\fop-0.20.5\lib org.apache.xalan.xslt.Process -ENTITYRESOLVER org.apache.xml.res
olver.tools.CatalogResolver -URIRESOLVER org.apache.xml.resolver.tools.CatalogResolver -IN e:\download\xmlmind\copygen.xml -XSL e:\docbook-xsl-1.65.1\
fspafop.xsl -OUT e:\download\xmlmind\foo.fo

file:///e:/docbook-xsl-1.65.1/fspafop.xsl; Line #5; Column #50; XSLT Error (javax.xml.transform.TransformerConfigurationException): javax.xml.transfor
m.TransformerException: javax.xml.transform.TransformerException: Had IO Exception with stylesheet file: fspafop_titlepage.xsl

E:\download\xmlmind>

As can be seen it´s a number of steps to build up the classpath and then just a java invocation running org.apache.xslt.Process pretty much like the original transformation BAT-file from Apache.

I don´t think the generated titles file is corrupt since it is the sam file that works allright when included in the "original" docbook.xsl. The only think that occurred, relating to that file, is that I copied it to another directory (onel level below where it was originallt residing. 

When I installed the stylesheets I put them in E:/docbook-xsl-1.65.1 so that means that e.g the fo-directory is E:/docbook-xsl-1.65.1/fo. My customizations are in the "root" directory (E:/docbook-xsl-1.65.1) so thats where my including and included xsls are when they don´t work. When I move my title-xsl (copy it) one level down into fo-directory and amend the docbook.xsl it works. Actually it also works when i point the include from the fo-directory one level up into the parent-directory.

Also I said I used Xalan 2-6-0 but I did not (as can be seen above). I have however tried that and had the same result.

It´s all very strange I think.

I will let it rest until tomorrow anyway since it´s been a long day, it´t 8:45 pm here in Sweden now and I think it´s a good idea to take a break.

 

Than you for your prompt answer,

regards Lars

 


From: Bob Stayton [mailto:bobs@sagehill.net]
Sent: Tue 6/8/2004
6:50 PM
To: Lars Bjerges; docbook-apps@lists.oasis-open.org
Subject: Re: [docbook-apps] Custom title templates

Hi Lars,

It should work as you originally set it up.  As you say, other included files worked.  Either there is something strange with the generated titles file, or something is going on within the command line. I can't tell what "xalanxmlfspacat" is doing.  Can you run the process with Xalan outside of that wrapper script?  Do you have access to Saxon or xsltproc to see if that works?

 

Bob Stayton
Sagehill Enterprises
DocBook Consulting
bobs@sagehill.net

 

 

----- Original Message -----

From: Lars Bjerges

Sent: Tuesday, June 08, 2004 4:19 AM

Subject: [docbook-apps] Custom title templates

 

Hi

I have been looking into the various features of DocBook for a short while and finally decided to do some work on title pages (PDF).

After carefully reading about how to go about it I did the following:

  1. Took a copy of fo/titlepage.templates.xml
  2. Modified it and transformed it by means of  template\titlepage.xsl
  3. I got a new xsl-file: fspafop_titlepage.xsl that I placed in the same directory as my custom xsl

I updated my cusom xsl to:

......

 <xsl:import href="">  <!-- fo titlepages -->
 <xsl:include href="">  <======
 <!-- include common parameters -->
 <xsl:include href="">  <!-- fo specifics -->

....

And did a transform.....

 

The result was sadly:

E:\download\xmlmind>call E:\fop-0.20.5\xalanxmlfspacat e:\download\xmlmind\copygen.xml e:\docbook-xsl-1.65.1\fspafop.xsl e:\download\xmlmind\foo.fo

file:///e:/docbook-xsl-1.65.1/fspafop.xsl; Line #5; Column #50; XSLT Error (javax.xml.transform.TransformerConfigurationException): javax.xml.transfor
m.TransformerException: javax.xml.transform.TransformerException: Had IO Exception with stylesheet file: fspafop_titlepage.xsl

So the include did not work.

After a couple of hours of researching different possibilities I finally went in and edited the "base"  fo/docbook.xsl changing the includes to:

<xsl:include href=""> <!-- <xsl:include href="" -->
<xsl:include href="" <=====
<xsl:include href="">

Then it worked!!!!

This is very strange I think since I have been using other includes (not as large as this one) in my customization layer and they worked directly.

 

What I use is:

DocBook DTD 4.3

DocBook Xsl 1.65.1

Xalan-j 2.6.0

Fop 0.20.5

 

Does anybody have a clue to the problem causing this?

 

Regards Lars

 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]