Bug 37329 - Relaxed validation NYI for fo:table-cells
Summary: Relaxed validation NYI for fo:table-cells
Status: CLOSED FIXED
Alias: None
Product: Fop - Now in Jira
Classification: Unclassified
Component: fo tree (show other bugs)
Version: trunk
Hardware: PC Windows 2000
: P2 enhancement
Target Milestone: ---
Assignee: fop-dev
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-11-02 11:40 UTC by M.H.
Modified: 2012-04-01 06:36 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description M.H. 2005-11-02 11:40:54 UTC
I downloaded the latest FOP trunk of 1.0, build the fop.jar with the ANT script 
supplied and tested generation PDF files from XML/XSL sources (in comparison to 
FOP 0.20.5). After fixing some simpler error messages (like "fo:region-before 
must be declared before fo:region-after"), none of your documents run through 
because of this error

javax.xml.transform.TransformerException: 
org.apache.fop.fo.ValidationException: Error(Unknown location): fo:table-cell 
is missing child elements. 
Required Content Model: marker* (%block;)+

Well, I don't really understand what this error means. It would also be helpful 
to have the name of the source file included. As each of our XML/XSL documents 
reference further XML/XML documents (<xsl:include ...>), and all have many 
tables, it would be helpful to have the filename and the line number. Is this 
possible?
Comment 1 Chris Bowditch 2005-11-02 12:03:41 UTC
<xsl:include> has nothing to do with XSL-FO or FOP, it is specific to XSLT. 
Generating a Printed Document (PDF or PS) from XML is typically a two step 
process: XML + XSL -> FO -> PDF

FOP is responsible for generating a PDF from FO. For the user's convenience 
the interface to FOP will take XML + XSL files which FOP passes off to a XSLT 
processor, e.g. Xalan, which generates the FO file, and passes it via SAX to 
FOP which generates the PDF.

So in order to track down your problem when you have multiple XSL files you 
will need to first run the XSL Transform part of this process separately using 
Xalan or similar to generate a large FO file which will have all your 
xsl:includes pulled in. It should then be easier to find the problem by 
looking at the FO file.

A polite request: problems/questions should be directed to the fop-user 
mailing list before they are raised as bugs. Thanks
Comment 2 Manuel Mall 2005-11-02 12:16:19 UTC
Have you seen http://xmlgraphics.apache.org/fop/trunk/upgrading.html ? The 
upgrade issue you describe is explained in a fairly prominent position on that 
page.
Comment 3 M.H. 2005-11-02 13:20:06 UTC
If you mean this:

While FOP 0.20.5 allowed you to have empty fo:table-cell elements, the new code 
will complain about that (unless relaxed validation is enabled) because the 
specification demands at least one block-level element ((%block;)+, see XSL-FO 
1.0, 6.7.10) inside an fo:table-cell element. 

It still appears after adding "-r" in the fop.bat call ("relaxed validation").
Comment 4 M.H. 2005-11-02 13:30:39 UTC
>A polite request: problems/questions should be directed to the fop-user 
mailing list before they are raised as bugs. Thanks

This is not a question, but a "request for enhancement".  The error message I 
posted above is an example. And it is a error message from FOP (as a FOP user, 
it doesn't matter if it uses Xalan or similar internally), so I ask if it would 
be possible to give some more information in the error message to identify 
which source files are concerend.
Comment 5 Chris Bowditch 2005-11-02 14:40:56 UTC
As I explained the XSL files have nothing to do with FOP, so its impossible 
for FOP to tell you which file/line number in XSL stylesheet(s) the problem 
lies at. FOP can only tell you which line in the single FO file the error 
occurred at.
Comment 6 Andreas L. Delmelle 2005-11-02 18:24:39 UTC
For the record:
1. I agree with Chris that FOP can't be expected to tell you where precisely in which source document 
the error lies (FOP is ultimately presented with the result of the XSL transform, so all the references to 
whatever source files you're using is lost at that point) FOP could add location info to the error 
message, but this makes little sense if the intermediate FO doesn't exist as a physical file.

2. The error message is, IMO, quite self-explanatory (at least for anyone who has had so much as a 
glance at the XSL-FO Recommendation). It simply means that an fo:table-cell should have 'zero-or-
more markers' plus 'one-or-more block-level' descendants (according to the XSL-FO Rec.)

3. The relaxed validation doesn't work yet for this particular case... Either this is an oversight in the 
docs, or this is still TODO. I'll see if I can commit a fix for this ASAP.
Comment 7 Andreas L. Delmelle 2005-11-02 19:24:26 UTC
OK it's fixed. 
Please do note that this will only lead to usable results if the cells are really supposed to be empty. Any 
text-content of the cell will be silently ignored/dropped.
Comment 8 Andreas L. Delmelle 2005-11-02 19:34:40 UTC
On second thought: dropping it silently seemed outright stupid, so added a little warning message
Comment 9 Glenn Adams 2012-04-01 06:36:56 UTC
batch transition pre-FOP1.0 resolved+fixed bugs to closed+fixed