nodeSet.add(el);
return el;
}
public Leaf complexType(XSComplexType ct) {
Define def = complexTypes.get(ct);
if(def==null) {
// TODO: consider name collision and such
String name = ct.getName();
if(ct.isLocal()) {
name = ct.getScope().getName();
}
def = grammar.get(name);
complexTypes.put(ct,def);
XSType baseType = ct.getBaseType();
if(baseType.isComplexType() && !isAnyType(baseType)) {
// copy inheritance
def.addChild(baseType.apply(this));
if(ct.getDerivationMethod()==XSType.EXTENSION) {
XSContentType explicitContent = ct.getExplicitContent();
if(explicitContent!=null)
def.addChild(explicitContent.apply(this));
attHolder(ct, def);
}
} else {
// just start from fresh
def.addChild(ct.getContentType().apply(this));
attHolder(ct, def);
}
}
return new Ref(ct.getLocator(),def);