} 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;
boolean sameNameSpace = true;
if (parentElement != null) {
- //QName parentType = parentElement.getType();
String parentNs = elementNsMap.get(parentElement);
sameNameSpace =currentNS.equals(parentNs);
if (!sameNameSpace) {
}
if (schemaElement == null) {
-
- //QName type = null;
if (elementStack.isEmpty()) {
schemaElement = new TopLevelElement();
s.getSimpleTypeOrComplexTypeOrGroup().add(schemaElement);
} else {
-
-
-// if (sameNameSpace) {
-// localElement = new LocalElement();
-// schemaElement = localElement;
-// //type = new QName(elementName);
-//
-// } else {
- schemaElement = new TopLevelElement();
- s.getSimpleTypeOrComplexTypeOrGroup().add(schemaElement);
- //type = new QName(SchemaConversionBase.SCHEMA_NS,"element");
-
-
-// }
+ schemaElement = new TopLevelElement();
+ s.getSimpleTypeOrComplexTypeOrGroup().add(schemaElement);
}
schemaElement.setName(elementName);
elementNsMap.put(schemaElement, currentNS);
Attribute attribute = attributeIterator.next();
if ("http://www.w3.org/XML/1998/namespace".equals(attribute.getName().getNamespaceURI()))
continue;
- addAttribute(attribute, complexType, parseElement.getNamespaceURI(attribute.getName().getPrefix()));
+ addAttribute(attribute, complexType, currentNS);
}
} else {
continue;
org.w3._2001.xmlschema.Attribute schemaAttribute = currentAttributes.get(attribute.getName().getLocalPart());
if (schemaAttribute == null) {
- addAttribute(attribute, complexType, parseElement.getNamespaceURI(attribute.getName().getPrefix()));
+ addAttribute(attribute, complexType, currentNS);
} else {
QName newType = getType(attribute.getValue());
updateAttributeType(schemaAttribute, newType);
// System.out.println("End " + element.getName());
elementStack.pop();
} else if (event.isAttribute()) {
- System.out.println(event);
+
} else if (event.isStartDocument()) {
- System.out.println(event);
+
} else if (event.isEndDocument()) {
} else if (event.isEntityReference()) {
// if (!characters.isWhiteSpace())
// System.out.println(characters.getData());
} else if (event.isNamespace()) {
- System.out.println(event);
+
}
}
}
}
private void addAttribute(Attribute attribute, ComplexType complexType, String currentNS) {
- if (attribute.getName().getLocalPart().equals("Panel.ZIndex"))
- System.out.println();
if (attribute.getName().getNamespaceURI().length() == 0 || attribute.getName().getNamespaceURI().equals(currentNS)) {
org.w3._2001.xmlschema.Attribute schemaAttribute = new org.w3._2001.xmlschema.Attribute();
schemaAttribute.setName(attribute.getName().getLocalPart());
}
}
}
- if ("Panel.ZIndex".equals(schemaAttribute.getName()))
- System.out.println();
complexType.getAttributeOrAttributeGroup().add(schemaAttribute);
}