Schema schema = null;
Form form = null;
switch (_annotated.getStructureType()) {
case Structure.ATTRIBUTE:
AttributeDecl attribute = (AttributeDecl)_annotated;
//-- resolve reference
if (attribute.isReference())
attribute = attribute.getReference();
schema = attribute.getSchema();
//-- top-level (use targetNamespace of schema)
if (attribute.getParent() == schema)
break;
//-- check form (qualified or unqualified)
form = attribute.getForm();
if (form == null) {
form = schema.getAttributeFormDefault();
}
if ((form == null) || form.isUnqualified()) {
//-- no targetNamespace by default