You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by Marco <me...@gmx.ch> on 2008/08/21 15:09:04 UTC

Fop-0.95: NPE when having an empty -element with hyphenation turned on

Hi all,

I get a NullPointerException (see end of message) when transforming the following file with fop-0.95. (fop-0.94 can handle this).
<?xml version="1.0" encoding="utf-8"?>
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
    <fo:layout-master-set>
        <fo:simple-page-master master-name="LetterPage" page-width="6in" 
                                  page-height="3in">
            <fo:region-body region-name="PageBody" margin="0.7in" 
                               background-color="rgb(245,245,245)"/>
        </fo:simple-page-master>
    </fo:layout-master-set>
    <fo:page-sequence master-reference="LetterPage" hyphenate="true">
        <fo:flow flow-name="PageBody">
            <fo:block font="12pt Arial">
                <!-- the following line causes a NullPointerException, if hyphenate is true -->
                <fo:inline id="document.general.efficiently.dictionary"/>
                <!-- the following line is working fine -->
                Some <fo:inline font-weight="bold" color="red">inline text</fo:inline> formatting.
            </fo:block>
        </fo:flow>
    </fo:page-sequence>
</fo:root>

It only happens when hyphenation is set to true and if the <fo:inline> element does not contain any text (I came across this while transforming a docbook <anchor> tag with the the docbook-xsl stylesheets).

Any ideas how to solve this? Do you want me to file a bug?

Cheers,
Marco

-----------------------------------
java.lang.NullPointerException
        at org.apache.fop.layoutmgr.inline.InlineStackingLayoutManager.applyChanges(InlineStackingLayoutManager.java:350)
        at org.apache.fop.layoutmgr.inline.LineLayoutManager.findHyphenationPoints(LineLayoutManager.java:1480)
        at org.apache.fop.layoutmgr.inline.LineLayoutManager.findOptimalBreakingPoints(LineLayoutManager.java:950)
        at org.apache.fop.layoutmgr.inline.LineLayoutManager.createLineBreaks(LineLayoutManager.java:917)
        at org.apache.fop.layoutmgr.inline.LineLayoutManager.getNextKnuthElements(LineLayoutManager.java:607)
        at org.apache.fop.layoutmgr.BlockStackingLayoutManager.getNextKnuthElements(BlockStackingLayoutManager.java:294)
        at org.apache.fop.layoutmgr.BlockLayoutManager.getNextKnuthElements(BlockLayoutManager.java:116)
        at org.apache.fop.layoutmgr.FlowLayoutManager.getNextKnuthElements(FlowLayoutManager.java:107)
        at org.apache.fop.layoutmgr.PageBreaker.getNextKnuthElements(PageBreaker.java:145)
        at org.apache.fop.layoutmgr.AbstractBreaker.getNextBlockList(AbstractBreaker.java:552)
        at org.apache.fop.layoutmgr.PageBreaker.getNextBlockList(PageBreaker.java:137)
        at org.apache.fop.layoutmgr.AbstractBreaker.doLayout(AbstractBreaker.java:302)
        at org.apache.fop.layoutmgr.AbstractBreaker.doLayout(AbstractBreaker.java:264)
        at org.apache.fop.layoutmgr.PageSequenceLayoutManager.activateLayout(PageSequenceLayoutManager.java:106)
        at org.apache.fop.area.AreaTreeHandler.endPageSequence(AreaTreeHandler.java:234)
        at org.apache.fop.fo.pagination.PageSequence.endOfNode(PageSequence.java:123)
        at org.apache.fop.fo.FOTreeBuilder$MainFOHandler.endElement(FOTreeBuilder.java:340)
        at org.apache.fop.fo.FOTreeBuilder.endElement(FOTreeBuilder.java:169)
        at org.apache.xalan.transformer.TransformerIdentityImpl.endElement(TransformerIdentityImpl.java:1101)
        at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
        at org.apache.xerces.xinclude.XIncludeHandler.endElement(Unknown Source)
        at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source)
        at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
        at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown 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 Source)
        at org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.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)

-- 
GMX startet ShortView.de. Hier findest Du Leute mit Deinen Interessen!
Jetzt dabei sein: http://www.shortview.de/wasistshortview.php?mc=sv_ext_mf@gmx

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: Fop-0.95: NPE when having an empty -element with hyphenation turned on

Posted by Marco <me...@gmx.ch>.
-------- Original-Nachricht --------
> Datum: Thu, 21 Aug 2008 18:50:38 +0200
> Von: Andreas Delmelle <an...@telenet.be>
> An: fop-users@xmlgraphics.apache.org
> Betreff: Re: Fop-0.95: NPE when having an empty <fo:inline>-element with hyphenation turned on

> On Aug 21, 2008, at 15:09, Marco wrote:
> 
> > Hi all,
> >
> > I get a NullPointerException (see end of message) when transforming  
> > the following file with fop-0.95. (fop-0.94 can handle this).
> > <snip />
> > It only happens when hyphenation is set to true and if the  
> > <fo:inline> element does not contain any text (I came across this  
> > while transforming a docbook <anchor> tag with the the docbook-xsl  
> > stylesheets).
> >
> > Any ideas how to solve this? Do you want me to file a bug?
> 
> Creating an issue in Bugzilla would indeed be helpful, so we don't  
> forget about it.
> I know that in 0.95, at least ids on empty fo:inlines work. If I  
> remember correctly, 0.94 simply does not process empty inlines, so  
> while it does not crash, the id cannot be referenced from a page- 
> number-citation or a basic-link.
> 
> Seems that, while correcting this, I did not add a check for empty  
> inlines in hyphenated blocks.
> 
> 
> Thanks
> 
> Andreas
> 
> 

Andreas,

Thanks for the quick reply.
I've just created https://issues.apache.org/bugzilla/show_bug.cgi?id=45667 which basically contains a copy of this mail.
Cheers,
Marco
-- 
Psssst! Schon das coole Video vom GMX MultiMessenger gesehen?
Der Eine für Alle: http://www.gmx.net/de/go/messenger03

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: Fop-0.95: NPE when having an empty -element with hyphenation turned on

Posted by Andreas Delmelle <an...@telenet.be>.
On Aug 21, 2008, at 15:09, Marco wrote:

> Hi all,
>
> I get a NullPointerException (see end of message) when transforming  
> the following file with fop-0.95. (fop-0.94 can handle this).
> <snip />
> It only happens when hyphenation is set to true and if the  
> <fo:inline> element does not contain any text (I came across this  
> while transforming a docbook <anchor> tag with the the docbook-xsl  
> stylesheets).
>
> Any ideas how to solve this? Do you want me to file a bug?

Creating an issue in Bugzilla would indeed be helpful, so we don't  
forget about it.
I know that in 0.95, at least ids on empty fo:inlines work. If I  
remember correctly, 0.94 simply does not process empty inlines, so  
while it does not crash, the id cannot be referenced from a page- 
number-citation or a basic-link.

Seems that, while correcting this, I did not add a check for empty  
inlines in hyphenated blocks.


Thanks

Andreas


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org