} else {
schemaElement = elementMap.get(s).get(elementName);
}
+ if (elementName.equals("CanvasLayers.TracingLayer") || elementName.equals("Layer"))
+ System.out.println();
Element parentElement = elementStack.peek();
boolean newElement = false;
}
if (schemaElement == null) {
- LocalElement localElement = null;
+
//QName type = null;
if (elementStack.isEmpty()) {
schemaElement = new TopLevelElement();
schemaElement = new TopLevelElement();
s.getSimpleTypeOrComplexTypeOrGroup().add(schemaElement);
//type = new QName(SchemaConversionBase.SCHEMA_NS,"element");
- localElement = new LocalElement();
- localElement.setRef(new QName(parseElement.getName().getNamespaceURI(), elementName));
+
// }
}
schemaElement.setName(elementName);
- elementNsMap.put(schemaElement, currentNS);
-// if (sameNameSpace) {
-// schemaElement.setType(new QName(parseElement.getName().getNamespaceURI(),elementName));
-// } else {
-// schemaElement.setType(new QName(parseElement.getName().getNamespaceURI(), elementName));
-// }
- if (!elementStack.isEmpty()) {
- ComplexType complexType = parentElement.getComplexType();
- ExplicitGroup choice = complexType.getChoice();
- if (choice == null) {
- choice = new ExplicitGroup();
- complexType.setChoice(choice);
- choice.setMaxOccurs("unbounded");
- }
- addElement(choice, new QName(SchemaConversionBase.SCHEMA_NS,"element"), localElement);
- }
+ elementNsMap.put(schemaElement, currentNS);
elementMap.get(s).put(elementName, schemaElement);
newElement = true;
}
+ if (parentElement != null) {
+ ComplexType complexType = parentElement.getComplexType();
+ ExplicitGroup choice = complexType.getChoice();
+ if (choice == null) {
+ choice = new ExplicitGroup();
+ complexType.setChoice(choice);
+ choice.setMaxOccurs("unbounded");
+ }
+ LocalElement localElement = new LocalElement();
+ localElement.setRef(new QName(parseElement.getName().getNamespaceURI(), elementName));
+
+ addElement(choice, new QName(SchemaConversionBase.SCHEMA_NS,"element"), localElement);
+ }
+
elementStack.push(schemaElement);
Iterator<Attribute> attributeIterator = parseElement.getAttributes();