Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » XML Schema Definition (XSD) » prohibiting attributes in extension
prohibiting attributes in extension [message #9265] Wed, 08 January 2003 10:02 Go to next message
Eclipse UserFriend
Originally posted by: Michael.Hartmeier.softwareag.com

Eclipse allows to create a schema where a derived type prohibites an
attribute of the base type. Is this correct, is the attached schema valid
according the the XML schema spec? I'd expect to see some kind of XSD
diagnostics, but there are none (with XSD 20021023_1900TL).

Michael

<xs:schema xmlns:xs='http://www.w3.org/2001/XMLSchema'>
<xs:complexType name='base'>
<xs:sequence>
<xs:element name='a' type='xs:string'/>
</xs:sequence>
<xs:attribute name='a' type='xs:string' use='required'/>
<xs:attribute name='b' type='xs:string' use='required'/>
</xs:complexType>
<xs:complexType name='derived' >
<xs:complexContent>
<xs:extension base='base'>
<xs:sequence>
<xs:element name='b' type='xs:string'/>
</xs:sequence>
<xs:attribute name='b' type='xs:string' use='prohibited'/>
<xs:attribute name='c' type='xs:string' use='required'/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:schema>
Re: prohibiting attributes in extension [message #9522 is a reply to message #9265] Fri, 24 January 2003 11:45 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

Michael,

No, this schema is not correct. It violates cause 1.2 of cos-ct-extends,
i.e., the base type's attributes uses are not a subset of those of the
complex type itself. (Only a restriction can prohibit attributes.) I've
fixed the implementation to produce a diagnostic for this case.

Thanks for finding this problem.


Michael Hartmeier wrote:

> Eclipse allows to create a schema where a derived type prohibites an
> attribute of the base type. Is this correct, is the attached schema valid
> according the the XML schema spec? I'd expect to see some kind of XSD
> diagnostics, but there are none (with XSD 20021023_1900TL).
>
> Michael
>
> <xs:schema xmlns:xs='http://www.w3.org/2001/XMLSchema'>
> <xs:complexType name='base'>
> <xs:sequence>
> <xs:element name='a' type='xs:string'/>
> </xs:sequence>
> <xs:attribute name='a' type='xs:string' use='required'/>
> <xs:attribute name='b' type='xs:string' use='required'/>
> </xs:complexType>
> <xs:complexType name='derived' >
> <xs:complexContent>
> <xs:extension base='base'>
> <xs:sequence>
> <xs:element name='b' type='xs:string'/>
> </xs:sequence>
> <xs:attribute name='b' type='xs:string' use='prohibited'/>
> <xs:attribute name='c' type='xs:string' use='required'/>
> </xs:extension>
> </xs:complexContent>
> </xs:complexType>
> </xs:schema>
>

--
Ed Merks
Re: prohibiting attributes in extension [message #11707 is a reply to message #9522] Sat, 01 March 2003 09:51 Go to previous message
Eclipse UserFriend
Originally posted by: Michael.Hartmeier.softwareag.com

Build 1207 properly reports the invalid schema :-)

Michael

Ed Merks wrote:

> Michael,

> No, this schema is not correct. It violates cause 1.2 of cos-ct-extends,
> i.e., the base type's attributes uses are not a subset of those of the
> complex type itself. (Only a restriction can prohibit attributes.) I've
> fixed the implementation to produce a diagnostic for this case.

> Thanks for finding this problem.


> Michael Hartmeier wrote:

> > Eclipse allows to create a schema where a derived type prohibites an
> > attribute of the base type. Is this correct, is the attached schema valid
> > according the the XML schema spec? I'd expect to see some kind of XSD
> > diagnostics, but there are none (with XSD 20021023_1900TL).
> >
> > Michael
> >
> > <xs:schema xmlns:xs='http://www.w3.org/2001/XMLSchema'>
> > <xs:complexType name='base'>
> > <xs:sequence>
> > <xs:element name='a' type='xs:string'/>
> > </xs:sequence>
> > <xs:attribute name='a' type='xs:string' use='required'/>
> > <xs:attribute name='b' type='xs:string' use='required'/>
> > </xs:complexType>
> > <xs:complexType name='derived' >
> > <xs:complexContent>
> > <xs:extension base='base'>
> > <xs:sequence>
> > <xs:element name='b' type='xs:string'/>
> > </xs:sequence>
> > <xs:attribute name='b' type='xs:string' use='prohibited'/>
> > <xs:attribute name='c' type='xs:string' use='required'/>
> > </xs:extension>
> > </xs:complexContent>
> > </xs:complexType>
> > </xs:schema>
> >

> --
> Ed Merks
Re: prohibiting attributes in extension [message #564765 is a reply to message #9265] Fri, 24 January 2003 11:45 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33252
Registered: July 2009
Senior Member
Michael,

No, this schema is not correct. It violates cause 1.2 of cos-ct-extends,
i.e., the base type's attributes uses are not a subset of those of the
complex type itself. (Only a restriction can prohibit attributes.) I've
fixed the implementation to produce a diagnostic for this case.

Thanks for finding this problem.


Michael Hartmeier wrote:

> Eclipse allows to create a schema where a derived type prohibites an
> attribute of the base type. Is this correct, is the attached schema valid
> according the the XML schema spec? I'd expect to see some kind of XSD
> diagnostics, but there are none (with XSD 20021023_1900TL).
>
> Michael
>
> <xs:schema xmlns:xs='http://www.w3.org/2001/XMLSchema'>
> <xs:complexType name='base'>
> <xs:sequence>
> <xs:element name='a' type='xs:string'/>
> </xs:sequence>
> <xs:attribute name='a' type='xs:string' use='required'/>
> <xs:attribute name='b' type='xs:string' use='required'/>
> </xs:complexType>
> <xs:complexType name='derived' >
> <xs:complexContent>
> <xs:extension base='base'>
> <xs:sequence>
> <xs:element name='b' type='xs:string'/>
> </xs:sequence>
> <xs:attribute name='b' type='xs:string' use='prohibited'/>
> <xs:attribute name='c' type='xs:string' use='required'/>
> </xs:extension>
> </xs:complexContent>
> </xs:complexType>
> </xs:schema>
>

--
Ed Merks


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: prohibiting attributes in extension [message #565472 is a reply to message #9522] Sat, 01 March 2003 09:51 Go to previous message
Michael Hartmeier is currently offline Michael HartmeierFriend
Messages: 21
Registered: July 2009
Junior Member
Build 1207 properly reports the invalid schema :-)

Michael

Ed Merks wrote:

> Michael,

> No, this schema is not correct. It violates cause 1.2 of cos-ct-extends,
> i.e., the base type's attributes uses are not a subset of those of the
> complex type itself. (Only a restriction can prohibit attributes.) I've
> fixed the implementation to produce a diagnostic for this case.

> Thanks for finding this problem.


> Michael Hartmeier wrote:

> > Eclipse allows to create a schema where a derived type prohibites an
> > attribute of the base type. Is this correct, is the attached schema valid
> > according the the XML schema spec? I'd expect to see some kind of XSD
> > diagnostics, but there are none (with XSD 20021023_1900TL).
> >
> > Michael
> >
> > <xs:schema xmlns:xs='http://www.w3.org/2001/XMLSchema'>
> > <xs:complexType name='base'>
> > <xs:sequence>
> > <xs:element name='a' type='xs:string'/>
> > </xs:sequence>
> > <xs:attribute name='a' type='xs:string' use='required'/>
> > <xs:attribute name='b' type='xs:string' use='required'/>
> > </xs:complexType>
> > <xs:complexType name='derived' >
> > <xs:complexContent>
> > <xs:extension base='base'>
> > <xs:sequence>
> > <xs:element name='b' type='xs:string'/>
> > </xs:sequence>
> > <xs:attribute name='b' type='xs:string' use='prohibited'/>
> > <xs:attribute name='c' type='xs:string' use='required'/>
> > </xs:extension>
> > </xs:complexContent>
> > </xs:complexType>
> > </xs:schema>
> >

> --
> Ed Merks
Previous Topic:restricting attributes
Next Topic:"xmlns" in the <schema> element
Goto Forum:
  


Current Time: Sat Nov 09 01:59:15 GMT 2024

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

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

Back to the top