maxlength value missing [message #591547] |
Tue, 14 September 2004 18:21 |
Eclipse User |
|
|
|
Originally posted by: robinnt.us.ibm.com
I am trying to build an anonymous simple type with a maximum length
restiction. The maxLength facet is being added to the simpleType however the
value is not shown. Do I need to do anything else in the code for this to
work? I am using the xsd-SDK-M200407211027 build.
This is the XSD fragment I am trying to build:
<xsd:element name="CLASS_CODE" nillable="true">
<xsd:simpleType name="string">
<xsd:annotation />
<xsd:restriction base="xsd:anySimpleType">
<xsd:whiteSpace value="preserve" />
<xsd:maxLength />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
Here is the code:
XSDSimpleTypeDefinition simpleType =
xsdFactory.createXSDSimpleTypeDefinition();
simpleType.setBaseTypeDefinition(derivedSchema.getSchemaForS chema().
resolveSimpleTypeDefinition(XSDConstants.SCHEMA_FOR_SCHEMA_U RI_2001,
xsdType));
dbColumnElement.setAnonymousTypeDefinition(simpleType);
XSDMaxLengthFacet maxLengthFacet =
xsdFactory.createXSDMaxLengthFacet();
maxLengthFacet.setValue(charLength); //set length value here
but is not shown in xsd file
simpleType.getFacetContents().add(maxLengthFacet);
Thank you, Robin
|
|
|
Powered by
FUDForum. Page generated in 0.02712 seconds