X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=org.simantics.xml.sax%2Fsrc%2Forg%2Fsimantics%2Fxml%2Fdata%2FXmlDataConverter.java;fp=org.simantics.xml.sax%2Fsrc%2Forg%2Fsimantics%2Fxml%2Fdata%2FXmlDataConverter.java;h=7a2a5c54bf6d19ee805eb471374038d415b59208;hb=5985d5ea605049222dc5a4acb0accf77afd8f76f;hp=ce38d5ed28a0440e622c2a70c00a992ff2551e70;hpb=8c7637425667bd9710be0fe6afe437050fea59b7;p=simantics%2Finterop.git diff --git a/org.simantics.xml.sax/src/org/simantics/xml/data/XmlDataConverter.java b/org.simantics.xml.sax/src/org/simantics/xml/data/XmlDataConverter.java index ce38d5e..7a2a5c5 100644 --- a/org.simantics.xml.sax/src/org/simantics/xml/data/XmlDataConverter.java +++ b/org.simantics.xml.sax/src/org/simantics/xml/data/XmlDataConverter.java @@ -174,15 +174,12 @@ public class XmlDataConverter { } 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) { @@ -192,26 +189,12 @@ public class XmlDataConverter { } 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); @@ -250,7 +233,7 @@ public class XmlDataConverter { 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 { @@ -273,7 +256,7 @@ public class XmlDataConverter { 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); @@ -287,9 +270,9 @@ public class XmlDataConverter { // 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()) { @@ -299,7 +282,7 @@ public class XmlDataConverter { // if (!characters.isWhiteSpace()) // System.out.println(characters.getData()); } else if (event.isNamespace()) { - System.out.println(event); + } } } @@ -352,8 +335,6 @@ public class XmlDataConverter { } 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()); @@ -406,8 +387,6 @@ public class XmlDataConverter { } } } - if ("Panel.ZIndex".equals(schemaAttribute.getName())) - System.out.println(); complexType.getAttributeOrAttributeGroup().add(schemaAttribute); }