I can tell you what is generating that error, but I'm not sure how to fix it. When the DTD resolves with your additional parameter entities, you get this:

((refentry | xi:include)* | (section | xi:include)* | simplesect*))

and

(refentry | xi:include)+ | (section | xi:include)+ | simplesect+)

The XML standard http://www.w3.org/TR/REC-xml/#sec-element-content says:

"it is an error if the content model allows an element to match more than one occurrence of an element type in the content model"

An xi:include element can match in either of two places in both of these parts of the content model, so that generates the deterministic error. So it looks like you can extend refentry, or section, but not both.

Or manually rewrite the content model for section, but I'm not clear on what it should be. The section content model is kind of convoluted because it is designed to prevent mixing of refentry, section, and simplesect children within the same section.

Bob Stayton
Sagehill Enterprises
[email protected]


----- Original Message ----- From: "Paul Suckling" <[email protected]>
To: "apps docbook" <[email protected]>
Sent: Wednesday, July 01, 2009 4:39 PM
Subject: [docbook-apps] Content model of section is not determinist


Hi there.

I am having what I believe to be a problem with my DTD which is
causing my documents to fail validation with xmllint.

I am using a DTD that is customised to allow the inclusion of
xi:includes and mathml at certain places within the document. This is
what the customisation (UG.dtd) looks like:

----------------------------------------------------------------------------------------------
<!-- xinclude entities -->
<!ELEMENT xi:include (xi:fallback?) >
<!ATTLIST xi:include
   xmlns:xi   CDATA       #FIXED    "http://www.w3.org/2001/XInclude";
   href       CDATA       #IMPLIED
   parse      (xml|text)  "xml"
   xpointer   CDATA       #IMPLIED
   encoding   CDATA       #IMPLIED
   accept     CDATA       #IMPLIED
   accept-language CDATA  #IMPLIED >

<!ELEMENT xi:fallback ANY>
<!ATTLIST xi:fallback
   xmlns:xi   CDATA   #FIXED   "http://www.w3.org/2001/XInclude"; >

<!-- can replace a chapter by an xinclude pointing to a chapter -->
<!ENTITY % local.chapter.class "| xi:include">
<!-- can replace a section by an xinclude pointing to a section -->
<!ENTITY % local.section.class "| xi:include">
<!-- can replace a refentry by an xinclude pointing to a refentry -->
<!ENTITY % local.refentry.class "| xi:include">
<!-- inside chapter or section elements -->
<!--<!ENTITY % local.divcomponent.mix "| xi:include">-->
<!-- inside para, programlisting, literallayout, etc. -->
<!ENTITY % local.para.char.mix "| xi:include">
<!-- inside bookinfo, chapterinfo, etc. -->
<!ENTITY % local.info.class "| xi:include">
<!-- inside equations
<!ENTITY % equation.math "| xi:include">
<!ENTITY % inlineequation.math "| xi:include">
<!ENTITY % informalequation.math "| xi:include">
-->

<!-- MathML entities -->
<!ENTITY % MATHML.prefixed "INCLUDE">
<!ENTITY % MATHML.prefix "mml">
<!ENTITY % equation.content "(alt?,
(graphic+|mediaobject+|xi:include+|mathphrase+|mml:math))">
<!ENTITY % inlineequation.content "(alt?,
(graphic+|inlinemediaobject+|xi:include+|mathphrase+|mml:math))">
<!ENTITY % informalequation.content "(alt?,
(graphic+|informalequation+|xi:include+|mathphrase+|mml:math))">
<!ENTITY % mathml PUBLIC "-//W3C//DTD MathML 2.0//EN"
"http://www.w3.org/TR/MathML2/dtd/mathml2.dtd";>
%mathml;
----------------------------------------------------------------------------------------------

However, when I try to validate a simple document:

----------------------------------------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
   "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"; [
   <!ENTITY % UG SYSTEM "../UG.dtd">
   %UG;
]>
<section >
 <title>Title</title>
 <para>
   This is a para.
 </para>
</section>
----------------------------------------------------------------------------------------------

using

xmllint --noout --valid --postvalid test.xml

I get the error

----------------------------------------------------------------------------------------------
test.xml:0: validity error : Content model of section is not de
terminist: (sectioninfo? , (title , subtitle? , titleabbrev?) , (toc | lot | ind ex | glossary | bibliography)* , (((calloutlist | glosslist | bibliolist | itemi zedlist | orderedlist | segmentedlist | simplelist | variablelist | caution | im portant | note | tip | warning | literallayout | programlisting | programlisting co | screen | screenco | screenshot | synopsis | cmdsynopsis | funcsynopsis | cl asssynopsis | fieldsynopsis | constructorsynopsis | destructorsynopsis | methods ynopsis | formalpara | para | simpara | address | blockquote | graphic | graphic co | mediaobject | mediaobjectco | informalequation | informalexample | informal figure | informaltable | equation | example | figure | table | msgset | procedur e | sidebar | qandaset | task | anchor | bridgehead | remark | highlights | abst ract | authorblurb | epigraph | indexterm | beginpage)+ , ((refentry | xi:includ e)* | (section | xi:include)* | simplesect*)) | (refentry | xi:include)+ | (sect ion | xi:include)+ | simplesect+) , (toc | lot | index | glossary | bibliography
)*)
----------------------------------------------------------------------------------------------

Does anyone know what's going wrong here? I suspect that I have
incorrectly defined my xi:include within the DTD or something like
that, but I am not sure.

Thank you.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]





---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to