// getting desparate...
if( dt instanceof XSDatatypeImpl ) {
// if it contains EnumerationFacet, we can try that.
XSDatatypeImpl dti = (XSDatatypeImpl)dt;
EnumerationFacet e = (EnumerationFacet)dti.getFacetObject( XSDatatype.FACET_ENUMERATION );
if(e!=null) {
Object[] items = e.values.toArray();
for( int i=0; i<10; i++ ) {
try {
return dti.convertToLexicalValue(items[random.nextInt(items.length)],context);
} catch( Exception x ) { ; }
}
}
XSDatatype baseType = dti.getConcreteType();
if( baseType instanceof ListType )
return generateList(dti,context);
if( baseType instanceof UnionType )
return generateUnion((UnionType)baseType,context);