XInclude not applying schema to included file

Having trouble installing Oxygen? Got a bug to report? Post it all here.
gammoth
Posts: 12
Joined: Fri Nov 07, 2003 1:24 am

XInclude not applying schema to included file

Post by gammoth »

I'm trying to break my docbook documents into modules but I'm unable to get xinclude to recognize included files as docbook.

I am using a docbook schema as created by the Trang plugin from the docbook DTD. I have configured the Xerces parser to use XInclude, as suggested in this thread. The configuration appeared to work as the <xi:include> tag no longer caused an error.

I get the following errors:

E Document is invalid: no grammar found. xinclude-test.xml http://ada.chi.chicorp/devdocs/test/xinclude-test.xml 4:1
E Document root element "sect1", must match DOCTYPE root "null". xinclude-test.xml http://ada.chi.chicorp/devdocs/test/xinclude-test.xml 4:1

Here is the main file with the <xi:include> tag:

Code: Select all


<?xml version="1.0" encoding="UTF-8"?>
<article xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://ada.chi.chicorp/devdocs/style/docbook/xsd/docbook.xsd">
<title>Test XInclude</title>
<xi:include href="./introduction.xml" xmlns:xi="http://www.w3.org/2001/XInclude">
<xi:fallback>
<para>FIXME: xi:include failed for 'Introduction'.</para>
</xi:fallback>
</xi:include>
</article>

Here is the file to be included (note the include file validates on its own):

Code: Select all


<?xml version="1.0" encoding="UTF-8"?>
<sect1 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://ada.chi.chicorp/devdocs/style/docbook/xsd/docbook.xsd">
<title>Introduction</title>
<para>Some text.</para>
</sect1>
Much obliged,
Jonathan
Dan
Posts: 501
Joined: Mon Feb 03, 2003 10:56 am

Post by Dan »

Hello,

We reproduced the bug. The problem is that we cannot offer you a solution for this, but we will continue searching. As you probably know, we are using Xerces for validation and the xinclude is still experimental in the latest version of the parser.


Best regards,

Dan Caprioara
gammoth
Posts: 12
Joined: Fri Nov 07, 2003 1:24 am

Using alternative

Post by gammoth »

Hi Dan,

Thanks for looking into it. I appreciate it in light of the fact that the problem is with Xerces. I was hoping a little additional syntax would make Xerces happy.

As a compromise, I'm using xmllint, as suggested at Sagehill, to build a "resolved" document to apply the stylesheet to. Eg,

Code: Select all

xmllint --xinclude master.xml >resolved.xml
This works well to one level of indirection but loses it's appeal beyond that. Still, this is much better than one huge XML doc.

Let me add that I've really enjoyed using Oxygen. It's a fine editor and the results are making an impression with the boss.

Cheers,
Jonathan
Post Reply