xs:enumeration

I try to do the following thing on Schema Editor:

complex element with inside a sequence of an element (that have enumeration)and a simple attribute.
Why Tamino doesn’t accept this? Then if i try to create a simpleType like beside the schema editor
say me that a global definition is not allowed.

<xs:simpleType name=“componentType”>
<xs:restriction base=“xs:string”>
<xs:enumeration value=“GeneralUserInformation”/>
<xs:enumeration value=“LogicalIdentifiers”/>
<xs:enumeration value=“GeneralSubscribe Information”/>
</xs:restriction>

and then i have

<xs:element name=“OperatorAccessList”>
xs:complexType
xs:sequence
<xs:element name=“component” minOccurs=“0” maxOccurs=“unbounded”>
xs:complexType
xs:simpleContent
<xs:extension base=“componentType”>
<xs:attribute name=“mode” type=“xs:string” use=“required”/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>


Can anyone help me, please?
How can i write it correctly in the schema editor?
Thanks a lot.
@nto

is not supported with Tamino 3.1.1, 3.1.2 and 4.1.1!
You can only restrict built-in-types (http://www.w3.org/TR/xmlschema-2/#built-in-datatypes).
User-defined types (complexType, simpleType, simpleType with attributes) can only be addressed via the type-attribute.

Unfortunately there is no workaround for your construct, even not with Tamino 4.1.1, since you want to create an element definition, that has an attribute and additionally its type is restricted to the values of the enumeration. Therefore you would need to restrict user-defined types.

One solution might be a little change of your design:

Drop the attribute “mode” and create another element “mode” instead of. Then you can restrict the component element. Build a pair of (component, mode) elements using a sequence, e.g.

  <xs:schema xmlns:tsd = "http://namespaces.softwareag.com/tamino/TaminoSchemaDefinition" xmlns:xs = "http://www.w3.org/2001/XMLSchema">
  <xs:simpleType name = "componentType">
    <xs:restriction base = "xs:string">
      <xs:enumeration value = "GeneralUserInformation"></xs:enumeration>
      <xs:enumeration value = "LogicalIdentifiers"></xs:enumeration>
      <xs:enumeration value = "GeneralSubscribe Information"></xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:element name = "OperatorAccessList">
    <xs:complexType>
      <xs:sequence minOccurs = "0" maxOccurs = "unbounded">
        <xs:element name = "component" type = "componentType"></xs:element>
        <xs:element name = "mode" type = "xs:string"></xs:element>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
</xs:schema>



This one should work with Tamino 4.1.1.

If you work with Tamino 3.1.1 or 3.1.2, user defined types are not supported at all.

Please provide more information next time: Version of Tamino Server, Tamino-X-Tools.

Best regards,
Peter

[This message was edited by Admin on 12 Nov 2002 at 12:51.]

Sorry I am no XSD export, but I tried this out and I don’t believe you can achieve your goal. Because global types are not yet supported you need to able to restrict the basic xs:string type and at the same time extend it so that you can add the attribute. And there doesn’t seem a way to do this that I can find in the xml schema spec.