SchemaTreeNode newNode2 = new SchemaTreeNode("Complex content",
type.getContentType().getLocator());
this.currNode.add(newNode2);
this.currNode = newNode2;
XSComplexType baseType = type.getBaseType().asComplexType();
if (type.getDerivationMethod() == XSType.RESTRICTION) {
// restriction
String str = MessageFormat.format(
"Restriction base=\"<{0}>{1}\"", new Object[]{
baseType.getTargetNamespace(),
baseType.getName()});
SchemaTreeNode newNode3 = new SchemaTreeNode(str,
baseType.getLocator());
this.currNode.add(newNode3);
this.currNode = newNode3;
type.getContentType().visit(this);
dumpComplexTypeAttribute(type);
this.currNode = (SchemaTreeNode) this.currNode.getParent();
}
else {
// extension
String str = MessageFormat.format(
"Extension base=\"'{'{0}'}'{1}\"", new Object[]{
baseType.getTargetNamespace(),
baseType.getName()});
SchemaTreeNode newNode3 = new SchemaTreeNode(str,
baseType.getLocator());
this.currNode.add(newNode3);
this.currNode = newNode3;
// check if have redefine tag
if ((type.getTargetNamespace().compareTo(
baseType.getTargetNamespace()) ==
0)
&& (type.getName().compareTo(baseType.getName()) == 0)) {
SchemaTreeNode newNodeRedefine = new SchemaTreeNode(
"redefine", type
.getLocator());
this.currNode.add(newNodeRedefine);
this.currNode = newNodeRedefine;
baseType.visit(this);
this.currNode =
(SchemaTreeNode) newNodeRedefine.getParent();
}
type.getExplicitContent().visit(this);