Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » XML Schema Definition (XSD) » Problems with deriving types
Problems with deriving types [message #65101] Tue, 29 November 2005 17:43 Go to next message
Klaas Dellschaft is currently offline Klaas DellschaftFriend
Messages: 58
Registered: July 2009
Member
Hi,

I have a problem with extending a complexType with an attribute group.
The following types are defined:


<xs:complexType name="A">
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="source" type="element1"/>
<xs:element name="value" type="element2"/>
<xs:group ref="ns:group"/>
</xs:choice>
<xs:attributeGroup ref="ns:attributeGroup1"/>
</xs:complexType>

<xs:complexType name="B">
<xs:complexContent>
<xs:extension base="A">
<xs:attributeGroup ref="ns:attributeGroup2"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>


This is part of a very large schema. When validating this schema, I get
the following error message for the type B: "The basetype has
'elementOnly' content so this extended type must also".

And indeed, when I look at the contentTypeCategory of B, it has "emtpy"
while A has a contentTypeCategory of "elementOnly". Until now I failed
to reduce the large schema to a minimal schema reproducing the problem.
Because when I reduce it only to those definition (including the
referenced definitions), the contentTypeCategory of B is also
"elementOnly", so that the error doesn't occur. Probably you have any
idea, why the contentTypeCategory of B may become "empty" sometimes?

I got the problem using XSD 2.1. Until now I had no time to test it with
more recent versions of XSD.

Cheers
Klaas
Re: Problems with deriving types [message #65126 is a reply to message #65101] Tue, 29 November 2005 18:16 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

Klaas,

I suppose this could be related to
https://bugs.eclipse.org/bugs/show_bug.cgi?id=101761 but that should be
in 2.1 already. I'll have a look at the larger example if that's the
only place the problem happens...


Klaas Dellschaft wrote:

> Hi,
>
> I have a problem with extending a complexType with an attribute group.
> The following types are defined:
>
>
> <xs:complexType name="A">
> <xs:choice minOccurs="0" maxOccurs="unbounded">
> <xs:element name="source" type="element1"/>
> <xs:element name="value" type="element2"/>
> <xs:group ref="ns:group"/>
> </xs:choice>
> <xs:attributeGroup ref="ns:attributeGroup1"/>
> </xs:complexType>
>
> <xs:complexType name="B">
> <xs:complexContent>
> <xs:extension base="A">
> <xs:attributeGroup ref="ns:attributeGroup2"/>
> </xs:extension>
> </xs:complexContent>
> </xs:complexType>
>
>
> This is part of a very large schema. When validating this schema, I
> get the following error message for the type B: "The basetype has
> 'elementOnly' content so this extended type must also".
>
> And indeed, when I look at the contentTypeCategory of B, it has
> "emtpy" while A has a contentTypeCategory of "elementOnly". Until now
> I failed to reduce the large schema to a minimal schema reproducing
> the problem. Because when I reduce it only to those definition
> (including the referenced definitions), the contentTypeCategory of B
> is also "elementOnly", so that the error doesn't occur. Probably you
> have any idea, why the contentTypeCategory of B may become "empty"
> sometimes?
>
> I got the problem using XSD 2.1. Until now I had no time to test it
> with more recent versions of XSD.
>
> Cheers
> Klaas
Re: Problems with deriving types [message #65191 is a reply to message #65126] Wed, 30 November 2005 12:35 Go to previous message
Klaas Dellschaft is currently offline Klaas DellschaftFriend
Messages: 58
Registered: July 2009
Member
> I suppose this could be related to
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=101761 but that should be
> in 2.1 already. I'll have a look at the larger example if that's the
> only place the problem happens...

I was able to reduce the problem to a small example. It seems to be
caused by include-statements. I opened a new bug in bugzilla
(https://bugs.eclipse.org/bugs/show_bug.cgi?id=118621).

Cheers
Klaas
Re: Problems with deriving types [message #597245 is a reply to message #65101] Tue, 29 November 2005 18:16 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33141
Registered: July 2009
Senior Member
Klaas,

I suppose this could be related to
https://bugs.eclipse.org/bugs/show_bug.cgi?id=101761 but that should be
in 2.1 already. I'll have a look at the larger example if that's the
only place the problem happens...


Klaas Dellschaft wrote:

> Hi,
>
> I have a problem with extending a complexType with an attribute group.
> The following types are defined:
>
>
> <xs:complexType name="A">
> <xs:choice minOccurs="0" maxOccurs="unbounded">
> <xs:element name="source" type="element1"/>
> <xs:element name="value" type="element2"/>
> <xs:group ref="ns:group"/>
> </xs:choice>
> <xs:attributeGroup ref="ns:attributeGroup1"/>
> </xs:complexType>
>
> <xs:complexType name="B">
> <xs:complexContent>
> <xs:extension base="A">
> <xs:attributeGroup ref="ns:attributeGroup2"/>
> </xs:extension>
> </xs:complexContent>
> </xs:complexType>
>
>
> This is part of a very large schema. When validating this schema, I
> get the following error message for the type B: "The basetype has
> 'elementOnly' content so this extended type must also".
>
> And indeed, when I look at the contentTypeCategory of B, it has
> "emtpy" while A has a contentTypeCategory of "elementOnly". Until now
> I failed to reduce the large schema to a minimal schema reproducing
> the problem. Because when I reduce it only to those definition
> (including the referenced definitions), the contentTypeCategory of B
> is also "elementOnly", so that the error doesn't occur. Probably you
> have any idea, why the contentTypeCategory of B may become "empty"
> sometimes?
>
> I got the problem using XSD 2.1. Until now I had no time to test it
> with more recent versions of XSD.
>
> Cheers
> Klaas


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Problems with deriving types [message #597269 is a reply to message #65126] Wed, 30 November 2005 12:35 Go to previous message
Klaas Dellschaft is currently offline Klaas DellschaftFriend
Messages: 58
Registered: July 2009
Member
> I suppose this could be related to
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=101761 but that should be
> in 2.1 already. I'll have a look at the larger example if that's the
> only place the problem happens...

I was able to reduce the problem to a small example. It seems to be
caused by include-statements. I opened a new bug in bugzilla
(https://bugs.eclipse.org/bugs/show_bug.cgi?id=118621).

Cheers
Klaas
Previous Topic:Schema Validation problem with Geronimo Schemas
Next Topic:XSDConcreteComponentImpl.forceReplace throws NPE
Goto Forum:
  


Current Time: Fri Apr 26 04:44:57 GMT 2024

Powered by FUDForum. Page generated in 0.03764 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top