Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » XSD to Ecore Union Enum h pattern
XSD to Ecore Union Enum h pattern [message #425150] Mon, 17 November 2008 09:30 Go to next message
David CHAUTARD is currently offline David CHAUTARDFriend
Messages: 102
Registered: July 2009
Senior Member
Hi,
In my xsd schema, I have an attribute's object that is a union of a enum
and a pattern :

<xsd:simpleType name="MyObjectType">
<xsd:union>
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="A_AA"/>
<xsd:enumeration value="A_BB"/>
<xsd:enumeration value="A_CC"/>
<xsd:enumeration value="A_DD"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:pattern value="A_(.)*"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:union>
</xsd:simpleType>

and I would like to display this attribute in a editable combobox. But
when I get the type of my feature, I have a EDataType, and I can't have
the literal values.
Re: XSD to Ecore Union Enum h pattern [message #425168 is a reply to message #425150] Tue, 18 November 2008 06:53 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33137
Registered: July 2009
Senior Member
David,

Given that any A_* is valid, there isn't a fixed set of choice, right?


David CHAUTARD wrote:
> Hi,
> In my xsd schema, I have an attribute's object that is a union of a
> enum and a pattern :
>
> <xsd:simpleType name="MyObjectType">
> <xsd:union>
> <xsd:simpleType>
> <xsd:restriction base="xsd:string">
> <xsd:enumeration value="A_AA"/>
> <xsd:enumeration value="A_BB"/>
> <xsd:enumeration value="A_CC"/>
> <xsd:enumeration value="A_DD"/>
> </xsd:restriction>
> </xsd:simpleType>
> <xsd:simpleType>
> <xsd:restriction base="xsd:string">
> <xsd:pattern value="A_(.)*"/>
> </xsd:restriction>
> </xsd:simpleType>
> </xsd:union> </xsd:simpleType>
>
> and I would like to display this attribute in a editable combobox. But
> when I get the type of my feature, I have a EDataType, and I can't
> have the literal values.
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: XSD to Ecore Union Enum h pattern [message #425282 is a reply to message #425168] Fri, 21 November 2008 14:14 Go to previous message
David CHAUTARD is currently offline David CHAUTARDFriend
Messages: 102
Registered: July 2009
Senior Member
You are right, any A_* is valid, but we have to propose a fixed set of
choice and the others value are not often used.

To solve my problem, I use :
- "ExtendedMetaData.INSTANCE.getMemberTypes((EDataType)
feature.getEType()), feature)" to get the list of enumerates
-"ExtendedMetaData.INSTANCE.getPatternFacet(dataType)" to get my pattern.

Thanks,
David.
Previous Topic:[CDO] ClassRef unresolveable
Next Topic:EMF 2.5M3 with Eclipse SDK 3.5 M2
Goto Forum:
  


Current Time: Sat Apr 20 00:31:18 GMT 2024

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

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

Back to the top