Problems with XInclude example

Are you missing a feature? Request its implementation here.
PeterRobertson
Posts: 47
Joined: Mon Apr 18, 2005 2:22 pm

Problems with XInclude example

Post by PeterRobertson »

I have been investigating XInclude with Oxygen 5.1 and I have found problems in the example from the User Guide.

XInclude has been enabled and I am using the "Docbook PDF" transformation.

I copied the example to a file c:\TEMP\test.xml.
When I try to apply the transformation scenario, I get the error:

E C:\TEMP\xinclude.mod (The system cannot find the file specified)

I then changed the example to refer explicitly to xinclude.mod in the Oxygen installation directory. Now when I transform I get the error:

E The process ended with code : 2 The error was : [ERROR] file:/C:/TEMP/test.xml_xslt:1:28523 fo:flow must contain block-level children

Adding <part>, <chapter>, <sect> and so on allows the transformation to complete successfully (although still with the warning: "W oXygen encountered in para, but no template matches").
george
Site Admin
Posts: 2095
Joined: Thu Jan 09, 2003 2:58 pm

Post by george »

Hi Peter,

The first error is expected as the DTD needs some changes to enable XInclude processing and those changes are in that module file. Then it is hard to say what happens. What you can do is to take closer steps and see if at each step you have the expected result.
1. the document must be valid
2. the XInclude processing must be enabled
3. the XInclude must expand the included documents correctly - for that you can use a simple identity transformation stylesheet like below

Code: Select all


<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match="node() | @*">
<xsl:copy>
<xsl:apply-templates select="node() | @*"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
The result is a document with the included content.
4. the FO document is generated correctly. For that duplicate the DocbookPDF transformation and disable the FO processing and save the result to a file. The generated file should be the same as when you apply the transformation for the document with XInclude resolved, the document obtained at step 3.
5. The generation of FO to PDF works without problems (use the FO2PDF scenario that applies the FO processing on the input document, not on the XSLT transformation result).

If each of these steps works then the whole conversion should work, otherwise we should be able to identify the failing step.

Hope that helps,
George
PeterRobertson
Posts: 47
Joined: Mon Apr 18, 2005 2:22 pm

Post by PeterRobertson »

My point was that you have an example in the User Guide that doesn't work! I feel you should be the ones to correct it.
george
Site Admin
Posts: 2095
Joined: Thu Jan 09, 2003 2:58 pm

Post by george »

Hi Peter,

The example should work if you open the file from its initial location. If you place that file content in a file in some other forlder then that file is not our example :). The XInclude example is not a single file, there are 4 files in that directory that form the example (3 that are included).
If you say that you open the sampleXInclude.xml file from samples/docbook and transform that to PDF using the default DocBookPDF scenario (without changing it by adding parameters or some other changes) after you enabled XInclude processing and you do not get the expected PDF output then that is a bug and we will surely investigate it and fix it.

Best Regards,
George
PeterRobertson
Posts: 47
Joined: Mon Apr 18, 2005 2:22 pm

Post by PeterRobertson »

If you go to the User Guide and search for XInclude you get to
a page that states:
Here is an example of a chapter file that is included in a book file using XInclude.
Nowhere on that page does it suggest that the example can only work from a particular directory.

At the very least you should make that clear!
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Post by sorin_ristache »

Hello,

We corrected the user manual. It will be available in the next release of <oXygen/>. Thank you for pointing this out.

Best Regards,
Sorin
george
Site Admin
Posts: 2095
Joined: Thu Jan 09, 2003 2:58 pm

Post by george »

Sorry Peter,

I thought you were referring to the sample from the oXygen samples project.

Best Regards,
George
PeterRobertson
Posts: 47
Joined: Mon Apr 18, 2005 2:22 pm

Post by PeterRobertson »

Glad things got sorted out in the end.
Post Reply