Can't create PDF from book chunk with includes
Here should go questions about transforming XML with XSLT and FOP.
-
- Posts: 37
- Joined: Wed Dec 23, 2009 6:13 am
Can't create PDF from book chunk with includes
I have a Docbook 5 'book' chunk with includes to frontmatter and chapters, and can't generate a PDF of the whole book. I have been able to generate PDFs of each individual chapter with no problems. When I try to transform the 'book' using RenderX I get six errors (one for each chunk?) in the command line window: "Element include in namespace 'http://www.w3.org/2001/XInclude' encountered in book, but no template matches". I'm using Oxygen 11.1 and RenderX 4.17, and have a custom stylesheet as below.
The RenderX event log is:
My book chunk is:
The custom stylesheet calls the DocBook stylesheet supplied with Oxygen:
Thanks in advance for any help.
Dave
The RenderX event log is:
Code: Select all
(document [system-id file:/C:/XML_datafiles/abacc_book.xml]
(validate
[error] Element 'fo:block' cannot be a child of 'fo:root'.
[error] Element 'fo:block' cannot be a child of 'fo:root'.
[error] Element 'fo:block' cannot be a child of 'fo:root'.
[error] Element 'fo:block' cannot be a child of 'fo:root'.
[error] Element 'fo:block' cannot be a child of 'fo:root'.
[error] Element 'fo:block' cannot be a child of 'fo:root'.
[error] Attribute 'color' cannot occur at element 'fo:block'.
[error] Attribute 'color' cannot occur at element 'fo:block'.
[error] Attribute 'color' cannot occur at element 'fo:block'.
[error] Attribute 'color' cannot occur at element 'fo:block'.
[error] Attribute 'color' cannot occur at element 'fo:block'.
[error] Attribute 'color' cannot occur at element 'fo:block'.
[validation total: 12 errors]
[error] com.renderx.xep.lib.FormatterException: Invalid XSL FO source 'file:/C:/XML_datafiles/abacc_book.xml': 12 errors found during validation
[error] javax.xml.transform.TransformerException: com.renderx.xep.lib.FormatterException: Invalid XSL FO source 'file:/C:/XML_datafiles/abacc_book.xml': 12 errors found during validation
[error] formatting failed
[error] javax.xml.transform.TransformerException: com.renderx.xep.lib.FormatterException: Invalid XSL FO source 'file:/C:/XML_datafiles/abacc_book.xml': 12 errors found during validation
Formatting failed.
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<?oxygen RNGSchema="http://www.oasis-open.org/docbook/xml/5.0/rng/docbookxi.rng" type="xml"?>
<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">
<xi:include href="halftitle.xml" />
<xi:include href="imprint.xml" />
<xi:include href="preface.xml" />
<xi:include href="abacc_chap1.xml" />
<xi:include href="abacc_chap2.xml" />
<xi:include href="abacc_chap3.xml" />
</book>
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema" version="1.0"
xmlns:fo="http://www.w3.org/1999/XSL/Format">
<xsl:import
href="file:///c:/Program Files/Oxygen XML Editor 11/frameworks/docbook/xsl/fo/docbook.xsl" />
<xsl:template match="processing-instruction('lnbr')">
<fo:block />
</xsl:template>
<xsl:template match="processing-instruction('pgbr')">
<fo:block break-after="page" />
</xsl:template>
</xsl:stylesheet>
Dave
-
- Posts: 37
- Joined: Wed Dec 23, 2009 6:13 am
Re: Can't create PDF from book chunk with includes
I have found my answer after a bit of searching through other posts. I added to my customised stylesheet a template match, <xsl:template match="xi:include">:
This now brings in all the include files when creating the PDF.
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema" version="1.0"
xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:xi="http://www.w3.org/2001/XInclude">
<xsl:import
href="file:///c:/Program Files/Oxygen XML Editor 11/frameworks/docbook/xsl/fo/docbook.xsl" />
<xsl:template match="xi:include">
<xsl:apply-templates select="document(@href)/*" />
</xsl:template>
<xsl:template match="processing-instruction('lnbr')">
<fo:block />
</xsl:template>
<xsl:template match="processing-instruction('pgbr')">
<fo:block break-after="page" />
</xsl:template>
</xsl:stylesheet>
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service