Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » XML Schema Definition (XSD) » TODO: The default literal value "EnumMemberA" is invalid
TODO: The default literal value "EnumMemberA" is invalid [message #603460] Thu, 13 November 2008 16:52
John T.E. Timm is currently offline John T.E. TimmFriend
Messages: 161
Registered: July 2009
Senior Member
I am having a problem with an attribute that is defined as fixed with a
simple type enumeration member:

<xs:attribute name="attr1" type="SimpleTypeA" fixed="EnumMemberA"/>

is generating:

protected static final Object ATTR1_EDEFAULT; // TODO The default value
literal "EnumMemberA" is not valid.
protected Object attr1 = ATTR1_EDEFAULT;

The causes a compilation error for unassigned static final field. I
believe that in the past (perhaps version EMF 2.2) it would have generated

protected static final Object ATTR1_EDEFAULT =
ExampleFactory.eINSTANCE.createFromString(ExamplePackage.eIN STANCE.getSimpleTypeA(),
protected Object attr1 = ATTR1_EDEFAULT;

The full schema that was used for this example is:

<?xml version="1.0"?>
<xs:schema xmlns:xs=""

<xs:simpleType name="SimpleBaseType">
<xs:restriction base="xs:token">
<xs:pattern value="[^\s]+"/>

<xs:simpleType name="SimpleTypeA">
<xs:union memberTypes="SimpleTypeB SimpleTypeC"/>

<xs:simpleType name="SimpleTypeB">
<xs:restriction base="SimpleBaseType"/>

<xs:simpleType name="SimpleTypeC">
<xs:restriction base="SimpleBaseType">
<xs:enumeration value="EnumMemberA"/>
<xs:enumeration value="EnumMemberB"/>
<xs:enumeration value="EnumMemberC"/>

<xs:complexType name="ComplexTypeA">
<xs:element name="element1" type="xs:string"/>
<xs:element name="element2" type="xs:string"/>
<xs:attribute name="attr1" type="SimpleTypeA" fixed="EnumMemberA"/>


I am running Eclipse Ganymede 3.4.1 with EMF 2.4.1 on Windows XP SP3.


Previous Topic:XML schema "fixed" attribute and static final fields
Next Topic:Generated EObjectValidator class
Goto Forum:

Current Time: Sun Jul 12 05:57:07 GMT 2020

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

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

Back to the top