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] DocBook to FOP transformation produces "fo:table is missing child elements." - SOLVED


Oh for crying out loud I figured it out and wanted to pass along the
details for the curious. Very long story short, I'm using Docbook,
xsltproc, and Ruby's hpricot XML parser with the goal of building a
streamlined docbook -> HTML/PDF publishing solution for my own use.

As it turns out, hpricot was "fixing" the table tags, deciding that
the correct order was indeed incorrect, and was actually rearranging
one of the tags ever so subtly. It wasn't until I got so desperate
that I started running diffs on all of the document files at each step
of the process that I noticed this slight change. I prevented the
rearranging from occurring by using hpricot's .XML method.

So the bottom line is this has nothing to do with a Docbook issue.

Bob thanks for all of your input, I really do appreciate it.

Jason



On Thu, Jun 10, 2010 at 9:41 AM, Jason Gilmore <wj@wjgilmore.com> wrote:
> Thanks for all of your help on this, I appreciate it. I've also tried
> without the custom stylesheet, instead pointing the stylesheet
> argument to /usr/share/xml/docbook/stylesheet/nwalsh/fo/docbook.xsl,
> yet the same error message occurs. BTW I am running Ubuntu 9.10, fop
> 1:0.95.dfsg-5, xsltproc 1.1.24-ubuntu2. Further, what's really crazy
> is that if I use the very same conversion command to build another of
> my books on the same machine, the table conversion works perfectly!!
>
> Out of curiosity I did a Docbook -> HTML conversion using the same
> source files, and the following command; the results are equally
> bizarre. First the command I used then the HTML:
>
> xsltproc \
>  --stringparam generate.index 1 \
>  --stringparam generate.toc "book toc" \
>  --stringparam suppress.footer.navigation 0 \
>  --stringparam suppress.navigation 1 \
>  --stringparam header.rule 0 \
>  --stringparam footer.rule 0 \
>  --stringparam chunk.tocs.and.lots 0 \
>  --stringparam navig.showtitles 0 \
>  --stringparam toc.section.depth 0 \
>  --stringparam chunk.section.depth 0 \
>  --stringparam base.dir
> /home/wjgilmore/books/easyphpwebsiteszendframework2e/output/ \
>  /usr/share/xml/docbook/stylesheet/docbook-xsl/html/chunk.xsl \
>  chapters/staging/book.docbook
>
> And here is the HTML:
>
> <div class="table-contents">
> <table summary="Framework Conventions" border="1">
> <colgroup>
> <col><col>
> </colgroup>
> </table>
> <thead>
> <tr><!-- This row intentionally left blank --></tr>
> </thead>
> <tbody>
> <tr><!-- This row intentionally left blank --></tr>
> <tr><!-- This row intentionally left blank --></tr>
> <tr><!-- This row intentionally left blank --></tr>
> <tr><!-- This row intentionally left blank --></tr>
> </tbody>
> </div>
>
> Why in the world is the data missing???
>
> Thanks!
> Jason
>
> On Wed, Jun 9, 2010 at 5:52 PM, Bob Stayton <bobs@sagehill.net> wrote:
>> OK, I don't see anything wrong with the table, then. It works when I process
>> it with the stock stylesheets.
>>
>> I notice that you are using a stylesheet customization layer 'fostyles.xsl'.
>> The next step is to process your document with the stock DocBook
>> fo/docbook.xsl stylesheet instead.  If that works, then something is going
>> on in your customization layer.
>>
>> Bob Stayton
>> Sagehill Enterprises
>> bobs@sagehill.net
>>
>>
>> ----- Original Message ----- From: "Jason Gilmore" <wj@wjgilmore.com>
>> To: <docbook-apps@lists.oasis-open.org>
>> Sent: Wednesday, June 09, 2010 12:50 PM
>> Subject: Re: [docbook-apps] DocBook to FOP transformation produces "fo:table
>> is missing child elements."
>>
>>
>> Agh actually I had included the cols attribute in the tgroup element
>> previously, but out of desperation was trying to build a bare-bones
>> table and had stripped that out. All previous table versions looked
>> exactly like my original version, but did indeed include the cols
>> attribute:
>>
>> <table>
>> <title>Framework Conventions</title>
>> <tgroup cols="2">
>> <colspec colwidth="1*" />
>> <colspec colwidth="2*" />
>> <thead>
>> ...
>>
>> Even so, I get the same error as previous, "fo:table is missing child
>> elements.". What child elements could possibly be missing from this
>> simple example?
>>
>> Thanks again for your input, this is driving me nuts!
>> Jason
>>
>> On Wed, Jun 9, 2010 at 3:43 PM, Bob Stayton <bobs@sagehill.net> wrote:
>>>
>>> Actually, I'm surprised the process got as far is it did. The tgroup
>>> element in your table lacks a required cols attribute. In the stock
>>> template matching on tgroup in fo/table.xsl, it checks for the absence of
>>> that attribute and terminates processing with this message:
>>>
>>> Error: CALS tables must specify the number of columns.
>>>
>>> So I'm surprised you even got a well-formed FO file to feed to FOP. Try
>>> adding the cols attribute and see if that works.
>>>
>>> Bob Stayton
>>> Sagehill Enterprises
>>> bobs@sagehill.net
>>>
>>>
>>> ----- Original Message ----- From: "Jason Gilmore" <wj@wjgilmore.com>
>>> To: <docbook-apps@lists.oasis-open.org>
>>> Sent: Wednesday, June 09, 2010 12:25 PM
>>> Subject: [docbook-apps] DocBook to FOP transformation produces "fo:table
>>> is
>>> missing child elements."
>>>
>>>
>>>> Hi,
>>>>
>>>> I'm using the following command to convert a Docbook book to PDF:
>>>>
>>>> xsltproc -o intermediate-fo-file.fo \
>>>> --stringparam generate.index 1 \
>>>> --stringparam fop1.extensions 1 \
>>>> --stringparam double.sided 1 \
>>>> --stringparam page.height 9in \
>>>> --stringparam page.width 7in \
>>>> --stringparam page.margin.inner .75in \
>>>> --stringparam page.margin.outer .75in \
>>>> --stringparam page.margin.top 1.0in \
>>>> --stringparam page.margin.bottom 1.0in \
>>>> --stringparam header.rule 0 \
>>>> --stringparam footer.rule 0 \
>>>> --stringparam body.start.indent 0pc \
>>>> fostyles.xsl \
>>>> chapters/staging/book.docbook
>>>> fop -d -pdf EZF.pdf -fo intermediate-fo-file.fo
>>>>
>>>> The conversion works perfectly except for when I attempt to insert a
>>>> table into one of the documents. Doing so produces the following error
>>>> message:
>>>>
>>>> SEVERE: Exception
>>>> javax.xml.transform.TransformerException:
>>>> org.apache.fop.fo.ValidationException:
>>>>
>>>>
>>>> file:/home/wjgilmore/books/easyphpwebsiteszendframework2e/intermediate-fo-file.fo:69:984:
>>>> Error(69/984): fo:table is missing child elements.
>>>> Required Content Model:
>>>> (marker*,table-column*,table-header?,table-footer?,table-body+)
>>>> at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:217)
>>>> ...
>>>>
>>>> I'm at a loss because the table isn't anything special:
>>>>
>>>> <table>
>>>> <title>Framework Conventions</title>
>>>> <tgroup>
>>>> <colspec colwidth="1*" />
>>>> <colspec colwidth="2*" />
>>>> <thead>
>>>> <row>
>>>> <entry>Convention</entry>
>>>> <entry>Description</entry>
>>>> </row>
>>>> </thead>
>>>> <tbody>
>>>> <row>
>>>> <entry>Configuration Management</entry>
>>>> <entry>BLAH</entry>
>>>> </row>
>>>> </tbody>
>>>> </tgroup>
>>>> </table>
>>>>
>>>> Any ideas? Thanks much.
>>>>
>>>> Jason
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.org
>>>> For additional commands, e-mail: docbook-apps-help@lists.oasis-open.org
>>>>
>>>>
>>>>
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> 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]