* type to be referenced.
* @param refAttName
* The name of the attribute used when referencing a type by QName.
*/
private void writeTypeRef(TypeHost th, NonElement<T,C> type, String refAttName) {
Element e = null;
if (type instanceof MaybeElement) {
MaybeElement me = (MaybeElement)type;
boolean isElement = me.isElement();
if (isElement) e = me.asElement();
}
if (type instanceof Element) {
e = (Element)type;
}
if (type.getTypeName()==null) {
if ((e != null) && (e.getElementName() != null)) {
th.block(); // so that the caller may write other attributes
if(type instanceof ClassInfo) {
writeClass( (ClassInfo<T,C>)type, th );
} else {
writeEnum( (EnumLeafInfo<T,C>)type, (SimpleTypeHost)th);