Bug 53005 - wrapper is not a block item
Summary: wrapper is not a block item
Status: RESOLVED FIXED
Alias: None
Product: Fop - Now in Jira
Classification: Unclassified
Component: fo tree (show other bugs)
Version: 1.0
Hardware: PC Mac OS X 10.4
: P2 normal
Target Milestone: ---
Assignee: fop-dev
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-03-29 20:55 UTC by Alberto Simões
Modified: 2012-04-03 16:39 UTC (History)
0 users



Attachments
Generated FO file (50.77 KB, application/xml)
2012-04-02 20:04 UTC, Alberto Simões
Details
Original DocBook document (1.16 KB, application/xml)
2012-04-02 20:05 UTC, Alberto Simões
Details
minimal FO test file (718 bytes, text/xml)
2012-04-02 21:59 UTC, Glenn Adams
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alberto Simões 2012-03-29 20:55:07 UTC
Was getting this error:

javax.xml.transform.TransformerException: org.apache.fop.fo.ValidationException: "fo:inline" is not a valid child of "fo:block"!  (See position 1870:716)

After talking with the folks in the docbook XSLT mailing list, they helped me finding out that:

""
Based on the .fo file that Alberto sent to me, this appears to be a bug in FOP 1.0.  I can reproduce it by putting an indexterm inside an inline element inside a footnote. In general,  an indexterm generates an fo:wrapper element to hold the indexterm id marker.  When this fo:wrapper is inside an fo:inline, it appears to confuse FOP, but only when inside a footnote. Removing the fo:wrapper removes the error.  All other locations with that construction do not generate an error.  Two other XSL-FO processors did not produce an error.
""

Somebody added:

""
FYI, until recently indexterms were not allowed inside footnotes at all:
  http://www.docbook.org/tdg5/en/html/footnote.html
They are allowed with v5.1:
  http://www.docbook.org/tdg51/en/html/footnote.html
""

Thank you,
Alberto
Comment 1 Pascal Sancho 2012-03-30 08:15:04 UTC
Please,
can you:
 1/ reformulate short description matching FOP vocabulary (indexterm and docbook are not handled by FOP)?
 2/ attach a short XSL-FO (xml + xslt result) that demonstrates the issue?
Comment 2 Alberto Simões 2012-04-02 20:04:53 UTC
Created attachment 28532 [details]
Generated FO file
Comment 3 Alberto Simões 2012-04-02 20:05:19 UTC
Created attachment 28533 [details]
Original DocBook document
Comment 4 Alberto Simões 2012-04-02 20:08:01 UTC
Hey,

Sorry for taking so much time, but I got some trouble on finding the portion that was giving trouble.

I attached the docbook file, and the generated fo file. I can't attach the XSLT files, as they are too many :)

Please let me know how/if I can help.

Thank you
Alberto
Comment 5 Glenn Adams 2012-04-02 21:56:38 UTC
this bug is due to isBlockItem() returning true for wrapper

            } else if (!canHaveBlockLevelChildren && isBlockItem(nsURI, localName)) {
                invalidChildError(loc, getParent().getName(), nsURI, getName(),
                                  "rule.inlineContent");
            } else {

in particular isBlockItem() returns true for block *or* neutral, so this condition needs to be further qualified as:

            } else if (!canHaveBlockLevelChildren && isBlockItem(nsURI, localName)
                         && !isNeutralItem(nsURI, localName)) {
Comment 6 Glenn Adams 2012-04-02 21:57:14 UTC
(In reply to comment #5)
> this bug is due to isBlockItem() returning true for wrapper
> 
>             } else if (!canHaveBlockLevelChildren && isBlockItem(nsURI,
> localName)) {
>                 invalidChildError(loc, getParent().getName(), nsURI, getName(),
>                                   "rule.inlineContent");
>             } else {
> 
> in particular isBlockItem() returns true for block *or* neutral, so this
> condition needs to be further qualified as:
> 
>             } else if (!canHaveBlockLevelChildren && isBlockItem(nsURI,
> localName)
>                          && !isNeutralItem(nsURI, localName)) {

see Inline.java:120
Comment 7 Glenn Adams 2012-04-02 21:59:28 UTC
Created attachment 28534 [details]
minimal FO test file