M
Michael Strorm
Hi!
I've been having problems with a DTD. Having had the Sun XML validator
reject a document, I put it through 'xmllint' for more information.
'Xmllint' noted a problem with the DTD itself;
"validity error : Content model of section is not determinist: (text ,
(list , text)* , list?)"
Here's a very simplified version of the DTD demonstrating the problem:-
<?xml version="1.0" encoding="iso-8859-1"?>
<!ELEMENT section (text, (list, text)*, list?)>
<!ELEMENT list (item+)>
<!ELEMENT item (text)>
<!ELEMENT text (#PCDATA)*>
The section element is the problem line; it should permit *any*
sequence of alternating <text> and <list> elements that start with a
<text> element.
My guess... either I've broken a specific rule of XML, or (as I suspect
from the use of the word 'determinist') there's a fundamental ambiguity
of logic in there. I *don't* think the problem is a bug in xmllint, as
Sun's XML validator had previously given unexpected results (hence my
use of xmllint for more info).
(Sample documents are at the end of this post, if that's any help).
Any feedback would be appreciated. Thank you!
- MS
==================================
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE section SYSTEM "problem.dtd">
<section>
<text>Filler 1</text>
<list>
<item><text>Filler 2a</text></item>
<item><text>Filler 2b</text></item>
</list>
<text>Filler 3</text>
<list>
<item><text>Filler 4a</text></item>
<item><text>Filler 4b</text></item>
</list>
</section>
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE section SYSTEM "problem.dtd">
<section>
<text>Filler 1</text>
<list>
<item><text>Filler 2a</text></item>
<item><text>Filler 2b</text></item>
</list>
<text>Filler 3</text>
<list>
<item><text>Filler 4a</text></item>
<item><text>Filler 4b</text></item>
</list>
<text>Filler 5</text>
</section>
I've been having problems with a DTD. Having had the Sun XML validator
reject a document, I put it through 'xmllint' for more information.
'Xmllint' noted a problem with the DTD itself;
"validity error : Content model of section is not determinist: (text ,
(list , text)* , list?)"
Here's a very simplified version of the DTD demonstrating the problem:-
<?xml version="1.0" encoding="iso-8859-1"?>
<!ELEMENT section (text, (list, text)*, list?)>
<!ELEMENT list (item+)>
<!ELEMENT item (text)>
<!ELEMENT text (#PCDATA)*>
The section element is the problem line; it should permit *any*
sequence of alternating <text> and <list> elements that start with a
<text> element.
My guess... either I've broken a specific rule of XML, or (as I suspect
from the use of the word 'determinist') there's a fundamental ambiguity
of logic in there. I *don't* think the problem is a bug in xmllint, as
Sun's XML validator had previously given unexpected results (hence my
use of xmllint for more info).
(Sample documents are at the end of this post, if that's any help).
Any feedback would be appreciated. Thank you!
- MS
==================================
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE section SYSTEM "problem.dtd">
<section>
<text>Filler 1</text>
<list>
<item><text>Filler 2a</text></item>
<item><text>Filler 2b</text></item>
</list>
<text>Filler 3</text>
<list>
<item><text>Filler 4a</text></item>
<item><text>Filler 4b</text></item>
</list>
</section>
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE section SYSTEM "problem.dtd">
<section>
<text>Filler 1</text>
<list>
<item><text>Filler 2a</text></item>
<item><text>Filler 2b</text></item>
</list>
<text>Filler 3</text>
<list>
<item><text>Filler 4a</text></item>
<item><text>Filler 4b</text></item>
</list>
<text>Filler 5</text>
</section>