[XMLSCHEMA-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: overriding a datatype of an attribute

From: Michael Kay <mike@saxonica.com>
Date: Thu, 24 Jul 2008 17:39:15 +0100
To: "'Mario Madunic'" <hajduk@imag.net>, <xmlschema-dev@w3.org>
Message-ID: <4BB4D93BBA7949668802F9A6346FC8E9@Sealion>
RE: overriding a datatype of an attribute

> Declare an attribute
> 
> <xs:attribute name="type" type="xs:string" />
> 
> in which case it is used most often as.
> 
> Then when i include it
> 
> <xs:include schemaLocation="../attributes/type.xsd" />
> 
> and then reference it
> 
> <xs:attribute name="type" use="optional" />

That's declaring a different attribute, it's not referencing your original
declaration. To reference your original declaration, use ref="type".

> 
> can i change its type to dtReferenceType
> 
> <xs:attribute name="type" type="dtReferenceType" use="optional" />
> 
> The reason being I really do not want to create multiple 
> attributes that basically do the same thing but just require 
> a different datatype.

If they have different data types then I would have said they are
fundamentally different - the only thing they have in common is the name!

But yes, you are welcome to have multiple attributes with the same name and
different types. It might confuse your users, but that's up to you.

Michael Kay
http://www.saxonica.com/
Received on Thursday, 24 July 2008 16:40:01 GMT

Subscribe to the Stylus Scoop newsletter for helpful XML tips and tutorials.
Email
First Name
Last Name
Company

Download Stylus Studio 6 XML Enterprise Edition

Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2007 All Rights Reserved.