tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rf...@apache.org
Subject svn commit: r451075 - /incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/resource/DataObjectXMLStreamReader.java
Date Fri, 29 Sep 2006 00:44:45 GMT
Author: rfeng
Date: Thu Sep 28 17:44:45 2006
New Revision: 451075

URL: http://svn.apache.org/viewvc?view=rev&rev=451075
Log:
Fix the missing xmlns for the value of xsi:type

Modified:
    incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/resource/DataObjectXMLStreamReader.java

Modified: incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/resource/DataObjectXMLStreamReader.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/resource/DataObjectXMLStreamReader.java?view=diff&rev=451075&r1=451074&r2=451075
==============================================================================
--- incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/resource/DataObjectXMLStreamReader.java
(original)
+++ incubator/tuscany/java/sdo/impl/src/main/java/org/apache/tuscany/sdo/util/resource/DataObjectXMLStreamReader.java
Thu Sep 28 17:44:45 2006
@@ -234,10 +234,16 @@
         if (rootElement != null) {
             Type modelType = rootElement.getType();
             if (type != modelType) {
-                QName realTypeName = namespaceContext.createQName(type.getURI(), xsdHelper.getLocalName(type));
-                String typeName = realTypeName.getPrefix() + ":" + realTypeName.getLocalPart();
-                NameValuePair pair = new NameValuePair(XSI_TYPE_QNAME, typeName);
-                attributeList.add(pair);
+                // FIXME: XSDHelper.getLocalName() for annoymous type returns null?
+                String typeName = xsdHelper.getLocalName(type);
+                if (typeName != null) {
+                    QName realTypeName = namespaceContext.createQName(type.getURI(), typeName);
+                    String typeQName = realTypeName.getPrefix() + ":" + realTypeName.getLocalPart();
+                    QName xmlns =
+                        new QName("http://www.w3.org/2000/xmlns/", realTypeName.getPrefix(),
"xmlns");
+                    attributeList.add(new NameValuePair(xmlns, realTypeName.getNamespaceURI()));
+                    attributeList.add(new NameValuePair(XSI_TYPE_QNAME, typeQName));
+                }
             }
         }
         



---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org


Mime
View raw message