I am trying to create a docbook. I have created a main XML book and inside it I am using <xi:include> to add different chapters.
I am following DocBook XSL: The Complete Guide / Using XInclude to create book and chapter files.
Here is my main XML file book1.xml.
<?xml version="1.0"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
<book>
<title>MAIN NOTES</title>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="CH1.xml" />
</book>
And here is my chapter1 (CH1.xml).
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
<chapter id="CH1">
<title>Chapter 1</title>
<para>This is Test</para>
</chapter>
Now when I am validating these XML files, CH1.xml is ok. But I am always getting
No Declaration found for element "xi:include"
for book1.xml. What am I missing here? Please help.
How to make DTD validation work when using XInclude is described in another section of "DocBook XSL: The Complete Guide": http://www.sagehill.net/docbookxsl/ValidXinclude.html.
In short, there are two alternatives:
xmllint --xinclude --postvalid book1.xmlxi:include element.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With