You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by GL...@syncrasystems.com on 2000/08/04 20:59:21 UTC

content="empty" Error

I found what I believe to be a bug in the schema validation process of
Xerces.  When a parent type is declared to be content="empty", a CMException
is thrown any time a derivation of that type is accessed.  The Exception is
not thrown when the child type is also explicity content="empty", but I
don't believe this should be necessary. I have included an example xml and
xsd which should show the error I am talking about.  I am using a version of
Xerces I grabbed from cvs on Wednesday.  Thank you.
	-Greg Larkin, Syncra Systems
Example.xml:
<Example xmlns="http://www.example.org/example"
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" 
	xsi:schemaLocation="http://www.example.org/example
ExampleError.xsd">
	<default name="NAME" default="DEFAULT"/>
	<field name="NAME"/>
</Example>


Example.xsd:
<schema targetNamespace="http://www.example.org/example"
xmlns="http://www.w3.org/1999/XMLSchema" 
	xmlns:EX="http://www.example.org/example"
	elementFormDefault = "qualified">
	<element name="Example" type="EX:ExampleType"/>
	<complexType name="ExampleType">
		<element name="default" type="EX:DefaultFieldType"/>
		<element name="field" type="EX:FieldType"/>
	</complexType>
	<complexType name="FieldType" content="empty">
		<attribute name="name" type="string"/>
	</complexType>
	<complexType name="DefaultFieldType" base="EX:FieldType"
derivedBy="extension">
		<attribute name="default" type="string"/>
	</complexType>
</schema>

Re: content="empty" Error

Posted by Eric Ye <er...@locus.apache.org>.
I just checked in the fix on this to the CVS repository. Actually the schema
spec is quite murky on this, but your proposal seems to be a very reasonable
deduction.
_____


Eric Ye * IBM, JTC - Silicon Valley * ericye@locus.apache.org

----- Original Message -----
From: <GL...@syncrasystems.com>
To: <xe...@xml.apache.org>
Sent: Friday, August 04, 2000 11:59 AM
Subject: content="empty" Error


> I found what I believe to be a bug in the schema validation process of
> Xerces.  When a parent type is declared to be content="empty", a
CMException
> is thrown any time a derivation of that type is accessed.  The Exception
is
> not thrown when the child type is also explicity content="empty", but I
> don't believe this should be necessary. I have included an example xml and
> xsd which should show the error I am talking about.  I am using a version
of
> Xerces I grabbed from cvs on Wednesday.  Thank you.
> -Greg Larkin, Syncra Systems
> Example.xml:
> <Example xmlns="http://www.example.org/example"
> xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
> xsi:schemaLocation="http://www.example.org/example
> ExampleError.xsd">
> <default name="NAME" default="DEFAULT"/>
> <field name="NAME"/>
> </Example>
>
>
> Example.xsd:
> <schema targetNamespace="http://www.example.org/example"
> xmlns="http://www.w3.org/1999/XMLSchema"
> xmlns:EX="http://www.example.org/example"
> elementFormDefault = "qualified">
> <element name="Example" type="EX:ExampleType"/>
> <complexType name="ExampleType">
> <element name="default" type="EX:DefaultFieldType"/>
> <element name="field" type="EX:FieldType"/>
> </complexType>
> <complexType name="FieldType" content="empty">
> <attribute name="name" type="string"/>
> </complexType>
> <complexType name="DefaultFieldType" base="EX:FieldType"
> derivedBy="extension">
> <attribute name="default" type="string"/>
> </complexType>
> </schema>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-j-dev-help@xml.apache.org
>
>


Re: content="empty" Error

Posted by Eric Ye <er...@locus.apache.org>.
Thanks for reporting this bug, a CMException should never be thrown.  I'll
look into this,
_____


Eric Ye * IBM, JTC - Silicon Valley * ericye@locus.apache.org

----- Original Message -----
From: <GL...@syncrasystems.com>
To: <xe...@xml.apache.org>
Sent: Friday, August 04, 2000 11:59 AM
Subject: content="empty" Error


> I found what I believe to be a bug in the schema validation process of
> Xerces.  When a parent type is declared to be content="empty", a
CMException
> is thrown any time a derivation of that type is accessed.  The Exception
is
> not thrown when the child type is also explicity content="empty", but I
> don't believe this should be necessary. I have included an example xml and
> xsd which should show the error I am talking about.  I am using a version
of
> Xerces I grabbed from cvs on Wednesday.  Thank you.
> -Greg Larkin, Syncra Systems
> Example.xml:
> <Example xmlns="http://www.example.org/example"
> xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
> xsi:schemaLocation="http://www.example.org/example
> ExampleError.xsd">
> <default name="NAME" default="DEFAULT"/>
> <field name="NAME"/>
> </Example>
>
>
> Example.xsd:
> <schema targetNamespace="http://www.example.org/example"
> xmlns="http://www.w3.org/1999/XMLSchema"
> xmlns:EX="http://www.example.org/example"
> elementFormDefault = "qualified">
> <element name="Example" type="EX:ExampleType"/>
> <complexType name="ExampleType">
> <element name="default" type="EX:DefaultFieldType"/>
> <element name="field" type="EX:FieldType"/>
> </complexType>
> <complexType name="FieldType" content="empty">
> <attribute name="name" type="string"/>
> </complexType>
> <complexType name="DefaultFieldType" base="EX:FieldType"
> derivedBy="extension">
> <attribute name="default" type="string"/>
> </complexType>
> </schema>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-j-dev-help@xml.apache.org
>
>