String elementName, String attributeName, String attributeType,
String[] enums, short attributeUse, String defaultValue )
throws SAXException {
// create Datatype that validates attribute value.
Datatype dt = createDatatype(attributeType);
StringPair str = new StringPair("",attributeType);
if(enums!=null) {
Expression exp = Expression.nullSet;
for( int i=0; i<enums.length; i++ )
exp = grammar.pool.createChoice( exp,
grammar.pool.createValue(dt,str,
dt.createValue(enums[i],null)));
return exp;
}
if( attributeUse == USE_FIXED ) {
return grammar.pool.createValue(dt,str,
dt.createValue(defaultValue,null));
}
return grammar.pool.createData(dt,str);
}