private XSDatatype deriveSimpleType(XSDatatype baseType,Element xsdRestriction){
  TypeIncubator incubator=new TypeIncubator(baseType);
  ValidationContext context=null;
  try {
    for (Iterator<Element> iter=xsdRestriction.elementIterator(); iter.hasNext(); ) {
      Element element=iter.next();
      String name=element.getName();
      String value=element.attributeValue("value");
      boolean fixed=AttributeHelper.booleanValue(element,"fixed");
      incubator.addFacet(name,value,fixed,context);
    }
    String newTypeName=null;
    return incubator.derive("",newTypeName);
  }
 catch (  DatatypeException e) {
    onSchemaError("Invalid restriction: " + e.getMessage() + " when trying to build restriction: "+ xsdRestriction);
    return null;
  }
}

private XSDatatype deriveSimpleType ( XSDatatype baseType , Element xsdRestriction ) { TypeIncubator incubator = new TypeIncubator ( baseType ) ; ValidationContext context = null ; try { for ( Iterator < Element > iter = xsdRestriction . elementIterator ( ) ; iter . hasNext ( ) ; ) { Element element = iter . next ( ) ; String name = element . getName ( ) ; String value = element . attributeValue ( "value" ) ; boolean fixed = AttributeHelper . booleanValue ( element , "fixed" ) ; incubator . addFacet ( name , value , fixed , context ) ; } String newTypeName = null ; return incubator . derive ( "" , newTypeName ) ; } catch ( DatatypeException e ) { onSchemaError ( "Invalid restriction: " + e . getMessage ( ) + " when trying to build restriction: " + xsdRestriction ) ; return null ; } }
derives a new type from a base type and a set of restrictions
