Additional XSLT stylesheet in docbook transformation

Dear Sirs I'm trying to produce a PDF from a docbook xml file. I need to use a customization layer but I keep receiving an error message like this: [Saxon6.5.5] ERROR: Document root element for FO output must be one of the following elements: appendix article bibliography book chapter colophon dedication glossary index part preface qandaset refentry reference sect1 section set setindex and SystemID: /Users/Sandro/Documents/quaderni_storicamente/index.xml Engine name: Saxon6.5.5 Severity: error Description: Cannot apply cascading transformation. Reason: Processing terminated by xsl:message at line 207 Here is the xsl <?xml version='1.0'?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" version="1.0"> <xsl:import href="fo/docbook.xsl"/> <xsl:template match="/book/chapter/para[@role = 'intro']"> <fo:block border="0.5pt solid blue" padding="3pt" xsl:use-attribute-sets="normal.para.spacing"> <xsl:apply-templates/> </fo:block> </xsl:template> </xsl:stylesheet> Thank you in advance Claudio

Hi, This is probably not an Oxygen issue, but a DocBook XSL issue. The Docbook stylesheets generate an fo:root element and page sequences only for certain elements, and those are listed in the error message. What is the root element of the document you are processing? Bob Stayton Sagehill Enterprises bobs@sagehill.net ----- Original Message ----- From: Claudio Tubertini To: oXygen-user@oxygenxml.com Sent: Saturday, June 04, 2011 8:15 AM Subject: [oXygen-user] Additional XSLT stylesheet in docbook transformation Dear Sirs I'm trying to produce a PDF from a docbook xml file. I need to use a customization layer but I keep receiving an error message like this: [Saxon6.5.5] ERROR: Document root element for FO output must be one of the following elements: appendix article bibliography book chapter colophon dedication glossary index part preface qandaset refentry reference sect1 section set setindex and SystemID: /Users/Sandro/Documents/quaderni_storicamente/index.xml Engine name: Saxon6.5.5 Severity: error Description: Cannot apply cascading transformation. Reason: Processing terminated by xsl:message at line 207 Here is the xsl <?xml version='1.0'?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" version="1.0"> <xsl:import href="fo/docbook.xsl"/> <xsl:template match="/book/chapter/para[@role = 'intro']"> <fo:block border="0.5pt solid blue" padding="3pt" xsl:use-attribute-sets="normal.para.spacing"> <xsl:apply-templates/> </fo:block> </xsl:template> </xsl:stylesheet> Thank you in advance Claudio ------------------------------------------------------------------------------ _______________________________________________ oXygen-user mailing list oXygen-user@oxygenxml.com http://www.oxygenxml.com/mailman/listinfo/oxygen-user

Hi, The root element is book, actually the xml file is the following <? xml version="1.0" encoding="UTF-8" ?> <book xml:lang="it" xmlns="http://docbook.org/ns/docbook" version="5.0"> <info> ... </info> <xi:include href="chapter1.xml" xmlns:xi="http://www.w3.org/2001/XInclude" /> </book> Thenk you in advance for your help Claudio ______________________________ Da: oxygen-user-bounces@oxygenxml.com [mailto:oxygen-user-bounces@oxygenxml.com] Per conto di Bob Stayton Inviato: domenica 5 giugno 2011 22.45 A: Claudio Tubertini; oXygen-user@oxygenxml.com Oggetto: Re: [oXygen-user] Additional XSLT stylesheet in docbooktransformation Hi, This is probably not an Oxygen issue, but a DocBook XSL issue. The Docbook stylesheets generate an fo:root element and page sequences only for certain elements, and those are listed in the error message. What is the root element of the document you are processing? Bob Stayton Sagehill Enterprises bobs@sagehill.net ----- Original Message ----- From: Claudio Tubertini <mailto:claudio.tubertini@gmail.com> To: oXygen-user@oxygenxml.com Sent: Saturday, June 04, 2011 8:15 AM Subject: [oXygen-user] Additional XSLT stylesheet in docbook transformation Dear Sirs I'm trying to produce a PDF from a docbook xml file. I need to use a customization layer but I keep receiving an error message like this: [Saxon6.5.5] ERROR: Document root element for FO output must be one of the following elements: appendix article bibliography book chapter colophon dedication glossary index part preface qandaset refentry reference sect1 section set setindex and SystemID: /Users/Sandro/Documents/quaderni_storicamente/index.xml Engine name: Saxon6.5.5 Severity: error Description: Cannot apply cascading transformation. Reason: Processing terminated by xsl:message at line 207 Here is the xsl <?xml version='1.0'?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" version="1.0"> <xsl:import href="fo/docbook.xsl"/> <xsl:template match="/book/chapter/para[@role = 'intro']"> <fo:block border="0.5pt solid blue" padding="3pt" xsl:use-attribute-sets="normal.para.spacing"> <xsl:apply-templates/> </fo:block> </xsl:template> </xsl:stylesheet> Thank you in advance Claudio ________________________________ _______________________________________________ oXygen-user mailing list oXygen-user@oxygenxml.com http://www.oxygenxml.com/mailman/listinfo/oxygen-user

Hello, Are you running Oxygen 12.2 and have modified the default "DocBook PDF" transformation by any chance ? Oxygen 12.2 added out-of-the-box support for DocBook profiling(conditional text) in the default transformation scenarios. This means that in the default transformation scenarios two stylesheets are applied to the original XML file: a generic profiling stylesheet(${frameworks}/docbook/xsl/profiling/profile.xsl) and the specific transformation stylesheet(e.g. PDF: ${frameworks}/docbook/xsl/fo/docbook_custom.xsl). So, if you have duplicated and modified one of the default DocBook scenarios you should: 1. If you also want to use the profiling(conditional text) support, keep the profiling XSL URL(${frameworks}/docbook/xsl/profiling/profile.xsl) in the scenario and just change the additional stylesheet. Press the "Additional XSLT stylesheets" button and replace the stylesheet with your customized own. 2. If profiling is not relevant to you, replace the XSL URL with your customized stylesheet(you probably already did this) and make sure that there aren't any additional stylesheets specified. Press the "Additional XSLT stylesheets" button and remove the stylesheet found there(${frameworks}/docbook/xsl/fo/docbook_custom.xsl). Either way, make sure you don't cascade stylesheets(use "Additional XSLT stylesheets") that can't be cascaded. Regards, Adrian Adrian Buza oXygen XML Editor and Author Support support@oxygenxml.com http://www.oxygenxml.com Claudio Tubertini wrote:
Hi, The root element is book, actually the xml file is the following <? xml version="1.0" encoding="UTF-8" ?> <book xml:lang="it" xmlns="http://docbook.org/ns/docbook" version="5.0"> <info> ... </info> <xi:include href="chapter1.xml" xmlns:xi="http://www.w3.org/2001/XInclude" /> </book>
Thenk you in advance for your help
Claudio
______________________________
Da: oxygen-user-bounces@oxygenxml.com [mailto:oxygen-user-bounces@oxygenxml.com] Per conto di Bob Stayton Inviato: domenica 5 giugno 2011 22.45 A: Claudio Tubertini; oXygen-user@oxygenxml.com Oggetto: Re: [oXygen-user] Additional XSLT stylesheet in docbooktransformation
Hi, This is probably not an Oxygen issue, but a DocBook XSL issue. The Docbook stylesheets generate an fo:root element and page sequences only for certain elements, and those are listed in the error message. What is the root element of the document you are processing?
Bob Stayton Sagehill Enterprises bobs@sagehill.net
----- Original Message ----- From: Claudio Tubertini <mailto:claudio.tubertini@gmail.com> To: oXygen-user@oxygenxml.com Sent: Saturday, June 04, 2011 8:15 AM Subject: [oXygen-user] Additional XSLT stylesheet in docbook transformation
Dear Sirs I'm trying to produce a PDF from a docbook xml file. I need to use a customization layer but I keep receiving an error message like this: [Saxon6.5.5] ERROR: Document root element for FO output must be one of the following elements: appendix article bibliography book chapter colophon dedication glossary index part preface qandaset refentry reference sect1 section set setindex and SystemID: /Users/Sandro/Documents/quaderni_storicamente/index.xml Engine name: Saxon6.5.5 Severity: error Description: Cannot apply cascading transformation. Reason: Processing terminated by xsl:message at line 207
Here is the xsl <?xml version='1.0'?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" version="1.0"> <xsl:import href="fo/docbook.xsl"/> <xsl:template match="/book/chapter/para[@role = 'intro']"> <fo:block border="0.5pt solid blue" padding="3pt" xsl:use-attribute-sets="normal.para.spacing"> <xsl:apply-templates/> </fo:block> </xsl:template> </xsl:stylesheet>
Thank you in advance
Claudio
________________________________
_______________________________________________ oXygen-user mailing list oXygen-user@oxygenxml.com http://www.oxygenxml.com/mailman/listinfo/oxygen-user
_______________________________________________ oXygen-user mailing list oXygen-user@oxygenxml.com http://www.oxygenxml.com/mailman/listinfo/oxygen-user

On 6.6.2011 12:03, Adrian Buza wrote:
Oxygen 12.2 added out-of-the-box support for DocBook profiling(conditional text) in the default transformation scenarios. This means that in the default transformation scenarios two stylesheets are applied to the original XML file: a generic profiling stylesheet(${frameworks}/docbook/xsl/profiling/profile.xsl) and the specific transformation stylesheet(e.g. PDF: ${frameworks}/docbook/xsl/fo/docbook_custom.xsl).
I'm just curious -- is there any reason why you haven't used profile-docbook.xsl instead, which does profiling and actual transformation in a single step? Jirka -- ------------------------------------------------------------------ Jirka Kosek e-mail: jirka@kosek.cz http://xmlguru.cz ------------------------------------------------------------------ Professional XML consulting and training services DocBook customization, custom XSLT/XSL-FO document processing ------------------------------------------------------------------ OASIS DocBook TC member, W3C Invited Expert, ISO JTC1/SC34 member ------------------------------------------------------------------

Hello, We did not use profile-docbook.xsl because it does not apply all the profiling attribute values always correctly for complex DocBook documents. We tested that version of profiling stylesheet on a complex document and it allowed in the output some subsections which did not have the profiling attribute value set as the profiling parameter of the transformation. The profile.xsl stylesheet did not have this problem so we used that in the Oxygen scenarios. Regards, Sorin Jirka Kosek wrote:
On 6.6.2011 12:03, Adrian Buza wrote:
Oxygen 12.2 added out-of-the-box support for DocBook profiling(conditional text) in the default transformation scenarios. This means that in the default transformation scenarios two stylesheets are applied to the original XML file: a generic profiling stylesheet(${frameworks}/docbook/xsl/profiling/profile.xsl) and the specific transformation stylesheet(e.g. PDF: ${frameworks}/docbook/xsl/fo/docbook_custom.xsl).
I'm just curious -- is there any reason why you haven't used profile-docbook.xsl instead, which does profiling and actual transformation in a single step?
Jirka

An anomaly in DocBook profiling came up on the Oxygen users mailing list, but it is actually a DocBook XSL issue, so I'm posting the problem and solution to the docbook-apps mailing list as well. From: "Sorin Ristache" <sorin@sync.ro> To: <oXygen-user@oxygenxml.com>
We did not use profile-docbook.xsl because it does not apply all the profiling attribute values always correctly for complex DocBook documents. We tested that version of profiling stylesheet on a complex document and it allowed in the output some subsections which did not have the profiling attribute value set as the profiling parameter of the transformation. The profile.xsl stylesheet did not have this problem so we used that in the Oxygen scenarios.
With Sorin's help, I tracked down the source of this problem, because it did not seem right to me that the profile-docbook.xsl stylesheet would produce a different profile from the profile.xsl stylesheet. It turns out to be an issue with customization of the DocBook HTML chunking stylesheet while profiling, and does not seem to be documented anywhere, so I'm posting the solution here for the record. Because DocBook's chunking stylesheet relies on XSL import precedence to separate the chunking functions from the formatting functions, a customization of the chunking stylesheet requires a particular setup that imports and includes various DocBook XSL modules in a certain order. That process is described here: http://www.sagehill.net/docbookxsl/ChunkingCustomization.html To customize the chunking stylesheet for single-pass profiling, my book says to import "profile-docbook.xsl" instead of "docbook.xsl". But that is not sufficient for chunked output. It is also necessary to replace the reference to "chunk-code.xsl" with "profile-chunk-code.xsl" in the customization file. The difference is that chunk-code.xsl matches on the original document nodeset, while profile-chunk-code.xsl matches on the profiled node set. If this substitution is not made, then the profiling won't work correctly for customized chunked output. I'll add this information to the next edition of my book. Bob Stayton Sagehill Enterprises bobs@sagehill.net ----- Original Message ----- From: "Sorin Ristache" <sorin@sync.ro> To: <oXygen-user@oxygenxml.com> Sent: Monday, June 06, 2011 6:39 AM Subject: Re: [oXygen-user] R: Additional XSLTstylesheet in docbooktransformation
Hello,
We did not use profile-docbook.xsl because it does not apply all the profiling attribute values always correctly for complex DocBook documents. We tested that version of profiling stylesheet on a complex document and it allowed in the output some subsections which did not have the profiling attribute value set as the profiling parameter of the transformation. The profile.xsl stylesheet did not have this problem so we used that in the Oxygen scenarios.
Regards, Sorin
Jirka Kosek wrote:
On 6.6.2011 12:03, Adrian Buza wrote:
Oxygen 12.2 added out-of-the-box support for DocBook profiling(conditional text) in the default transformation scenarios. This means that in the default transformation scenarios two stylesheets are applied to the original XML file: a generic profiling stylesheet(${frameworks}/docbook/xsl/profiling/profile.xsl) and the specific transformation stylesheet(e.g. PDF: ${frameworks}/docbook/xsl/fo/docbook_custom.xsl).
I'm just curious -- is there any reason why you haven't used profile-docbook.xsl instead, which does profiling and actual transformation in a single step?
Jirka
oXygen-user mailing list oXygen-user@oxygenxml.com http://www.oxygenxml.com/mailman/listinfo/oxygen-user

Hi Claudio, I'm not sure if this is the cause of your error message, but there is a mismatch between your XML file and your XSL customization. Your XML file indicates the document is in the DocBook namespace, but the stylesheet does not add the namespace prefix to the element names in the custom template. So that template would be ignored during processing because the match attribute won't match any element in your document. See this reference for more information: http://www.sagehill.net/docbookxsl/ProcesingDb5.html#Db5Xslt Bob Stayton Sagehill Enterprises bobs@sagehill.net ----- Original Message ----- From: "Claudio Tubertini" <claudio.tubertini@archetipolibri.it> To: <oXygen-user@oxygenxml.com> Sent: Sunday, June 05, 2011 10:15 PM Subject: [oXygen-user] R: Additional XSLT stylesheet in docbooktransformation
Hi, The root element is book, actually the xml file is the following <? xml version="1.0" encoding="UTF-8" ?> <book xml:lang="it" xmlns="http://docbook.org/ns/docbook" version="5.0"> <info> ... </info> <xi:include href="chapter1.xml" xmlns:xi="http://www.w3.org/2001/XInclude" /> </book>
Thenk you in advance for your help
Claudio
______________________________
Da: oxygen-user-bounces@oxygenxml.com [mailto:oxygen-user-bounces@oxygenxml.com] Per conto di Bob Stayton Inviato: domenica 5 giugno 2011 22.45 A: Claudio Tubertini; oXygen-user@oxygenxml.com Oggetto: Re: [oXygen-user] Additional XSLT stylesheet in docbooktransformation
Hi, This is probably not an Oxygen issue, but a DocBook XSL issue. The Docbook stylesheets generate an fo:root element and page sequences only for certain elements, and those are listed in the error message. What is the root element of the document you are processing?
Bob Stayton Sagehill Enterprises bobs@sagehill.net
----- Original Message ----- From: Claudio Tubertini <mailto:claudio.tubertini@gmail.com> To: oXygen-user@oxygenxml.com Sent: Saturday, June 04, 2011 8:15 AM Subject: [oXygen-user] Additional XSLT stylesheet in docbook transformation
Dear Sirs I'm trying to produce a PDF from a docbook xml file. I need to use a customization layer but I keep receiving an error message like this: [Saxon6.5.5] ERROR: Document root element for FO output must be one of the following elements: appendix article bibliography book chapter colophon dedication glossary index part preface qandaset refentry reference sect1 section set setindex and SystemID: /Users/Sandro/Documents/quaderni_storicamente/index.xml Engine name: Saxon6.5.5 Severity: error Description: Cannot apply cascading transformation. Reason: Processing terminated by xsl:message at line 207
Here is the xsl <?xml version='1.0'?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" version="1.0"> <xsl:import href="fo/docbook.xsl"/> <xsl:template match="/book/chapter/para[@role = 'intro']"> <fo:block border="0.5pt solid blue" padding="3pt" xsl:use-attribute-sets="normal.para.spacing"> <xsl:apply-templates/> </fo:block> </xsl:template> </xsl:stylesheet>
Thank you in advance
Claudio
________________________________
_______________________________________________ oXygen-user mailing list oXygen-user@oxygenxml.com http://www.oxygenxml.com/mailman/listinfo/oxygen-user
_______________________________________________ oXygen-user mailing list oXygen-user@oxygenxml.com http://www.oxygenxml.com/mailman/listinfo/oxygen-user

Thank you to everybody. First of all I replaced the XSL URL with my customized stylesheet and deleted the additional stylesheet (button additional XSLT stylesheet ) and Oxygen stopped to give me the error messages, but also I had to amend the namespaces otherwise no customization were executed. Claudio On 6 June 2011 18:32, Bob Stayton <bobs@sagehill.net> wrote:
Hi Claudio, I'm not sure if this is the cause of your error message, but there is a mismatch between your XML file and your XSL customization. Your XML file indicates the document is in the DocBook namespace, but the stylesheet does not add the namespace prefix to the element names in the custom template. So that template would be ignored during processing because the match attribute won't match any element in your document. See this reference for more information:
http://www.sagehill.net/docbookxsl/ProcesingDb5.html#Db5Xslt
Bob Stayton Sagehill Enterprises bobs@sagehill.net
----- Original Message ----- From: "Claudio Tubertini" <claudio.tubertini@archetipolibri.it> To: <oXygen-user@oxygenxml.com> Sent: Sunday, June 05, 2011 10:15 PM Subject: [oXygen-user] R: Additional XSLT stylesheet in docbooktransformation
Hi, The root element is book, actually the xml file is the following <? xml version="1.0" encoding="UTF-8" ?> <book xml:lang="it" xmlns="http://docbook.org/ns/docbook" version="5.0"> <info> ... </info> <xi:include href="chapter1.xml" xmlns:xi="http://www.w3.org/2001/XInclude" /> </book>
Thenk you in advance for your help
Claudio
______________________________
Da: oxygen-user-bounces@oxygenxml.com [mailto:oxygen-user-bounces@oxygenxml.com] Per conto di Bob Stayton Inviato: domenica 5 giugno 2011 22.45 A: Claudio Tubertini; oXygen-user@oxygenxml.com Oggetto: Re: [oXygen-user] Additional XSLT stylesheet in docbooktransformation
Hi, This is probably not an Oxygen issue, but a DocBook XSL issue. The Docbook stylesheets generate an fo:root element and page sequences only for certain elements, and those are listed in the error message. What is the root element of the document you are processing?
Bob Stayton Sagehill Enterprises bobs@sagehill.net
----- Original Message ----- From: Claudio Tubertini <mailto:claudio.tubertini@gmail.com> To: oXygen-user@oxygenxml.com Sent: Saturday, June 04, 2011 8:15 AM Subject: [oXygen-user] Additional XSLT stylesheet in docbook transformation
Dear Sirs I'm trying to produce a PDF from a docbook xml file. I need to use a customization layer but I keep receiving an error message like this: [Saxon6.5.5] ERROR: Document root element for FO output must be one of the following elements: appendix article bibliography book chapter colophon dedication glossary index part preface qandaset refentry reference sect1 section set setindex and SystemID: /Users/Sandro/Documents/quaderni_storicamente/index.xml Engine name: Saxon6.5.5 Severity: error Description: Cannot apply cascading transformation. Reason: Processing terminated by xsl:message at line 207
Here is the xsl <?xml version='1.0'?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" version="1.0"> <xsl:import href="fo/docbook.xsl"/> <xsl:template match="/book/chapter/para[@role = 'intro']"> <fo:block border="0.5pt solid blue" padding="3pt" xsl:use-attribute-sets="normal.para.spacing"> <xsl:apply-templates/> </fo:block> </xsl:template> </xsl:stylesheet>
Thank you in advance
Claudio
________________________________
_______________________________________________ oXygen-user mailing list oXygen-user@oxygenxml.com http://www.oxygenxml.com/mailman/listinfo/oxygen-user
_______________________________________________ oXygen-user mailing list oXygen-user@oxygenxml.com http://www.oxygenxml.com/mailman/listinfo/oxygen-user
_______________________________________________ oXygen-user mailing list oXygen-user@oxygenxml.com http://www.oxygenxml.com/mailman/listinfo/oxygen-user
participants (6)
-
Adrian Buza
-
Bob Stayton
-
Claudio Tubertini
-
Claudio Tubertini
-
Jirka Kosek
-
Sorin Ristache