Couldn't find hyphenation pattern error

John_Tait
Posts: 22
Joined: Tue Jan 22, 2013 11:55 am

Couldn't find hyphenation pattern error

Post by John_Tait »

Hi

I'm encountering a build error while building a DocBook PDF. HTML build works fine. I can't figure this one out at all - please help.

It's a DocBook5 set constructed with XIncludes.

Error log below.

Thanks, John

Code: Select all

The process 'Apache FOP' ended with code: 1.
The error was:
ERROR - Couldn't find hyphenation pattern for lang="en".
ERROR - Exception
org.apache.fop.apps.FOPException: org.apache.fop.fo.ValidationException: "fo:inline" is not a valid child of "fo:flow"! (See position 7:-1)
net.sf.saxon.trans.XPathException: org.apache.fop.fo.ValidationException: "fo:inline" is not a valid child of "fo:flow"! (See position 7:-1)
at org.apache.fop.cli.InputHandlerFOP.transformTo(Unknown Source)
at org.apache.fop.cli.InputHandlerFOP.renderTo(Unknown Source)
at org.apache.fop.cli.Main.startFOP(Main.java:177)
at org.apache.fop.cli.Main.main(Main.java:208)
Caused by: net.sf.saxon.trans.XPathException: org.apache.fop.fo.ValidationException: "fo:inline" is not a valid child of "fo:flow"! (See position 7:-1)
at net.sf.saxon.event.ContentHandlerProxy.handleSAXException(Unknown Source)
at net.sf.saxon.event.ContentHandlerProxy.startContent(Unknown Source)
at net.sf.saxon.event.NamespaceReducer.startContent(NamespaceReducer.java:199)
at net.sf.saxon.event.ReceivingContentHandler.startElement(ReceivingContentHandler.java:351)
at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
at org.apache.xerces.xinclude.XIncludeHandler.startElement(Unknown Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
at net.sf.saxon.event.Sender.sendSAXSource(Sender.java:396)
at net.sf.saxon.event.Sender.send(Sender.java:143)
at net.sf.saxon.IdentityTransformer.transform(IdentityTransformer.java:46)
... 4 more
Caused by: org.apache.fop.fo.ValidationException: "fo:inline" is not a valid child of "fo:flow"! (See position 7:-1)
at org.apache.fop.events.ValidationExceptionFactory.createException(ValidationExceptionFactory.java:38)
at org.apache.fop.events.EventExceptionManager.throwException(EventExceptionManager.java:58)
at org.apache.fop.events.DefaultEventBroadcaster$1.invoke(DefaultEventBroadcaster.java:175)
at com.sun.proxy.$Proxy3.invalidChild(Unknown Source)
at org.apache.fop.fo.FONode.invalidChildError(FONode.java:561)
at org.apache.fop.fo.FONode.invalidChildError(FONode.java:537)
at org.apache.fop.fo.pagination.Flow.validateChildNode(Flow.java:107)
at org.apache.fop.fo.FOTreeBuilder$MainFOHandler.startElement(FOTreeBuilder.java:265)
at org.apache.fop.fo.FOTreeBuilder.startElement(FOTreeBuilder.java:175)
... 20 more

---------

net.sf.saxon.trans.XPathException: org.apache.fop.fo.ValidationException: "fo:inline" is not a valid child of "fo:flow"! (See position 7:-1)
at net.sf.saxon.event.ContentHandlerProxy.handleSAXException(Unknown Source)
at net.sf.saxon.event.ContentHandlerProxy.startContent(Unknown Source)
at net.sf.saxon.event.NamespaceReducer.startContent(NamespaceReducer.java:199)
at net.sf.saxon.event.ReceivingContentHandler.startElement(ReceivingContentHandler.java:351)
at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
at org.apache.xerces.xinclude.XIncludeHandler.startElement(Unknown Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
at net.sf.saxon.event.Sender.sendSAXSource(Sender.java:396)
at net.sf.saxon.event.Sender.send(Sender.java:143)
at net.sf.saxon.IdentityTransformer.transform(IdentityTransformer.java:46)
at org.apache.fop.cli.InputHandlerFOP.transformTo(Unknown Source)
at org.apache.fop.cli.InputHandlerFOP.renderTo(Unknown Source)
at org.apache.fop.cli.Main.startFOP(Main.java:177)
at org.apache.fop.cli.Main.main(Main.java:208)
Caused by: org.apache.fop.fo.ValidationException: "fo:inline" is not a valid child of "fo:flow"! (See position 7:-1)
at org.apache.fop.events.ValidationExceptionFactory.createException(ValidationExceptionFactory.java:38)
at org.apache.fop.events.EventExceptionManager.throwException(EventExceptionManager.java:58)
at org.apache.fop.events.DefaultEventBroadcaster$1.invoke(DefaultEventBroadcaster.java:175)
at com.sun.proxy.$Proxy3.invalidChild(Unknown Source)
at org.apache.fop.fo.FONode.invalidChildError(FONode.java:561)
at org.apache.fop.fo.FONode.invalidChildError(FONode.java:537)
at org.apache.fop.fo.pagination.Flow.validateChildNode(Flow.java:107)
at org.apache.fop.fo.FOTreeBuilder$MainFOHandler.startElement(FOTreeBuilder.java:265)
at org.apache.fop.fo.FOTreeBuilder.startElement(FOTreeBuilder.java:175)
... 20 more
---------
org.apache.fop.fo.ValidationException: "fo:inline" is not a valid child of "fo:flow"! (See position 7:-1)
at org.apache.fop.events.ValidationExceptionFactory.createException(ValidationExceptionFactory.java:38)
at org.apache.fop.events.EventExceptionManager.throwException(EventExceptionManager.java:58)
at org.apache.fop.events.DefaultEventBroadcaster$1.invoke(DefaultEventBroadcaster.java:175)
at com.sun.proxy.$Proxy3.invalidChild(Unknown Source)
at org.apache.fop.fo.FONode.invalidChildError(FONode.java:561)
at org.apache.fop.fo.FONode.invalidChildError(FONode.java:537)
at org.apache.fop.fo.pagination.Flow.validateChildNode(Flow.java:107)
at org.apache.fop.fo.FOTreeBuilder$MainFOHandler.startElement(FOTreeBuilder.java:265)
at org.apache.fop.fo.FOTreeBuilder.startElement(FOTreeBuilder.java:175)
at net.sf.saxon.event.ContentHandlerProxy.startContent(Unknown Source)
at net.sf.saxon.event.NamespaceReducer.startContent(NamespaceReducer.java:199)
at net.sf.saxon.event.ReceivingContentHandler.startElement(ReceivingContentHandler.java:351)
at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
at org.apache.xerces.xinclude.XIncludeHandler.startElement(Unknown Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
at net.sf.saxon.event.Sender.sendSAXSource(Sender.java:396)
at net.sf.saxon.event.Sender.send(Sender.java:143)
at net.sf.saxon.IdentityTransformer.transform(IdentityTransformer.java:46)
at org.apache.fop.cli.InputHandlerFOP.transformTo(Unknown Source)
at org.apache.fop.cli.InputHandlerFOP.renderTo(Unknown Source)
at org.apache.fop.cli.Main.startFOP(Main.java:177)
at org.apache.fop.cli.Main.main(Main.java:208)
Severity
Error
System ID
C:\[redacted]\DocBook_manuals\set.xml_xslt
Scenario
DocBook PDF
Document type
DocBook 5
XML file
C:\[redacted]\DocBook_manuals\set.xml
XSL file
C:\[redacted]\Oxygen XML Author 15_1\frameworks\docbook\xsl\fo\docbook_custom.xsl
Engine name
Apache FOP
Start location
line: 7, column: 0
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Re: Couldn't find hyphenation pattern error

Post by sorin_ristache »

Hi,

"fo:inline" is not a valid child of "fo:flow" signals an invalid FO document created by the Docbook XSL stylesheets. It seems you hit a bug in these stylesheets, because an invalid FO document is created by the Docbook XSL stylesheets from a valid Docbook XML document (I assume you work with a valid Docbook XML document). Can you post here or send us a sample Docbook XML document for reproducing the error, and maybe for reporting it to the Docbook XSL project, where it might be fixed faster than just remaining known to us.


Thank you,
Sorin
John_Tait
Posts: 22
Joined: Tue Jan 22, 2013 11:55 am

Re: Couldn't find hyphenation pattern error

Post by John_Tait »

I've been commenting out much of the document. I think (one of) the issues is that the index term in the title seems to clause a build error. I can build it when I remove the <indexterm> element. Strange.

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<?xml-model href="http://docbook.org/xml/5.0/rng/docbookxi.rng" schematypens="http://relaxng.org/ns/structure/1.0"?>
<?xml-model href="http://docbook.org/xml/5.0/rng/docbook.rng" type="application/xml" schematypens="http://purl.oclc.org/dsdl/schematron"?>
<book xmlns="http://docbook.org/ns/docbook"
xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:xlink="http://www.w3.org/1999/xlink" version="5.0">
<info>
<title>SMS: Signalling Maintenance Specifications</title>

<!-- <title>SMS: Signalling Maintenance Specifications<indexterm>
<primary>SMS</primary>
</indexterm></title>-->
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Re: Couldn't find hyphenation pattern error

Post by sorin_ristache »

Yes, if removing the indexterm from the title fixes the error and this is the only modification in the XML document that is necessary for fixing the error, then definitely the stylesheets can't handle that (the indexterm tag in the title). If the XML document is valid then this is a bug in the XSL stylesheets and we can report it to the DocBook XSL project.

Of course a workaround for you would be to just omit the indexterm from the title.


Regards,
Sorin
John_Tait
Posts: 22
Joined: Tue Jan 22, 2013 11:55 am

Re: Couldn't find hyphenation pattern error

Post by John_Tait »

I've managed to reproduce the error. Not all of these might cause the error, but I can't unpick it easily because my cross-referencing goes across the individual files.

Anyeay if I have a set (DocBook5 document), and books are included in the set with XInclude, and the title of the books contain an indexterm element, then the build fails. Reproduced by adding/removing indexterms to various books in the set.
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Re: Couldn't find hyphenation pattern error

Post by sorin_ristache »

Hi,

Until the bug is fixed I suggest as a workaround to add the indexterm at the beginning of the section body instead of the title. The link in the Index section of the output will still point to the same section of your document, so you still have the link in the Index section.


Regards,
Sorin
Post Reply