Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » XML Schema Definition (XSD) » Problems with generating list types
Problems with generating list types [message #595344] Tue, 03 May 2005 13:50
Klaas Dellschaft is currently offline Klaas DellschaftFriend
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
Previous Topic:Load XSDSchema from DOM rather than file
Next Topic:CWM and XSD
Goto Forum:
  


Current Time: Sat Sep 21 08:20:15 GMT 2024

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

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

Back to the top