XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Topic Page 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
Puvit SinghSubject: Re-using a simple type definition; with enumeration constraint and without enumeration constraint
Author: Puvit Singh
Date: 30 Jan 2008 05:20 PM
My problem is as follows, any advice / suggestion would be greatly appreciated:

Lets suppose that I have defined a simpleType "addressType" with 3 enumeration values (Home, Office, Vacation) that restrict data entry.
I want to use this simpleType in 2 different unrelated complexType definitions, lets call them "personalAddress" and "companyAddress"

How will I be able to use "addressType" inside "personalAddress" such that the 3 enumeration values are taken into consideration, i.e. data entry is restricted to either one of those three enumeration values and also use the same "addressType" inside "companyAddress" such that the enumeration values are not considered and the user can enter a completely different value for addressType (such as "HomeOffice" and the schema validates the XML file)?

I do not want to create another addressType (one with enumerations and one without - and different names)

Does anybody think that there is a way to re use the same simple type twice; once with the enumeration values and another time without the enumeration values?

Posttop
(Deleted User) Subject: Re-using a simple type definition; with enumeration constraint and without enumeration constraint
Author: (Deleted User)
Date: 07 Feb 2008 05:20 AM
If the two address types have different enums, they are different types. If you want to reuse the common part of these types, you will need to separate it into its own type, and derive the other two by restriction.

Alberto

 
Topic Page 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.