Author: jason.greene(a)jboss.com
Date: 2006-11-23 02:06:55 -0500 (Thu, 23 Nov 2006)
New Revision: 1514
Modified:
trunk/src/main/java/org/jboss/ws/utils/DOMWriter.java
Log:
Merge fix for JBWS-1311
Modified: trunk/src/main/java/org/jboss/ws/utils/DOMWriter.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/utils/DOMWriter.java 2006-11-23 06:59:39 UTC (rev
1513)
+++ trunk/src/main/java/org/jboss/ws/utils/DOMWriter.java 2006-11-23 07:06:55 UTC (rev
1514)
@@ -72,6 +72,7 @@
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
+import org.jboss.logging.Logger;
/**
* Traverse a DOM tree in order to print a document that is parsed.
@@ -82,6 +83,7 @@
*/
public class DOMWriter
{
+ private static Logger log = Logger.getLogger(DOMWriter.class);
// Print writer
private PrintWriter out;
// True, if canonical output
@@ -291,13 +293,19 @@
{
String nsURI = getNamespaceURI(atPrefix, element, rootNode);
nsMap.put(atPrefix, nsURI);
-
// xsi:type='ns1:SubType', xsi:type='xsd:string'
- if (atName.equals(atPrefix + ":type") &&
nsURI.equals("http://www.w3.org/2001/XMLSchema-instance") &&
atValue.indexOf(":") > 0)
+ if (atName.equals(atPrefix + ":type") &&
atValue.indexOf(":") > 0)
{
- String typePrefix = atValue.substring(0,
atValue.indexOf(":"));
- String typeURI = getNamespaceURI(typePrefix, element, rootNode);
- nsMap.put(typePrefix, typeURI);
+ // xsi defined on the envelope
+ if (nsURI == null)
+ nsURI = getNamespaceURI(atPrefix, element, null);
+
+ if
("http://www.w3.org/2001/XMLSchema-instance".equals(nsURI))
+ {
+ String typePrefix = atValue.substring(0,
atValue.indexOf(":"));
+ String typeURI = getNamespaceURI(typePrefix, element, rootNode);
+ nsMap.put(typePrefix, typeURI);
+ }
}
}
@@ -576,4 +584,4 @@
}
return (str.toString());
}
-}
\ No newline at end of file
+}