You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-dev@xmlgraphics.apache.org by Andreas L Delmelle <a_...@pandora.be> on 2006/08/06 18:48:29 UTC
Funny FYI: markers as initial children...?
I discovered the following in our testcase 'marker_font-size.xml'
<fo:block background-color="red" white-space-collapse="false">
<fo:marker marker-class-name="m1">
<fo:block font-size=".5em">
First marker with small font
</fo:block>
</fo:marker>
</fo:block>
According to the Rec, a marker must be an initial child of its
parent, but the above generates a FOText child node for which
willCreateArea() returns true, hence FObj.addMarker() logs an error,
so that there is no marker to retrieve, and the checks obviously
fail. :)
Don't know if it's wrong, but I removed those from the testcases to
make them pass...
Cheers,
Andreas
Re: Funny FYI: markers as initial children...?
Posted by "J.Pietschmann" <j3...@yahoo.de>.
Andreas L Delmelle wrote:
> Yeah, and taking into account that quite a lot of people forget to
> remove the indent attribute from xsl:output once they know the FO to be
> generated correctly...
I don't think it's all that bad. The indent attribute has no effect
unless the output of the XSLT is serialized. And if you write
<fo:block>
<fo:marker ...
in an XSLT file, the whitespace is stripped by the XSLT processor.
I believe people writing FO by hand are suffering most. I know because
the FOP 0.20.x series already complained...
J.Pietschmann
Re: Funny FYI: markers as initial children...?
Posted by Andreas L Delmelle <a_...@pandora.be>.
On Aug 8, 2006, at 11:10, Jeremias Maerki wrote:
> I agree with the interpretation. I just wonder whether a normal
> user will
> get it. Hmm.
Yeah, and taking into account that quite a lot of people forget to
remove the indent attribute from xsl:output once they know the FO to
be generated correctly...
I can see people frowning already :)
Cheers,
Andreas
Re: Funny FYI: markers as initial children...?
Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
I agree with the interpretation. I just wonder whether a normal user will
get it. Hmm.
On 07.08.2006 18:21:24 Andreas L Delmelle wrote:
> On Aug 7, 2006, at 13:23, Manuel Mall wrote:
>
> > On Monday 07 August 2006 18:33, Chris Bowditch wrote:
> >> <snip />
> >> Surely this rule in the spec means first non-whitespace only node???
> >> In any case, this is how FOP should behave IMO.
> >>
> >
> > I am not so sure here. If this is illegal:
> >
> > <fo:block background-color="red">
> > Some text before the marker
> > <fo:marker marker-class-name="m1">
> > <fo:block font-size=".5em">
> > First marker with small font
> > </fo:block>
> > </fo:marker>
> > </fo:block>
> >
> > then IMO FOP is correct in rejecting the example Andreas provided
> > because with white-space-collapse="false" white-space becomes
> > an ordinary area generating sequence of characters.
>
> I'd think so too. Seemed logical to me. Just funny, because it kept
> me busy for quite some time yesterday. Should've looked at the log
> output much sooner... :)
> In the end, whether the characters are white-space or not, the first
> node in the block is a PCDATA node, so we should reject it. If the
> white-space is collapsed, then the marker becomes the first node/
> initial child, and the constraint is satisfied.
>
>
>
> Cheers,
>
> Andreas
Jeremias Maerki
Re: Funny FYI: markers as initial children...?
Posted by Andreas L Delmelle <a_...@pandora.be>.
On Aug 7, 2006, at 13:23, Manuel Mall wrote:
> On Monday 07 August 2006 18:33, Chris Bowditch wrote:
>> <snip />
>> Surely this rule in the spec means first non-whitespace only node???
>> In any case, this is how FOP should behave IMO.
>>
>
> I am not so sure here. If this is illegal:
>
> <fo:block background-color="red">
> Some text before the marker
> <fo:marker marker-class-name="m1">
> <fo:block font-size=".5em">
> First marker with small font
> </fo:block>
> </fo:marker>
> </fo:block>
>
> then IMO FOP is correct in rejecting the example Andreas provided
> because with white-space-collapse="false" white-space becomes
> an ordinary area generating sequence of characters.
I'd think so too. Seemed logical to me. Just funny, because it kept
me busy for quite some time yesterday. Should've looked at the log
output much sooner... :)
In the end, whether the characters are white-space or not, the first
node in the block is a PCDATA node, so we should reject it. If the
white-space is collapsed, then the marker becomes the first node/
initial child, and the constraint is satisfied.
Cheers,
Andreas
Re: Funny FYI: markers as initial children...?
Posted by Manuel Mall <ma...@apache.org>.
On Monday 07 August 2006 18:33, Chris Bowditch wrote:
> Andreas L Delmelle wrote:
> > I discovered the following in our testcase 'marker_font-size.xml'
> >
> > <fo:block background-color="red" white-space-collapse="false">
> > <fo:marker marker-class-name="m1">
> > <fo:block font-size=".5em">
> > First marker with small font
> > </fo:block>
> > </fo:marker>
> > </fo:block>
> >
> > According to the Rec, a marker must be an initial child of its
> > parent, but the above generates a FOText child node for which
> > willCreateArea() returns true, hence FObj.addMarker() logs an
> > error, so that there is no marker to retrieve, and the checks
> > obviously fail. :)
>
> Surely this rule in the spec means first non-whitespace only node???
> In any case, this is how FOP should behave IMO.
>
I am not so sure here. If this is illegal:
<fo:block background-color="red">
Some text before the marker
<fo:marker marker-class-name="m1">
<fo:block font-size=".5em">
First marker with small font
</fo:block>
</fo:marker>
</fo:block>
then IMO FOP is correct in rejecting the example Andreas provided
because with white-space-collapse="false" white-space becomes
an ordinary area generating sequence of characters.
> Chris
Manuel
Re: Funny FYI: markers as initial children...?
Posted by Chris Bowditch <bo...@hotmail.com>.
Andreas L Delmelle wrote:
>
> I discovered the following in our testcase 'marker_font-size.xml'
>
> <fo:block background-color="red" white-space-collapse="false">
> <fo:marker marker-class-name="m1">
> <fo:block font-size=".5em">
> First marker with small font
> </fo:block>
> </fo:marker>
> </fo:block>
>
> According to the Rec, a marker must be an initial child of its parent,
> but the above generates a FOText child node for which willCreateArea()
> returns true, hence FObj.addMarker() logs an error, so that there is no
> marker to retrieve, and the checks obviously fail. :)
Surely this rule in the spec means first non-whitespace only node??? In
any case, this is how FOP should behave IMO.
Chris