Redundant or multiple xmlns attributes generated in XML instance documents on IBM JDK (Doc ID 1459269.1)

Last updated on FEBRUARY 24, 2017

Applies to:

Oracle WebLogic Server - Version 10.3.6 and later
IBM AIX on POWER Systems (64-bit)

Symptoms

Under certain circumstances when running with the IBM JDK, WebLogic may generate XML instance documents or document fragments that incorrectly have multiple xmlns attributes set for a given element, or may add redundant xmlns attributes to all elements in a document.  As an example, on deployment of a web service, schema data may be extracted from a WSDL and transformed into an XML document fragment.  This document fragment forms part of the overall service schema definition and may be used for SOAP payload schema validation if enabled.  If this schema document fragment contains multiple xmlns attribute definitions in a single element, the document is considered malformed, an exception is thrown, and the web service deployment will fail.  An example of an incorrectly formed element:

<schema xmlns="http://www.w3.org/2001/XMLSchema"  xmlns="http://www.w3.org/2001/XMLSchema"  xmlns:WL5G3N0="http://schemas.xmlsoap.org/wsdl/"  xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns=http://xxx.xxx.com/certification/schema  xmlns:xml="http://www.w3.org/XML/1998/namespace"  elementFormDefault="qualified"  targetNamespace="http://xxx.xxx.com/certification/schema">

Note the multiple xmlns attribute definitions (the xmlns attribute is used to define the document fragment's default namespace).

The exception will be in the form:

org.xml.sax.SAXParseException:Attribute "xmlns" bound to namespace "http://www.w3.org/2000/xmlns/" was already specified for element "schema".

The actual exception may vary in detail depending on the element involved.

 

Changes

 In WebLogic 10.3.4 and 10.3.5 on the IBM JDK platform the XML document TransformerFactory is set at runtime by the delegating instance WebLogicTransformerFactory to "com.ibm.xtq.xslt.jaxp.compiler.TransformerFactoryImpl".  On WebLogic 10.3.6 and later, WebLogicTransformerFactory no longer delegates specifically to "com.ibm.xtq.xslt.jaxp.compiler.TransformerFactoryImpl" but rather falls-back to "org.apache.xalan.processor.TransformerFactoryImpl".

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms