Help with validation error in modular DocBook
This should cover W3C XML Schema, Relax NG and DTD related problems.
-
- Posts: 21
- Joined: Sun Jan 15, 2006 11:36 am
Help with validation error in modular DocBook
I need to refactor a fairly large DocBook help system to modularize it. The examples for book and chapter files at http://www.ibm.com/developerworks/xml/l ... ters3.html would do what I need. I've started a simplified version of that example. However when I try the chapter wrapper (chap5 in the online example) I get this validation error:
F Xerces A DOCTYPE is not allowed in content.
Using DocBook version: 4.4. Here is code:
Book file:
Chapter wrapper file "chap1.xml":
Section file defined in chapter wrapper:
The online example uses an earlier version of DocBook, so I wonder if something changed and the my version doesn't support this way of modularizing content.
Any help, advice, link to newer resources much appreciated!
F Xerces A DOCTYPE is not allowed in content.
Using DocBook version: 4.4. Here is code:
Book file:
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "file:///c:/docbook-xml-4.4/docbookx.dtd" [
<!ENTITY bookinfo SYSTEM "bookinfo.xml">
<!ENTITY preface SYSTEM "preface.xml">
<!ENTITY chap1 SYSTEM "chap1.xml">
]>
<book id="alm" lang="en">
&bookinfo;
&preface;
&chap1;
</book>
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "file:///c:/docbook-xml-4.4/docbookx.dtd" [
<!ENTITY chap1_1 SYSTEM "admin/admin_basics.xml">
]>
<chapter id="ch1_Admin">
<title>System Administration & Configuration</title>
<para>BLAH BLAH BLAH</para>
&chap1_1;
</chapter>
Code: Select all
<sect1 id="admin_admin_basics">
<title>Administration Basics</title>
<para>BLAH BLAH BLAH</para>
</sect1>
Any help, advice, link to newer resources much appreciated!
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Re: Help with validation error in modular DocBook
Post by sorin_ristache »
Hello,
That is not allowed in an XML document. You did not show the content of bookinfo and preface but if they contain a DOCTYPE declaration you get the same error. You do not get this error when you validate chap1.xml because the entity chap1_1 does not include a DOCTYPE declaration and you should do the same for the main book file.
If you want to keep the DOCTYPE declaration in chap1.xml you can include chap1.xml in the main book file with XInclude instead of entity as explained in the Oxygen User Manual.
Regards,
Sorin
When the entity &chap1; is expanded in the book file the result will be the DOCTYPE declaration of file chap1.xml inserted in the element <book> of the book file:robert3L wrote:when I try the chapter wrapper (chap5 in the online example) I get this validation error:
F Xerces A DOCTYPE is not allowed in content.
Code: Select all
<book id="alm" lang="en">
<!-- bookinfo content here -->
<!-- preface content here -->
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "file:///c:/docbook-xml-4.4/docbookx.dtd" [ ...
</book>
If you want to keep the DOCTYPE declaration in chap1.xml you can include chap1.xml in the main book file with XInclude instead of entity as explained in the Oxygen User Manual.
Regards,
Sorin
-
- Posts: 21
- Joined: Sun Jan 15, 2006 11:36 am
Re: Help with validation error in modular DocBook
Thanks for pointer to that doc - I was able to create a more modular structure of all valid DocBook xml files.
Now I have to figure out why my existing build batch file doesn't work anymore. I think it is unrelated to the structure change. (I inherited the whole system from someone who didn't document it. The batch invokes Saxon which I guess is a transformer... guess I have to learn about that next).
Anyway thanks for good pointer on this one.

Now I have to figure out why my existing build batch file doesn't work anymore. I think it is unrelated to the structure change. (I inherited the whole system from someone who didn't document it. The batch invokes Saxon which I guess is a transformer... guess I have to learn about that next).
Anyway thanks for good pointer on this one.
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ Artificial Intelligence (AI Positron Assistant add-on)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service