Problems with generating list types [message #595344] |
Tue, 03 May 2005 13:50 |
Klaas Dellschaft Messages: 58 Registered: July 2009 |
Member |
|
|
Hi,
I want to create the following list type programatically:
<xs:simpleType name="myType">
<xs:restriction>
<xs:simpleType>
<xs:list itemType="xs:integer"/>
</xs:simpleType>
<xs:length value="4"/>
</xs:restriction>
</xs:simpleType>
I create the list type with the following code:
XSDSimpleTypeDefinition simpleType = XSDFactory.eINSTANCE
.createXSDSimpleTypeDefinition();
simpleType.setItemTypeDefinition(itemType);
xsdSchema.getContents().add(simpleType);
If I query simpleType.getValidFacets() I get length, maxLength, minLength,
whiteSpace, enumeration and pattern as valid facets of this type so I
presumed that I can add the length-facet directly to the new list type. But
when I serialize it to a file I get
<xs:simpleType>
<xs:list itemType="xs:integer">
<xs:length value="4"/>
</xs:list>
</xs:simpleType>
What have I done wrong? Or am I mislead by the list of valid facets and I
have to create an anonymous list type which is added as the base type of
"myType" and there it is possible to set the facets?
Cheers
Klaas
|
|
|
Powered by
FUDForum. Page generated in 0.23733 seconds