Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » XML Schema Definition (XSD) » Enumeration S.Type: How to add values?
Enumeration S.Type: How to add values? [message #17012] Mon, 07 April 2003 22:17 Go to next message
Eclipse UserFriend
Originally posted by: dirk.schesmer.divos.de

Hi there,
I'm a newbee in this group and would like to learn about how to add value to
an <<Enumeration>> Simple Type like the S.T. Status: available, negotaiting,
sold (taken from the Car example in Mastering XMI)

I know how to do it using the XMIFramework, but how to add values using
EMF/XSD (this indeed sooo much more powerful framework!)
XSDPrototypicalSchema.java just show me how to add the first enum value, but
what about more of them ?

XSDEnumerationFacet xsdEnumerationFacet =
xsdFactory.createXSDEnumerationFacet();

xsdEnumerationFacet.setLexicalValue("unknown");

Thanks for help,

Dirk V. Schesmer
Re: Enumeration S.Type: How to add values? [message #17071 is a reply to message #17012] Mon, 07 April 2003 23:17 Go to previous message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

Dirk,

Each concrete enumeration facet holds only one value, so you simply create
another XSDEnumerationFacet and add it to the facet contents too. (All the
different concrete enumeration facets are composed as a single synthetic
enumeration facet that holds a list of values.)

"Dirk V. Schesmer" wrote:

> Hi there,
> I'm a newbee in this group and would like to learn about how to add value to
> an <<Enumeration>> Simple Type like the S.T. Status: available, negotaiting,
> sold (taken from the Car example in Mastering XMI)
>
> I know how to do it using the XMIFramework, but how to add values using
> EMF/XSD (this indeed sooo much more powerful framework!)
> XSDPrototypicalSchema.java just show me how to add the first enum value, but
> what about more of them ?
>
> XSDEnumerationFacet xsdEnumerationFacet =
> xsdFactory.createXSDEnumerationFacet();
>
> xsdEnumerationFacet.setLexicalValue("unknown");
>
> Thanks for help,
>
> Dirk V. Schesmer
Re: Enumeration S.Type: How to add values? [message #567217 is a reply to message #17012] Mon, 07 April 2003 23:17 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
Dirk,

Each concrete enumeration facet holds only one value, so you simply create
another XSDEnumerationFacet and add it to the facet contents too. (All the
different concrete enumeration facets are composed as a single synthetic
enumeration facet that holds a list of values.)

"Dirk V. Schesmer" wrote:

> Hi there,
> I'm a newbee in this group and would like to learn about how to add value to
> an <<Enumeration>> Simple Type like the S.T. Status: available, negotaiting,
> sold (taken from the Car example in Mastering XMI)
>
> I know how to do it using the XMIFramework, but how to add values using
> EMF/XSD (this indeed sooo much more powerful framework!)
> XSDPrototypicalSchema.java just show me how to add the first enum value, but
> what about more of them ?
>
> XSDEnumerationFacet xsdEnumerationFacet =
> xsdFactory.createXSDEnumerationFacet();
>
> xsdEnumerationFacet.setLexicalValue("unknown");
>
> Thanks for help,
>
> Dirk V. Schesmer


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:xmlns attribute without prefix in schema tag: How to?
Next Topic:xmlns attribute without prefix in schema tag: How to?
Goto Forum:
  


Current Time: Tue Apr 23 10:46:24 GMT 2024

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

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

Back to the top