Re: Cannot build simple DOcBook document with fop svn 637076; works with 0.94

2008-03-17 Thread Vincent Hennebert
Hi John,

John Brown wrote:
 Hello All,
 
 Please see the attached archive book2.tgz, which contains:
 
 book2.xml - Minimal DocBook file
 book2.fo - Generated from book.xml using DocBook stylesheets with xsltproc
 
 I tried to convert the .fo to PDF with fop-0.94 and fop-trunk. My 
 installed packages are:
 
 DocBook DTD 4.1.2
 DocBook XSL Stylesheets 1.62.0
 JDK 1.6.0_03
 fop-0.94 and fop svn (revision 637380)
 xsltproc - Using libxml 20627, libxslt 10120 and libexslt 813
snip/
 Mar 15, 2008 5:57:18 AM org.apache.fop.cli.Main startFOP
 SEVERE: Exception
 java.lang.IllegalStateException: Flow 'xsl-region-body' does not map to the 
 regi
 on-body in page-master 'blank'. FOP presently does not support this.
 at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:217)
 at org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:125)
 at org.apache.fop.cli.Main.startFOP(Main.java:166)
 at org.apache.fop.cli.Main.main(Main.java:197)
snip/
 I don't have to use the svn version, of course, but since bugs are being 
 fixed and
 features added all the time ...
 
 How can I make xsltproc generate FO that will be accepted by fop trunk? 
 Probably
 by upgrading my stylesheets? My DocBook DTD and stylesheets are not nearly
 the most current versions. I use these particular versions because they are 
 able
 to build the HTML documentation for an open-source package that I use.

Using an old version of DocBook is usually ok since no 
backward-incompatible changes are introduced in a series (4.x). So if 
your DocBook file validates against the 4.1.2 DTD, it is likely to also 
validate against the latest 4.5 DTD.

However, you definitely want to upgrade your XSLT stylesheets to the 
latest 1.73.2 version. A fop1.extensions parameter was introduced to 
take the specificities of FOP 0.93+ into account (like this page-master 
‘blank’ problem), and a lot of bugs fixes and new features are 
introduced every time. If you’re not familiar with XSLT it’s the way to 
go. Watch also the docbook-apps@ [1] mailing list for help with 
customizing the stylesheets.


[1] http://www.docbook.org/help

HTH,
Vincent


-- 
Vincent HennebertAnyware Technologies
http://people.apache.org/~vhennebert http://www.anyware-tech.com
Apache FOP Committer FOP Development/Consulting

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Cannot build simple DOcBook document with fop svn 637076; works with 0.94

2008-03-16 Thread John Brown


Andreas Delmelle wrote:

 What I could do, is make the necessary adjustments to your FO to
 avoid the error, but I'm not certain if the result is still what you
 expect: see attachment FO + result PDF.

 HTH!


I finally looked at your PDF and saw that it looked just the way that it
ought to look in my opinion. The table of contents and chapter 1 both
start on odd-numbered pages.

I have a few questions.

1) Can you explain briefly what changes you made to the FO? It seems
that there are *no* line breaks in the FO produced by fop. The only
editor that I have that can edit it is vi. I was hoping to format the FO
by displaying it in Internet Explorer, and then Copy+Paste into a text
editor, but the '+' and '-' used to expand and collapse the tree are
also copied.

2) Did you have to search the whole file looking for the tag(s) that
needed to be changed, or did you have to make only one change?
That is, if my FO had 500 pages instead of 5 pages, how much work
would it be to edit the FO by hand?

3) What did you use to edit the FO?

_
Need to know the score, the latest news, or you need your Hotmail®-get your 
fix.
http://www.msnmobilefix.com/Default.aspx
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Cannot build simple DOcBook document with fop svn 637076; works with 0.94

2008-03-16 Thread Andreas Delmelle

On Mar 16, 2008, at 08:46, John Brown wrote:

Hi John,



I finally looked at your PDF and saw that it looked just the way  
that it

ought to look in my opinion. The table of contents and chapter 1 both
start on odd-numbered pages.

I have a few questions.

1) Can you explain briefly what changes you made to the FO?


As I recall, the only small things I altered were:
- remove the region-name property from the fo:region-body in the  
very first fo:simple-page-master
- on that same fo:region-body, set the margin-bottom and -top such  
that the region has zero height
- a bit further on, there were some fo:static-contents that mapped  
to the 'blank body' region; I commented those out.



It seems that there are *no* line breaks in the FO produced by fop.


Correct. That is generally the case when you take a look at  
serialized XML. The XML is far from optimized to be viewed by humans,  
but very friendly for consuming processes (no excess whitespace,  
linefeeds..)


Since the FO was very small, I used jEdit to open it. It has an XML  
Indenter plugin to aid with the readability.
Another option would have been to use an identity transform: run the  
serialized FO through a very simple XSLT which does no more than copy  
the source, but uses the indent='yes' hint on the xsl:output element.


The only editor that I have that can edit it is vi. I was hoping to  
format the FO

by displaying it in Internet Explorer, and then Copy+Paste into a text
editor, but the '+' and '-' used to expand and collapse the tree are
also copied.

2) Did you have to search the whole file looking for the tag(s) that
needed to be changed, or did you have to make only one change?


I did it with simple trial-and-error:
1) run the FO through FOP, and see what errors/warnings arise
2) adapt the FO, and re-run

It took me only three iterations before the FO worked without errors.  
I also noticed, but ignored the font-related warnings.



That is, if my FO had 500 pages instead of 5 pages, how much work
would it be to edit the FO by hand?


If your FO would have had 500 pages, I honestly would never have  
edited it by hand completely. Practically all text-editors I know of,  
have problems with files that large (especially if it's XML, and the  
editor wants to validate it...) There are some editors available that  
focus on being able to load huge files, but these don't come with the  
nifty syntax highlighting features, of course...


I would probably have extracted one or two page-sequences (again:  
using a very simple XSLT stylesheet), and have a look at that, before  
wading through megabytes of XSL-FO.



3) What did you use to edit the FO?


jEdit[*], a pure Java text-editor, is quite OK for this purpose,  
although it is a bit bloated and can be slow at times (depends on  
which plugins you have installed). It comes equipped with syntax- 
highlighting and code-completion for FO, amongst others.
Notepad++, which I discovered only recently,  would also be a good  
choice for the Windows-platform. It only knows XML (not XSL-FO  
specifically), but being a native Windows-app, it is very light- 
weight and fast.


[*] = http://www.jedit.org
[**] = http://notepad-plus.sourceforge.net


HTH!

Cheers

Andreas

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Cannot build simple DOcBook document with fop svn 637076; works with 0.94

2008-03-16 Thread John Brown





Andreas Delmelle wrote:

 On Mar 16, 2008, at 08:46, John Brown wrote:
 
 Hi John,
 
 
  I finally looked at your PDF and saw that it looked just the way  
  that it
  ought to look in my opinion. The table of contents and chapter 1 both
  start on odd-numbered pages.
 
  I have a few questions.
 
  1) Can you explain briefly what changes you made to the FO?
 
 As I recall, the only small things I altered were:
 - remove the region-name property from the fo:region-body in the  
 very first fo:simple-page-master
 - on that same fo:region-body, set the margin-bottom and -top such  
 that the region has zero height
 - a bit further on, there were some fo:static-contents that mapped  
 to the 'blank body' region; I commented those out.
 
[snip]

I suppose that this means that I could fix the problem by modifying the
Docbook stylesheets (not easy with my Hello, world! knowledge), but
which is wrong, fop or the stylesheets?
 
By the way, I just discovered that xmllint --format can indent the FO.

_
Need to know the score, the latest news, or you need your Hotmail®-get your 
fix.
http://www.msnmobilefix.com/Default.aspx

Cannot build simple DOcBook document with fop svn 637076; works with 0.94

2008-03-15 Thread John Brown

Hello All,

Please see the attached archive book2.tgz, which contains:

book2.xml - Minimal DocBook file
book2.fo - Generated from book.xml using DocBook stylesheets with xsltproc



I tried to convert the .fo to PDF with fop-0.94 and fop-trunk. My installed 
packages are:

DocBook DTD 4.1.2
DocBook XSL Stylesheets 1.62.0
JDK 1.6.0_03
fop-0.94 and fop svn (revision 637380)
xsltproc - Using libxml 20627, libxslt 10120 and libexslt 813

It works with fop-0.94, but fop-trunk gives the following errors:
C:\Downloads\Utils\fopfop c:\msys\tmp\book2.fo c:\msys\tmp\book2.pdf
Mar 15, 2008 5:56:56 AM org.apache.fop.cli.Main startFOP
SEVERE: Exception
java.io.FileNotFoundException: c:\msys\tmp\book2.pdf (The process cannot access
the file because it is being used by another process)
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.(Unknown Source)
at java.io.FileOutputStream.(Unknown Source)
at org.apache.fop.cli.Main.startFOP(Main.java:161)
at org.apache.fop.cli.Main.main(Main.java:197)

C:\Downloads\Utils\fopfop c:\msys\tmp\book2.fo c:\msys\tmp\book2.pdf
Mar 15, 2008 5:57:17 AM org.apache.fop.fonts.FontInfo notifyFontReplacement
WARNING: Font 'Symbol,normal,700' not found. Substituting with 'Symbol,normal,40
0'.
Mar 15, 2008 5:57:17 AM org.apache.fop.fonts.FontInfo notifyFontReplacement
WARNING: Font 'ZapfDingbats,normal,700' not found. Substituting with 'ZapfDingba
ts,normal,400'.
Mar 15, 2008 5:57:18 AM org.apache.fop.cli.Main startFOP
SEVERE: Exception
java.lang.IllegalStateException: Flow 'xsl-region-body' does not map to the regi
on-body in page-master 'blank'. FOP presently does not support this.
at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:217)
at org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:125)
at org.apache.fop.cli.Main.startFOP(Main.java:166)
at org.apache.fop.cli.Main.main(Main.java:197)

-

java.lang.IllegalStateException: Flow 'xsl-region-body' does not map to the regi
on-body in page-master 'blank'. FOP presently does not support this.
at org.apache.fop.layoutmgr.PageProvider.cacheNextPage(PageProvider.java
:275)
at org.apache.fop.layoutmgr.PageProvider.getPage(PageProvider.java:221)
at org.apache.fop.layoutmgr.PageProvider.getPage(PageProvider.java:185)
at org.apache.fop.layoutmgr.PageSequenceLayoutManager.createPage(PageSeq
uenceLayoutManager.java:139)
at org.apache.fop.layoutmgr.AbstractPageSequenceLayoutManager.makeNewPag
e(AbstractPageSequenceLayoutManager.java:289)
at org.apache.fop.layoutmgr.AbstractPageSequenceLayoutManager.doForcePag
eCount(AbstractPageSequenceLayoutManager.java:370)
at org.apache.fop.area.AreaTreeHandler.finishPrevPageSequence(AreaTreeHa
ndler.java:186)
at org.apache.fop.area.AreaTreeHandler.startAbstractPageSequence(AreaTre
eHandler.java:199)
at org.apache.fop.area.AreaTreeHandler.startPageSequence(AreaTreeHandler
.java:194)
at org.apache.fop.fo.pagination.PageSequence.startOfNode(PageSequence.ja
va:114)
at org.apache.fop.fo.FOTreeBuilder$MainFOHandler.startElement(FOTreeBuil
der.java:300)
at org.apache.fop.fo.FOTreeBuilder.startElement(FOTreeBuilder.java:168)
at org.apache.xalan.transformer.TransformerIdentityImpl.startElement(Tra
nsformerIdentityImpl.java:1072)
at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Sour
ce)
at org.apache.xerces.xinclude.XIncludeHandler.startElement(Unknown Sourc
e)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unkn
own Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContent
Dispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Un
known Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Sour
ce)
at org.apache.xalan.transformer.TransformerIdentityImpl.transform(Transf
ormerIdentityImpl.java:484)
at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:214)
at org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:125)
at org.apache.fop.cli.Main.startFOP(Main.java:166)
at org.apache.fop.cli.Main.main(Main.java:197)

I don't have to use the svn version, of course, but since bugs are being fixed 
and
features added all the time ...

How can I make xsltproc generate FO that will be accepted by fop trunk? Probably
by upgrading my stylesheets? My DocBook DTD and stylesheets are not nearly
the most current versions. I use these particular versions because they are able
to build the HTML documentation for an open-source package that I use.


_
Need to know the score, the latest news, or you need your Hotmail®-get your 
fix.
http://www.msnmobilefix.com/Default.aspx

book2.tgz
Description: Binary data

RE: Cannot build simple DocBook document with fop svn 637076; works with 0.94

2008-03-15 Thread John Brown



Andreas Delmelle wrote:

 On Mar 15, 2008, at 12:21, John Brown wrote:

 Hi

 I tried to convert the .fo to PDF with fop-0.94 and fop-trunk. My
 installed packages are:

 DocBook DTD 4.1.2
 DocBook XSL Stylesheets 1.62.0
 JDK 1.6.0_03
 fop-0.94 and fop svn (revision 637380)
 xsltproc - Using libxml 20627, libxslt 10120 and libexslt 813

 It works with fop-0.94, but fop-trunk gives the following errors:
 C:\Downloads\Utils\fopfop c:\msys\tmp\book2.fo c:\msys\tmp\book2.pdf
 Mar 15, 2008 5:56:56 AM org.apache.fop.cli.Main startFOP
 SEVERE: Exception
 java.io.FileNotFoundException: c:\msys\tmp\book2.pdf (The process
 cannot access
 the file because it is being used by another process)

 This seems like a familiar issue to me. Did you have the PDF open in
 another application, perhaps?

Oops. Yes, Acrobat Reader locked the file. I was concerned about the
Illegal State exceptions, which seemed to be complaining about the FO.


 
 SEVERE: Exception
 java.lang.IllegalStateException: Flow 'xsl-region-body' does not
 map to the regi
 on-body in page-master 'blank'. FOP presently does not support this.

 Also a familiar one: in XSL-FO it is possible to define a page-master
 with a region-body with region-name other than the one to which the
 fo:flow maps, for blank pages. FOP currently has a small problem with
 that.


Not that it means anything to me; I'm still at the Hello world stage :),
but thanks anyway.

 How can I make xsltproc generate FO that will be accepted by fop
 trunk? Probably
 by upgrading my stylesheets?

 My experience with Docbook is severely limited I'm afraid, so
 unfortunately I cannot tell you how to make it behave this way...
 Upgrading to Docbook 1.7x seems like it's worth a shot.


Fop trunk works with the updated stylesheets. Book2.pdf was produced
with fop-0.94 and the FO from the old stylesheet without warnings.
Book2b.pdf was produced with fop trunk and the new stylesheet with the
following warnings:

Mar 15, 2008 8:27:58 AM org.apache.fop.fonts.FontInfo notifyFontReplacement
WARNING: Font 'Symbol,normal,700' not found. Substituting with 'Symbol,normal,40
0'.
Mar 15, 2008 8:27:58 AM org.apache.fop.fonts.FontInfo notifyFontReplacement
WARNING: Font 'ZapfDingbats,normal,700' not found. Substituting with 'ZapfDingba
ts,normal,400'.

Recently, I saw some messages about font configuration, so between the archives
and the FOP documentation, I should be able to understand the warnings.

I have attached both PDF files. Note that book2.pdf has 5 pages (one is blank)
while book2b.pdf has 4 pages. I am not sure which one, if any, is what the
author intended. The author did not provide a PDF.

I think that, assuming duplex printing,  the Table of Contents,as well as each
chapter, should start on an odd-numbered page. Neither PDF meets this
requirement. Still, it is a minimal example, and maybe it is up to the author
to specifically insert blank pages.



_
Climb to the top of the charts! Play the word scramble challenge with star 
power.
http://club.live.com/star_shuffle.aspx?icid=starshuffle_wlmailtextlink_jan

book2.pdf
Description: Adobe PDF document


book2b.pdf
Description: Adobe PDF document
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]