}
if( isGlobal() ) {
// register this expression as a global attribtue declaration.
AttributeDeclExp decl = reader.currentSchema.attributeDecls.getOrCreate(name);
if(decl.exp!=null)
reader.reportError(
new Locator[]{this.location,reader.getDeclaredLocationOf(decl)},
XMLSchemaReader.ERR_DUPLICATE_ATTRIBUTE_DEFINITION,
new Object[]{name} );
reader.setDeclaredLocationOf(decl);
if( exp instanceof AttributeExp )
decl.set( (AttributeExp)exp );
else {
// sometimes, because of the error recovery,
// exp can be something other than an AttributeExp.
if( !reader.controller.hadError() ) throw new Error();
}