You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commons-dev@ws.apache.org by ve...@apache.org on 2008/12/07 23:05:12 UTC
svn commit: r724214 -
/webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/util/OMSerializerUtil.java
Author: veithen
Date: Sun Dec 7 14:05:12 2008
New Revision: 724214
URL: http://svn.apache.org/viewvc?rev=724214&view=rev
Log:
WSCOMMONS-281: Avoid explicit declarations of xmlns:xml.
Modified:
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/util/OMSerializerUtil.java
Modified: webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/util/OMSerializerUtil.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/util/OMSerializerUtil.java?rev=724214&r1=724213&r2=724214&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/util/OMSerializerUtil.java (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/util/OMSerializerUtil.java Sun Dec 7 14:05:12 2008
@@ -684,6 +684,13 @@
public static boolean isAssociated(String prefix, String namespace, XMLStreamWriter writer)
throws XMLStreamException {
+ // The "xml" prefix is always (implicitly) associated. Returning true here makes sure that
+ // we never write a declaration for the xml namespace. See WSCOMMONS-281 for a discussion
+ // of this issue.
+ if ("xml".equals(prefix)) {
+ return true;
+ }
+
// NOTE: Calling getNamespaceContext() on many XMLStreamWriter implementations is expensive.
// Please use other writer methods first.