/* (non-Javadoc)
* @see com.sun.xml.xsom.visitor.XSVisitor#attributeUse(com.sun.xml.xsom.XSAttributeUse)
*/
public void attributeUse(XSAttributeUse use) {
XSAttributeDecl decl = use.getDecl();
String additionalAtts = "";
if (use.isRequired()) {
additionalAtts += " use=\"required\"";
}
if (use.getFixedValue() != null
&& use.getDecl().getFixedValue() == null) {
additionalAtts += " fixed=\"" + use.getFixedValue() + "\"";
}
if (use.getDefaultValue() != null
&& use.getDecl().getDefaultValue() == null) {
additionalAtts += " default=\"" + use.getDefaultValue() + "\"";
}
if (decl.isLocal()) {
// this is anonymous attribute use
dump(decl, additionalAtts);
}
else {
// reference to a global one
String str = MessageFormat.format(
"Attribute ref \"'{'{0}'}'{1}{2}\"", new Object[]{
decl.getTargetNamespace(), decl.getName(),
additionalAtts});
SchemaTreeNode newNode = new SchemaTreeNode(str, decl.getLocator());
this.currNode.add(newNode);
}
}