Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » XML Schema Definition (XSD) » maxlength value missing
maxlength value missing [message #591547] Tue, 14 September 2004 18:21
Eclipse UserFriend
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
Previous Topic:Adding XSD components to an existing schema
Next Topic:XSDXPathDefinition
Goto Forum:
  


Current Time: Thu Apr 18 23:50:20 GMT 2024

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

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

Back to the top