Topics

AntTask: Error Rendering Fo File Error when Generating PDF for Bookmap #DITA-OT #PDF #bookmap


bvigneshwaran21@...
 

Dear All,

  • I have created a plugin by referring to the book (Dita for Print v1.8). I had installed Dita v2.0 Full and Easy Install Version.
  • I did not face any issues in customizing the plugin and generating PDF for normal maps.
  • However, when I try generating output for bookmap, I get an error "AntTask: Error Rendering Fo File, fo:inline is not a valid child of fo:block container." All my attempts to find the cause of the error have been futile.
Infact when I tried generating pdf for bookmap using the default pdf plugin (org.dita.pdf2) the PDF is generated. But only in the case of the customized plugin this issue occurs.
Could anyone please help me understand my mistake. Please help me. I am unable to proceed further with my learning because of this. I have attached two files:
  1. Error message screenshot
  2. Topic.fo file
If any further information is required, please let me know. 


Radu Coravu
 

Hi,

I see that the XSL-FO file contains an fo:inline element inside an fo:block-container element:

<fo:block-container text-align="center">...<fo:inline border-left-width="0pt" border-right-width="0pt">Tasks and what they can do</fo:inline>....</fo:block-container>

It's hard to tell what the problem is without seeing your custom plugin but maybe one of your XSLT customizations which overrides the book title generation outputs that inline element instead of wrapping it in an fo:block element.


Regards,

Radu

Radu Coravu
Oxygen XML Editor
On 1/1/21 14:29, bvigneshwaran21@... wrote:
Dear All,

  • I have created a plugin by referring to the book (Dita for Print v1.8). I had installed Dita v2.0 Full and Easy Install Version.
  • I did not face any issues in customizing the plugin and generating PDF for normal maps.
  • However, when I try generating output for bookmap, I get an error "AntTask: Error Rendering Fo File, fo:inline is not a valid child of fo:block container." All my attempts to find the cause of the error have been futile.
Infact when I tried generating pdf for bookmap using the default pdf plugin (org.dita.pdf2) the PDF is generated. But only in the case of the customized plugin this issue occurs.
Could anyone please help me understand my mistake. Please help me. I am unable to proceed further with my learning because of this. I have attached two files:
  1. Error message screenshot
  2. Topic.fo file
If any further information is required, please let me know. 

  


Nicholas Mucks
 

We had a similar issue in our DITA-OT 2.3.3 PDF customization plugin. It related to the template for minitoc on chapter pages not having a correct parent in some circumstances. 

I’d perform a global search for “fo:inline” or “fo:block-container” in your plugin to make sure they’re all correct. You might not see a syntax error if you’re applying the inline block in a different template than the block container. You probably just need a block element in between them. 

Take care,
- Nick

Sent from mobile

On Jan 1, 2021, at 7:12 AM, Radu Coravu <radu_coravu@...> wrote:



Hi,

I see that the XSL-FO file contains an fo:inline element inside an fo:block-container element:

<fo:block-container text-align="center">...<fo:inline border-left-width="0pt" border-right-width="0pt">Tasks and what they can do</fo:inline>....</fo:block-container>

It's hard to tell what the problem is without seeing your custom plugin but maybe one of your XSLT customizations which overrides the book title generation outputs that inline element instead of wrapping it in an fo:block element.


Regards,

Radu

Radu Coravu
Oxygen XML Editor
On 1/1/21 14:29, bvigneshwaran21@... wrote:
Dear All,

  • I have created a plugin by referring to the book (Dita for Print v1.8). I had installed Dita v2.0 Full and Easy Install Version.
  • I did not face any issues in customizing the plugin and generating PDF for normal maps.
  • However, when I try generating output for bookmap, I get an error "AntTask: Error Rendering Fo File, fo:inline is not a valid child of fo:block container." All my attempts to find the cause of the error have been futile.
Infact when I tried generating pdf for bookmap using the default pdf plugin (org.dita.pdf2) the PDF is generated. But only in the case of the customized plugin this issue occurs.
Could anyone please help me understand my mistake. Please help me. I am unable to proceed further with my learning because of this. I have attached two files:
  1. Error message screenshot
  2. Topic.fo file
If any further information is required, please let me know. 








Toshihiko Makita
 

You are generating fo:inline as the child of fo:block-container in the following portion of topic.fo.

      <fo:block-container text-align="center">
        <fo:block font-size="22pt" font-weight="bold" line-height="140%" space-before="80mm"
          space-before.conditionality="retain" line-height-shift-adjustment="disregard-shifts"
          font-family="Cambria">
          <fo:block>
            <fo:inline border-left-width="0pt" border-right-width="0pt">Retro Tools</fo:inline>
          </fo:block>
          <fo:block>
            <fo:inline border-left-width="0pt" border-right-width="0pt">Product tasks</fo:inline>
          </fo:block>
        </fo:block>
        <fo:inline border-left-width="0pt" border-right-width="0pt">Tasks and what they can
          do</fo:inline>
        <fo:block font-size="11pt" font-weight="bold" line-height="normal" space-before="36pt"
          line-height-shift-adjustment="disregard-shifts"
          font-family="Trebuchet MS, Helvetica, Arial Unicode MS"/>
      </fo:block-container>

The content model of fo:block-container is "(%block)+". You should not fo:inline as the child of fo:block-container.

https://www.w3.org/TR/xsl11/#fo_block-container

If generating fo:block-container is the right coding, change generating fo:inline to generate fo:block instead.

Hope this helps.

Regards,
-- 
/*----------------------------------------------------------------------- 
 Toshihiko Makita
 Development Group. Antenna House, Inc. Ina Branch
 Web site:
 http://www.antenna.co.jp/
 http://www.antennahouse.com/
 ------------------------------------------------------------------------*/ 


 


bvigneshwaran21@...
 

Dear All,

Thank you so much for your expert suggestions. With your help I found the tag causing the problem, which I have posted below. When I deleted this element from the bookmap, the output is generated. However, I am trying to understand why this element is causing an issue in my plugin.
<booktitlealt>Tasks and what they can do</booktitlealt>

The following is an excerpt from topic.fo file generated by org.dita.pdf2 plugin
<fo:block-container text-align="center"><fo:block font-size="22pt" font-weight="bold" line-height="140%" space-before="80mm" space-before.conditionality="retain" line-height-shift-adjustment="disregard-shifts" font-family="Helvetica, Arial Unicode MS">
<fo:block><fo:inline border-left-width="0pt" border-right-width="0pt">Retro Tools</fo:inline></fo:block>
<fo:block><fo:inline border-left-width="0pt" border-right-width="0pt">Product tasks</fo:inline></fo:block></fo:block>
<fo:block font-size="18pt" font-weight="bold" line-height="140%" line-height-shift-adjustment="disregard-shifts" font-family="Helvetica, Arial Unicode MS">Tasks and what they can do</fo:block>
<fo:block font-size="11pt" font-weight="bold" line-height="normal" space-before="36pt" line-height-shift-adjustment="disregard-shifts" font-family="Helvetica, Arial Unicode MS"/></fo:block-container>

The following is an excerpt of topic.fo file generated by my plugin:
<fo:block-container text-align="center"><fo:block font-size="22pt" font-weight="bold" line-height="140%" space-before="80mm" space-before.conditionality="retain" line-height-shift-adjustment="disregard-shifts" font-family="Cambria">
<fo:block><fo:inline border-left-width="0pt" border-right-width="0pt">Retro Tools</fo:inline></fo:block>
<fo:block><fo:inline border-left-width="0pt" border-right-width="0pt">Product tasks</fo:inline></fo:block></fo:block>
<fo:inline border-left-width="0pt" border-right-width="0pt">Tasks and what they can do</fo:inline>
<fo:block font-size="11pt" font-weight="bold" line-height="normal" space-before="36pt" line-height-shift-adjustment="disregard-shifts" font-family="Trebuchet MS, Helvetica, Arial Unicode MS"/></fo:block-container>

When i compare both, I see that the <fo:block> element is not wrapped around the text in my plugin.
Now my question is how do I debug (where to see) and troubleshoot this issue. I tried looking in to front-matter.attr.xsl and front-matter.xsl. But I am unable to find the cause. Could you please suggest as to where I need to look and what i need to look for. There are certain xsl files attached for your kind reference. Your suggestions are much appreciated and will aid me in my learning.

Thank you.


Leigh White
 

Without seeing the whole plugin, it's difficult to say exactly where to look. You say that you're following the instructions in DITA For Print 1.8 (thank you, by the way) but you seem to be using the 2.0 version of the DITA OT. This could be one issue. There are significant differences between the 1.8 version of the org.dita.pdf2 plugin and the 2.x version, so be careful there.

Both the 1.8.5 and 2.5.4 versions of the PDF plugin transform booktitle alt into an fo:block by default (in front-matter.xsl):

<xsl:template match="*[contains(@class, ' bookmap/booktitlealt ')]" priority="2">
    <fo:block xsl:use-attribute-sets="__frontmatter__subtitle">
        <xsl:apply-templates/>
    </fo:block>
</xsl:template>

It looks like you changed that fo:block to fo:inline, perhaps to keep it inline with the main title? If so, you'll need to go about it another way. You can change this template to fo:inline, but then you'll need to apply that template within the mainbooktitle fo:block (assuming that's what you're doing) so that the booktitlealt becomes part of the mainbooktitle block.

For troubleshooting, when you just don't have a clue, there is always the sledgehammer method, where you comment out everything you think *could* be the problem and uncomment each thing one by one until the problem reoccurs. Be careful doing this because sometimes you can't comment out just one thing because other things depend on it, so you might have to comment out a group of things together. But in your case, I would bet the problem is in front-matter.xsl.

Good luck,
Leigh


bvigneshwaran21@...
 

Dear Leigh,
Thank you so much for taking time to analyze my results and providing your valuable insights. I shall try as per your suggestion.