geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jgenen...@apache.org
Subject svn commit: r512529 - /geronimo/server/trunk/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/AbstractNamingBuilder.java
Date Wed, 28 Feb 2007 00:45:07 GMT
Author: jgenender
Date: Tue Feb 27 16:45:06 2007
New Revision: 512529

URL: http://svn.apache.org/viewvc?view=rev&rev=512529
Log:
Copy namespaces to xml fragment when creating a copy of an xmlbeans object

Modified:
    geronimo/server/trunk/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/AbstractNamingBuilder.java

Modified: geronimo/server/trunk/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/AbstractNamingBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/AbstractNamingBuilder.java?view=diff&rev=512529&r1=512528&r2=512529
==============================================================================
--- geronimo/server/trunk/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/AbstractNamingBuilder.java
(original)
+++ geronimo/server/trunk/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/AbstractNamingBuilder.java
Tue Feb 27 16:45:06 2007
@@ -183,7 +183,25 @@
     }
 
     protected static XmlObject convert(XmlObject xmlObject, NamespaceElementConverter converter,
SchemaType type) throws DeploymentException {
+        Map ns = new HashMap();
+        XmlCursor cursor = xmlObject.newCursor();
+        try {
+            cursor.getAllNamespaces(ns);
+        } finally {
+            cursor.dispose();
+        }
         xmlObject = xmlObject.copy();
+        cursor = xmlObject.newCursor();
+        cursor.toNextToken();
+        try {
+            for (Object o : ns.entrySet()) {
+                Map.Entry entry = (Map.Entry) o;
+                cursor.insertNamespace((String) entry.getKey(), (String) entry.getValue());
+            }
+        } finally {
+            cursor.dispose();
+        }
+
         if (xmlObject.schemaType() != type) {
             converter.convertElement(xmlObject);
             xmlObject = xmlObject.changeType(type);



Mime
View raw message