summaryrefslogtreecommitdiffstats
path: root/branches/sca-java-1.x/modules/binding-ws-wsdlgen/src/main
diff options
context:
space:
mode:
authorslaws <slaws@13f79535-47bb-0310-9956-ffa450edef68>2009-10-16 16:04:27 +0000
committerslaws <slaws@13f79535-47bb-0310-9956-ffa450edef68>2009-10-16 16:04:27 +0000
commit85ea5b2905c9dfcb01b490b0d54dbd70bb475ee2 (patch)
tree149c56f2ff08cefa97d7a0e6acaccae241076e33 /branches/sca-java-1.x/modules/binding-ws-wsdlgen/src/main
parent1969d51ead2639c8641815e0a4ea33cc5e1c1758 (diff)
TUSCANY-3303 slight change so that import delete looks through all the imports before actually trying to delete any that need to be removed
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@825973 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'branches/sca-java-1.x/modules/binding-ws-wsdlgen/src/main')
-rw-r--r--branches/sca-java-1.x/modules/binding-ws-wsdlgen/src/main/java/org/apache/tuscany/sca/binding/ws/wsdlgen/Interface2WSDLGenerator.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/branches/sca-java-1.x/modules/binding-ws-wsdlgen/src/main/java/org/apache/tuscany/sca/binding/ws/wsdlgen/Interface2WSDLGenerator.java b/branches/sca-java-1.x/modules/binding-ws-wsdlgen/src/main/java/org/apache/tuscany/sca/binding/ws/wsdlgen/Interface2WSDLGenerator.java
index 34b7ed7bef..bfa882ebf7 100644
--- a/branches/sca-java-1.x/modules/binding-ws-wsdlgen/src/main/java/org/apache/tuscany/sca/binding/ws/wsdlgen/Interface2WSDLGenerator.java
+++ b/branches/sca-java-1.x/modules/binding-ws-wsdlgen/src/main/java/org/apache/tuscany/sca/binding/ws/wsdlgen/Interface2WSDLGenerator.java
@@ -687,6 +687,7 @@ public class Interface2WSDLGenerator {
// look for any imports of the no namespace schema
Document refSchema = xsDef.getDocument();
NodeList imports = refSchema.getElementsByTagNameNS("http://www.w3.org/2001/XMLSchema","import");
+ List<Node> importsToDelete = new ArrayList<Node>();
for (int j = 0; j < imports.getLength(); j++){
Element _import = (Element)imports.item(j);
@@ -695,13 +696,18 @@ public class Interface2WSDLGenerator {
if (_import.getAttributes().getLength() == 0){
if (xsDef.getNamespace().equals(defaultNamespace)){
// remove the import
- _import.getParentNode().removeChild(_import);
+ //_import.getParentNode().removeChild(_import);
+ importsToDelete.add(_import);
} else {
// update the import to refer to the default namespace
_import.setAttribute("namespace", defaultNamespace);
}
}
}
+
+ for (Node _import : importsToDelete){
+ _import.getParentNode().removeChild(_import);
+ }
// look for any type attributes that refer to the
// node being merged