// Attr ref
XSAttributeUse attr = (XSAttributeUse) attrUses.item(0);
XSObjectList annotations = attr.getAnnotations();
assertEquals("REF", 1, annotations.getLength());
XSAnnotation annotation = attr.getAttrDeclaration().getAnnotation();
String expected = "<annotation sn:att=\"ATT1\" id=\"ANNOT1\" xmlns=\"http://www.w3.org/2001/XMLSchema\" xmlns:sv=\"XSAttributeUseAnnotationsTest\" xmlns:sn=\"SyntheticAnnotationNS\" > "
+ "<appinfo>APPINFO1</appinfo>" + "</annotation>";
assertEquals("REF_STRING", trim(expected), trim(annotation
.getAnnotationString()));
annotations = attr.getAttrDeclaration().getAnnotations();
assertEquals(
"REF_STRING_ANNOTATIONS",
trim(expected),
trim(((XSAnnotation) annotations.item(0)).getAnnotationString()));
// local attr
attr = (XSAttributeUse) attrUses.item(1);
annotations = attr.getAnnotations();
assertEquals("LOCAL", 1, annotations.getLength());
annotation = attr.getAttrDeclaration().getAnnotation();
expected = "<annotation sn:att=\"ATT11\" id=\"ANNOT6\" xmlns=\"http://www.w3.org/2001/XMLSchema\" xmlns:sv=\"XSAttributeUseAnnotationsTest\" xmlns:sn=\"SyntheticAnnotationNS\" > "
+ "<appinfo>APPINFO6</appinfo>" + "</annotation>";
assertEquals("LOCAL_STRING", trim(expected), trim(annotation
.getAnnotationString()));
annotations = attr.getAttrDeclaration().getAnnotations();
assertEquals(
"LOCAL_STRING_ANNOTATIONS",
trim(expected),
trim(((XSAnnotation) annotations.item(0)).getAnnotationString()));
// attr grp ref
// The attribute in the group has an annotation element
attr = (XSAttributeUse) attrUses.item(2);
annotations = attr.getAnnotations();
assertEquals("GROUP", 1, annotations.getLength());
annotation = attr.getAttrDeclaration().getAnnotation();
expected = "<annotation id=\"ANNOT3\" xmlns=\"http://www.w3.org/2001/XMLSchema\" xmlns:sv=\"XSAttributeUseAnnotationsTest\" xmlns:sn=\"SyntheticAnnotationNS\" > "
+ "<appinfo>APPINFO3</appinfo>" + "</annotation>";
assertEquals("GROUP_STRING", trim(expected), trim(annotation
.getAnnotationString()));
annotations = attr.getAttrDeclaration().getAnnotations();
assertEquals(
"GROUP_STRING_ANNOTATIONS",