OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: Re: [docbook-apps] fop: anchors generating spaces


I think this is an effect of FOP's handling of white spaces.  In both of your 
examples, you introduce white space at the beginning of the para.  In the first case, 
the white space (line feed and indent spaces) occurs after the <anchor>, and in the 
second case the white space (line feed and indent spaces) occurs before the <anchor> 
tag.  In DocBook's FO output, the anchor becomes an empty <fo:inline/>, and emphasis 
also produces an fo:inline.  So your FO output looks like:

<fo:block><fo:inline/>[linebreak]
    <fo:inline>Definition 1
...

<fo:block>[linebreak]
   <fo:inline/><fo:inline>Definition 2
...


I'm not sure what the XSL-FO spec says about this situation, but other XSL-FO 
processors ignore leading whitespace in an fo:block. I'm pretty sure HTML browsers do 
the same in <p> tags.  It seems FOP does in one case but not the other.  in The first 
case it treats the empty <fo:inline/> as "content" that turns on preservation of white 
space after it.  In the second case, all the white space occurs before the empty 
fo:inline.  You might ask the FOP mailing list about it.

Since <para> is a mixed content element (which means it can contain both text and 
other elements), white space is considered significant in the XML.  The best practice 
is to avoid leading whitespace in para, although that's often hard to do.

Bob Stayton
Sagehill Enterprises
bobs@sagehill.net


----- Original Message ----- 
From: "Mathieu Malaterre" <mathieu.malaterre@gmail.com>
To: "DocBook Apps" <docbook-apps@lists.oasis-open.org>
Sent: Wednesday, June 16, 2010 12:28 AM
Subject: [docbook-apps] fop: anchors generating spaces


> Hi,
>
>  Did anyone notice that <anchor/> generate spaces depending on what
> they are next to, eg.:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
> "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd";>
> <article>
>  <section>
>    <title/>
>    <para><anchor id="a1"/>
>    <emphasis role="bold">Definition:</emphasis> This is def #1</para>
>    <para>
>    <anchor id="a2"/><emphasis role="bold">Definition:</emphasis> This
> is def #2</para>
>  </section>
> </article>
>
> Using fop it generates the attached pdf file.
>
> Comments on whether this is expected, or is this something I should
> report to fop team ?
>
> Thanks,
> -- 
> Mathieu
>


--------------------------------------------------------------------------------


> ---------------------------------------------------------------------
> To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.org
> For additional commands, e-mail: docbook-apps-help@lists.oasis-open.org 



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]