After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 321475 - libxml2 claims a schema non-deterministic while all major XML libs accept it
libxml2 claims a schema non-deterministic while all major XML libs accept it
Status: RESOLVED FIXED
Product: libxml2
Classification: Platform
Component: general
2.6.22
Other All
: Normal normal
: ---
Assigned To: Daniel Veillard
libxml QA maintainers
Depends on:
Blocks:
 
 
Reported: 2005-11-14 22:54 UTC by Gabor Nagy
Modified: 2005-12-15 02:11 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Gabor Nagy 2005-11-14 22:54:29 UTC
Please describe the problem:
The following schema component is found correct (deterministic) by all these
applications, yet libxml2 claims it is not:
- The W3 online schema validator
- Xerces
- Altiva's XMLSpy
- Microsoft Visual Studio (MSXML?)

	<xs:element name="animation">
		<xs:complexType>
			<xs:sequence>
				<xs:element ref="asset" minOccurs="0"/>
				<xs:choice>
					<xs:sequence>
						<xs:element ref="source" maxOccurs="unbounded"/>
						<xs:choice>
							<xs:sequence>
								<xs:element ref="sampler" maxOccurs="unbounded"/>
								<xs:element ref="channel" maxOccurs="unbounded"/>
								<xs:element ref="animation" minOccurs="0" maxOccurs="unbounded"/>
							</xs:sequence>
							<xs:element ref="animation" maxOccurs="unbounded"/>
						</xs:choice>
					</xs:sequence>
					<xs:sequence>
						<xs:element ref="sampler" maxOccurs="unbounded"/>
						<xs:element ref="channel" maxOccurs="unbounded"/>
						<xs:element ref="animation" minOccurs="0" maxOccurs="unbounded"/>
					</xs:sequence>
					<xs:element ref="animation" maxOccurs="unbounded"/>
				</xs:choice>
				<xs:element ref="extra" minOccurs="0" maxOccurs="unbounded"/>
			</xs:sequence>
			<xs:attribute name="id" type="xs:ID"/>
			<xs:attribute name="name" type="xs:NCName"/>
		</xs:complexType>
	</xs:element>


Steps to reproduce:
1. Create an xmlSchemaParserCtxt xmlSchemaNewParserCtxt()
2. Call xmlSchemaParse()



Actual results:
xmlSchemaParse() errors out, claiming:
"element complexType: Schemas parser error : local complex type: The content
model is not determinist."
By the way, the message has a typo. I believe term would be "deterministic".

Expected results:
xmlSchemaParse() should be successful and return a valid xmlSchema structure.

Does this happen every time?
Yes

Other information:
Comment 1 Daniel Veillard 2005-11-14 23:04:45 UTC
it's not crashing, it's a normal bug, not a blocker.
Can you provide a full complete schemas file reproducing the problem with 
xmllint ? So that
    xmllint --schemas pbm.xsd instance.xml 
allows to reproduce the problem. I cannot work with fractional data, sorry
that would force guessing and I can't spend time making guess while you have
the full informations.

   thanks,

Daniel
Comment 2 Gabor Nagy 2005-11-14 23:21:37 UTC
Thank you very much for the quick response (I'm impressed :)).
Yes, xmllint also gives the same error message.
Here is a complete schema for you to reproduce the problem:


<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns="http://www.collada.org/2005/11/COLLADASchema"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
targetNamespace="http://www.collada.org/2005/11/COLLADASchema"
elementFormDefault="qualified" version="1.4.0" xml:lang="EN"
xsi:schemaLocation="http://www.w3.org/2001/XMLSchema
http://www.w3.org/2001/XMLSchema.xsd">
	<xs:element name="animation">
		<xs:complexType>
			<xs:sequence>
				<xs:element ref="asset" minOccurs="0"/>
				<xs:choice>
					<xs:sequence>
						<xs:element ref="source" maxOccurs="unbounded"/>
						<xs:choice>
							<xs:sequence>
								<xs:element ref="sampler" maxOccurs="unbounded"/>
								<xs:element ref="channel" maxOccurs="unbounded"/>
								<xs:element ref="animation" minOccurs="0" maxOccurs="unbounded"/>
							</xs:sequence>
							<xs:element ref="animation" maxOccurs="unbounded"/>
						</xs:choice>
					</xs:sequence>
					<xs:sequence>
						<xs:element ref="sampler" maxOccurs="unbounded"/>
						<xs:element ref="channel" maxOccurs="unbounded"/>
						<xs:element ref="animation" minOccurs="0" maxOccurs="unbounded"/>
					</xs:sequence>
					<xs:element ref="animation" maxOccurs="unbounded"/>
				</xs:choice>
				<xs:element ref="extra" minOccurs="0" maxOccurs="unbounded"/>
			</xs:sequence>
			<xs:attribute name="id" type="xs:ID"/>
			<xs:attribute name="name" type="xs:NCName"/>
		</xs:complexType>
	</xs:element>

	<xs:element name="extra"/>
	<xs:element name="asset"/>
	<xs:element name="channel"/>
	<xs:element name="sampler"/>
	<xs:element name="source"/>
	<xs:element name="technique"/>
</xs:schema>




Thank you very much,

Gabor
Comment 3 Daniel Veillard 2005-11-14 23:29:45 UTC
  Okay, I managed to reproduce the problem, but I don't really have time right
now to debug the problem, it's in bugzilla and I will try to look at this later
this week if I find time.

paphio:~/XML -> xmllint --schema sony.xsd tst.xml
sony.xsd:4: element complexType: Schemas parser error : local complex type: The
content model is not determinist.
WXS schema sony.xsd failed to compile
<?xml version="1.0"?>
<doc/>
paphio:~/XML ->

  thanks for the report, 

Daniel
Comment 4 kbuchcik 2005-12-13 11:55:02 UTC
Yesterday's fix of bug #323510, got also rid of the problem we have here.
It's in CVS, xmlschemas.c revision 1.187.

Thanks for the report!
Comment 5 Gabor Nagy 2005-12-15 02:11:40 UTC
It works, thank you for the fix.