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 Travis Staloch <tw...@yahoo.com> on 2008/01/14 05:48:09 UTC

TransformerException: fo:page-sequence is not a valid child element of fo:flow

Hello,

I'm trying to use fop along with xsltproc to create a pdf from docbook xml.  xsltproc successfully creates an fo document with the command:
xsltproc /usr/share/sgml/docbook/xsl-stylesheets-1.73.2-2.fc8/fo/docbook.xsl my.book > sf.fo

However, when I run the fop command:
fop sf.fo -pdf sf.pdf
I get the error:
SEVERE: Exception
javax.xml.transform.TransformerException: org.apache.fop.fo.ValidationException: file:///home/trav/open/SportsFeed/doc/help/docbook/sf.fo:1:56740: Error(1/56740): fo:page-sequence is not a valid child element of fo:flow.
        at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:168)
        at
 org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:115)
        at org.apache.fop.cli.Main.startFOP(Main.java:166)
        at org.apache.fop.cli.Main.main(Main.java:197)

Can anyone provide any guidance on what might be going wrong?  I have fop 0.94 with java version "1.4.2_16".  I've attached the fo document.  When I looked at the fo document, I couldn't find any fo:page-sequence elements which were children of fo:flow.  So I'm not really sure what the problem is.

Thanks for any advice,

Travis






      ____________________________________________________________________________________
Never miss a thing.  Make Yahoo your home page. 
http://www.yahoo.com/r/hs

Re: language specification for PDF document

Posted by Andreas L Delmelle <a_...@pandora.be>.
On Jan 15, 2008, at 21:29, Li, Hao wrote:

Hi

> Is this document level "language identifier" part of XSL-FO  
> standard and
> its usage is "<fo:root language="en">" like Chris suggested? Or can it
> be xml:lang attribute?

The xml:lang 'attribute' in XSL-FO is classified as a shorthand  
(http://www.w3.org/TR/xsl11/#xml.lang), and as such, in theory it  
could be used to set the native XSL-FO 'language' property (but at  
the same time also 'country' and 'script', if applicable).

In practice, this shorthand is not-yet-implemented in FOP (http:// 
xmlgraphics.apache.org/fop/compliance.html#fo-property-xml:lang).
Even if it would be, it would still suffer the same limitations as  
the 'language' property.


Cheers

Andreas

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


RE: language specification for PDF document

Posted by "Li, Hao" <li...@peacetech.com>.
Hi Jeremias,

Is this document level "language identifier" part of XSL-FO standard and
its usage is "<fo:root language="en">" like Chris suggested? Or can it
be xml:lang attribute?

Thanks a lot.

Henry

-----Original Message-----
From: Jeremias Maerki [mailto:dev@jeremias-maerki.ch] 
Sent: Tuesday, January 15, 2008 2:54 PM
To: fop-users@xmlgraphics.apache.org
Subject: Re: language specification for PDF document

The "language identifier" (for the natural language of the document) is
part of the chapter about "Logical Structure" in the PDF specification.
That is something FOP doesn't support, yet.

On 15.01.2008 20:37:54 Li, Hao wrote:
> Thanks Chris.
> 
> I followed your instruction to generate the pdf. After I open it in
> acrobat, under file->document properties->advanced->reading options,
the
> language option is still blank. Am I missing something?
> 
> Please help. Thank you very much.
> 
> -----Original Message-----
> From: Chris Bowditch [mailto:bowditch_chris@hotmail.com] 
> Sent: Tuesday, January 15, 2008 12:58 PM
> To: fop-users@xmlgraphics.apache.org
> Subject: Re: language specification for PDF document
> 
> Li, Hao wrote:
> 
> > Hi All,
> > 
> > Our goal is: Create a PDF document via FOP with the language set to
> > English (en) at the document level.
> > 
> > Is there a way in Apache FOP to achieve this goal? Does the common
> > hyphenation property "language" applicable?
> 
> Yes you can specify language property on fo:root element, e.g.
> 
> <fo:root language="en">
> <fo:layout-master-set>
> ...
> <fo:page-sequence master-reference="a4">
> ...
> </fo:root>
> 
> Chris


Jeremias Maerki


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


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


Re: language specification for PDF document

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
The "language identifier" (for the natural language of the document) is
part of the chapter about "Logical Structure" in the PDF specification.
That is something FOP doesn't support, yet.

On 15.01.2008 20:37:54 Li, Hao wrote:
> Thanks Chris.
> 
> I followed your instruction to generate the pdf. After I open it in
> acrobat, under file->document properties->advanced->reading options, the
> language option is still blank. Am I missing something?
> 
> Please help. Thank you very much.
> 
> -----Original Message-----
> From: Chris Bowditch [mailto:bowditch_chris@hotmail.com] 
> Sent: Tuesday, January 15, 2008 12:58 PM
> To: fop-users@xmlgraphics.apache.org
> Subject: Re: language specification for PDF document
> 
> Li, Hao wrote:
> 
> > Hi All,
> > 
> > Our goal is: Create a PDF document via FOP with the language set to
> > English (en) at the document level.
> > 
> > Is there a way in Apache FOP to achieve this goal? Does the common
> > hyphenation property "language" applicable?
> 
> Yes you can specify language property on fo:root element, e.g.
> 
> <fo:root language="en">
> <fo:layout-master-set>
> ...
> <fo:page-sequence master-reference="a4">
> ...
> </fo:root>
> 
> Chris


Jeremias Maerki


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


Re: language specification for PDF document

Posted by Chris Bowditch <bo...@hotmail.com>.
Li, Hao wrote:

> Hi All,
> 
> Our goal is: Create a PDF document via FOP with the language set to
> English (en) at the document level.
> 
> Is there a way in Apache FOP to achieve this goal? Does the common
> hyphenation property "language" applicable?

Yes you can specify language property on fo:root element, e.g.

<fo:root language="en">
<fo:layout-master-set>
...
<fo:page-sequence master-reference="a4">
...
</fo:root>

Chris



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


Re: language specification for PDF document

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
We had a short off-list exchange and it turned out that just supporting
the natural language in the PDF isn't enough as Henry needs the PDFs to
pass Acrobat's accessibility check which means that PDF's "Document
Structure" feature needs to be supported. And that would be a larger
change, potentially even impacting FOP's architecture at some points.

On 16.01.2008 20:43:08 Li, Hao wrote:
> Andreas and Jeremias,
> 
> RenderX supports this feature by specifying xml:lang in the <fo:root>
> tag:
> <fo:root xml:lang="en">
> 
> We are eager to know if it can be done in FOP in a short time. We are
> willing to pay a reasonable amount for the implementation.   
> 
> Thank you very much,
> 
> Henry
> 
> -----Original Message-----
> From: Andreas L Delmelle [mailto:a_l.delmelle@pandora.be] 
> Sent: Tuesday, January 15, 2008 5:47 PM
> To: fop-users@xmlgraphics.apache.org
> Subject: Re: language specification for PDF document
> 
> On Jan 15, 2008, at 23:36, Li, Hao wrote:
> 
> Hi Henry
> 
> > Does it mean that the implementation will be Apache FOP specific,
> > because there is no such XSL-FO standard property for document level
> > language of PDF?
> 
> Basically: yes. There is no connection/obligation of a FO processor  
> to any particular output format, like PDF or PostScript.
> Also, it is currently unimplemented at the moment, so should someone  
> decide to have a shot at implementing it, and he does not know what  
> AntennaHouse or RenderX do with the related properties (language/ 
> country/script), then it is very likely that an eventual  
> implementation will be specific to Apache FOP.
> 
> 
> Cheers
> 
> Andreas



Jeremias Maerki


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


RE: language specification for PDF document

Posted by "Li, Hao" <li...@peacetech.com>.
Andreas and Jeremias,

RenderX supports this feature by specifying xml:lang in the <fo:root>
tag:
<fo:root xml:lang="en">

We are eager to know if it can be done in FOP in a short time. We are
willing to pay a reasonable amount for the implementation.   

Thank you very much,

Henry

-----Original Message-----
From: Andreas L Delmelle [mailto:a_l.delmelle@pandora.be] 
Sent: Tuesday, January 15, 2008 5:47 PM
To: fop-users@xmlgraphics.apache.org
Subject: Re: language specification for PDF document

On Jan 15, 2008, at 23:36, Li, Hao wrote:

Hi Henry

> Does it mean that the implementation will be Apache FOP specific,
> because there is no such XSL-FO standard property for document level
> language of PDF?

Basically: yes. There is no connection/obligation of a FO processor  
to any particular output format, like PDF or PostScript.
Also, it is currently unimplemented at the moment, so should someone  
decide to have a shot at implementing it, and he does not know what  
AntennaHouse or RenderX do with the related properties (language/ 
country/script), then it is very likely that an eventual  
implementation will be specific to Apache FOP.


Cheers

Andreas

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


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


Re: language specification for PDF document

Posted by Andreas L Delmelle <a_...@pandora.be>.
On Jan 15, 2008, at 23:36, Li, Hao wrote:

Hi Henry

> Does it mean that the implementation will be Apache FOP specific,
> because there is no such XSL-FO standard property for document level
> language of PDF?

Basically: yes. There is no connection/obligation of a FO processor  
to any particular output format, like PDF or PostScript.
Also, it is currently unimplemented at the moment, so should someone  
decide to have a shot at implementing it, and he does not know what  
AntennaHouse or RenderX do with the related properties (language/ 
country/script), then it is very likely that an eventual  
implementation will be specific to Apache FOP.


Cheers

Andreas

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


RE: language specification for PDF document

Posted by "Li, Hao" <li...@peacetech.com>.
Thanks Andreas.

Does it mean that the implementation will be Apache FOP specific,
because there is no such XSL-FO standard property for document level
language of PDF?

Thank you very much,

Henry

-----Original Message-----
From: Andreas L Delmelle [mailto:a_l.delmelle@pandora.be] 
Sent: Tuesday, January 15, 2008 2:47 PM
To: fop-users@xmlgraphics.apache.org
Subject: Re: language specification for PDF document

On Jan 15, 2008, at 20:37, Li, Hao wrote:

Hi

> I followed your instruction to generate the pdf. After I open it in
> acrobat, under file->document properties->advanced->reading  
> options, the
> language option is still blank. Am I missing something?

As far as I know, the 'language' property is used by FOP *only* for  
determining the hyphenation pattern file to use (if hyphenation is  
enabled).
I don't think that the property is used for anything else (and so,  
will not yet be reflected in the document properties)

It's probably not too difficult to implement (given enough time and  
enough knowledge about the PDF Specification). Patches are always  
welcome.


Cheers

Andreas

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


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


Re: language specification for PDF document

Posted by Andreas L Delmelle <a_...@pandora.be>.
On Jan 15, 2008, at 20:37, Li, Hao wrote:

Hi

> I followed your instruction to generate the pdf. After I open it in
> acrobat, under file->document properties->advanced->reading  
> options, the
> language option is still blank. Am I missing something?

As far as I know, the 'language' property is used by FOP *only* for  
determining the hyphenation pattern file to use (if hyphenation is  
enabled).
I don't think that the property is used for anything else (and so,  
will not yet be reflected in the document properties)

It's probably not too difficult to implement (given enough time and  
enough knowledge about the PDF Specification). Patches are always  
welcome.


Cheers

Andreas

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


RE: language specification for PDF document

Posted by "Li, Hao" <li...@peacetech.com>.
Thanks Chris.

I followed your instruction to generate the pdf. After I open it in
acrobat, under file->document properties->advanced->reading options, the
language option is still blank. Am I missing something?

Please help. Thank you very much.

-----Original Message-----
From: Chris Bowditch [mailto:bowditch_chris@hotmail.com] 
Sent: Tuesday, January 15, 2008 12:58 PM
To: fop-users@xmlgraphics.apache.org
Subject: Re: language specification for PDF document

Li, Hao wrote:

> Hi All,
> 
> Our goal is: Create a PDF document via FOP with the language set to
> English (en) at the document level.
> 
> Is there a way in Apache FOP to achieve this goal? Does the common
> hyphenation property "language" applicable?

Yes you can specify language property on fo:root element, e.g.

<fo:root language="en">
<fo:layout-master-set>
...
<fo:page-sequence master-reference="a4">
...
</fo:root>

Chris



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


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


language specification for PDF document

Posted by "Li, Hao" <li...@peacetech.com>.
Hi All,

Our goal is: Create a PDF document via FOP with the language set to
English (en) at the document level.

Is there a way in Apache FOP to achieve this goal? Does the common
hyphenation property "language" applicable?


Your help is greatly appreciated,


Henry 


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


Re: TransformerException: fo:page-sequence is not a valid child element of fo:flow

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
Why not? The error message tells you exactly what is wrong and where.
It's a ValidationException which means your XML/XSL-FO isn't valid. The
error message says:
"fo:page-sequence is not a valid child element of fo:flow."
(on line 1, position 56740)

That means there's an fo:page-sequence element as a child of an fo:flow
element and that is illegal. And now you need to find out why and
correct the XSLT. Given that I see the term "docbook" in the filename it
could also be that your DocBook XML is invalid in the first place and
you get a bad result because of that. But maybe there's a bug in the
DocBook XSLTs which is less likely. I suggest validating your XMLs (i.e.
"my.book") first.

On 14.01.2008 05:48:09 Travis Staloch wrote:
> Hello,
> 
> I'm trying to use fop along with xsltproc to create a pdf from docbook xml.  xsltproc successfully creates an fo document with the command:
> xsltproc /usr/share/sgml/docbook/xsl-stylesheets-1.73.2-2.fc8/fo/docbook.xsl my.book > sf.fo
> 
> However, when I run the fop command:
> fop sf.fo -pdf sf.pdf
> I get the error:
> SEVERE: Exception
> javax.xml.transform.TransformerException: org.apache.fop.fo.ValidationException: file:///home/trav/open/SportsFeed/doc/help/docbook/sf.fo:1:56740: Error(1/56740): fo:page-sequence is not a valid child element of fo:flow.
>         at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:168)
>         at
>  org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:115)
>         at org.apache.fop.cli.Main.startFOP(Main.java:166)
>         at org.apache.fop.cli.Main.main(Main.java:197)
> 
> Can anyone provide any guidance on what might be going wrong?  I have fop 0.94 with java version "1.4.2_16".  I've attached the fo document.  When I looked at the fo document, I couldn't find any fo:page-sequence elements which were children of fo:flow.  So I'm not really sure what the problem is.
> 
> Thanks for any advice,
> 
> Travis


Jeremias Maerki


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


Re: TransformerException: fo:page-sequence is not a valid child element of fo:flow

Posted by Andreas L Delmelle <a_...@pandora.be>.
On Jan 14, 2008, at 18:18, Andreas L Delmelle wrote:

> On Jan 14, 2008, at 05:48, Travis Staloch wrote:
>
> Hi
>
>> I'm trying to use fop along with xsltproc to create a pdf from  
>> docbook xml.  xsltproc successfully creates an fo document with  
>> the command:
>> xsltproc /usr/share/sgml/docbook/xsl-stylesheets-1.73.2-2.fc8/fo/ 
>> docbook.xsl my.book > sf.fo
>>
>> However, when I run the fop command:
>> fop sf.fo -pdf sf.pdf
>> I get the error:
>> SEVERE: Exception
>> javax.xml.transform.TransformerException:  
>> org.apache.fop.fo.ValidationException: file:///home/trav/open/ 
>> SportsFeed/doc/help/docbook/sf.fo:1:56740: Error(1/56740): fo:page- 
>> sequence is not a valid child element of fo:flow.
>>         at org.apache.fop.cli.InputHandler.transformTo 
>> (InputHandler.java:168)
>>         at org.apache.fop.cli.InputHandler.renderTo 
>> (InputHandler.java:115)
>>         at org.apache.fop.cli.Main.startFOP(Main.java:166)
>>         at org.apache.fop.cli.Main.main(Main.java:197)
>>
>> Can anyone provide any guidance on what might be going wrong?
>> I have fop 0.94 with java version "1.4.2_16".  I've attached the  
>> fo document.
>> When I looked at the fo document, I couldn't find any fo:page- 
>> sequence elements which were children of fo:flow.  So I'm not  
>> really sure what the problem is.
>
> What it says: you do have a fo:page-sequence that is a child of an  
> fo:flow.
>
> I checked this via XPath, and you have 4 page-sequences. 3 of which  
> are correct -> children of the fo:root, and 1 that ended up in the  
> wrong place.
>
> No idea if it will help you much in tracking it down, but if I  
> apply indenting to make your FO a bit more human-readable, the  
> offending fo:page-sequence starts on line 1066.

Update: in the file you sent, the offending fo:page-sequence can be  
found at line 1, column 57323.

Cheers

Andreas

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


Re: TransformerException: fo:page-sequence is not a valid child element of fo:flow

Posted by Andreas L Delmelle <a_...@pandora.be>.
On Jan 14, 2008, at 05:48, Travis Staloch wrote:

Hi

> I'm trying to use fop along with xsltproc to create a pdf from  
> docbook xml.  xsltproc successfully creates an fo document with the  
> command:
> xsltproc /usr/share/sgml/docbook/xsl-stylesheets-1.73.2-2.fc8/fo/ 
> docbook.xsl my.book > sf.fo
>
> However, when I run the fop command:
> fop sf.fo -pdf sf.pdf
> I get the error:
> SEVERE: Exception
> javax.xml.transform.TransformerException:  
> org.apache.fop.fo.ValidationException: file:///home/trav/open/ 
> SportsFeed/doc/help/docbook/sf.fo:1:56740: Error(1/56740): fo:page- 
> sequence is not a valid child element of fo:flow.
>         at org.apache.fop.cli.InputHandler.transformTo 
> (InputHandler.java:168)
>         at org.apache.fop.cli.InputHandler.renderTo 
> (InputHandler.java:115)
>         at org.apache.fop.cli.Main.startFOP(Main.java:166)
>         at org.apache.fop.cli.Main.main(Main.java:197)
>
> Can anyone provide any guidance on what might be going wrong?
> I have fop 0.94 with java version "1.4.2_16".  I've attached the fo  
> document.
> When I looked at the fo document, I couldn't find any fo:page- 
> sequence elements which were children of fo:flow.  So I'm not  
> really sure what the problem is.

What it says: you do have a fo:page-sequence that is a child of an  
fo:flow.

I checked this via XPath, and you have 4 page-sequences. 3 of which  
are correct -> children of the fo:root, and 1 that ended up in the  
wrong place.

No idea if it will help you much in tracking it down, but if I apply  
indenting to make your FO a bit more human-readable, the offending  
fo:page-sequence starts on line 1066.



Cheers

Andreas

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