Page 1 of 1

XInclude not applying schema to included file

Posted: Tue Jan 06, 2004 3:39 am
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

Posted: Thu Jan 08, 2004 5:02 pm
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

Using alternative

Posted: Fri Jan 09, 2004 1:36 am
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