Validation errors on xi:include

Having trouble installing Oxygen? Got a bug to report? Post it all here.
Guest

Validation errors on xi:include

Post by Guest »

When trying to validate the document, I get errors if the document contains xi:include.

For example:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE chapter PUBLIC "-//INVERA//DTD DocBook XML V4.2-Extension//EN"
"http://ourDocBook.dtd">
<chapter id="ch-xml-dtd" xmlns:xi="http://www.w3.org/2003/XInclude">
<title>Documentation Type Definitions</title>
<para/>
<xi:include href="dtd.xml"/>
<xi:include href="xml-doc-validation.xml"/>
</chapter>

The errors:
Attribute "xmlns:xi" must be declared for element type "chapter".
Element type "xi:include" must be declared.
Unexpected element "xi:include". The content of the parent element type must match "(beginpage?,chapterinfo?, ...
george
Site Admin
Posts: 2095
Joined: Thu Jan 09, 2003 2:58 pm

Post by george »

Hi,

The xi:include element should be defined in your DTD. Please see the customization layer we added in the Docbook samples that came with the Oxygen 4 distribution.

samples/docbook/sampleXInclude.xml - the master file
samples/docbook/section1.xml - included file
samples/docbook/section2.xml - included file
samples/docbook/section3.xml - included file
docbook/dtd/xinclude.mod - the module with the XInclude customization

There are also some document templates that can give you a quick start about working with Docbook and XInclude, see the "Docbook 4.2 article with XInclude" that is available in the "New from templates" dialog.

Best Regards,
George
Post Reply