« Oracle Apps Adapter Runtime Configurations using a non APPS Schema | Main

Unwanted xmlns="" empty namespace attribute

Recently I faced a problem when  using  processXSLT Transform step.  The transform step produced  tags with xmlns=""  at few places.

For eg:

<ns1:ParentTag xmlns="http://mynamespace.com/parent">

<MyCRMHeader xmlns=""> ....</MyCRMHeader>

</ns1:ParentTag>

Due to this the receiving side application was unable to process the specific tags that had this empty namespace.

xmlns=""  indicates that a particular element is not included in a parent tag's  namespace and without this empty xmlns="", i.a., the element would be in the same namespace as its parent. 

The big question though - Why did my XSL produce tags that had these tags? Did I deliberately format tags that didn't belong to a specific namespace.

Probably yes. My XSLT had a namespace string passed as a parameter and substituted as a value dynamically.  Ideally declaring this along with other namespace declarations to the xsl:stylesheet or xsl:transform element may have helped me avoid the situation, but that was not a choice.

As a fix I've explicitly output the namespace uri attribute in the XSLT on the tags, which were emitted with an empty xmlns="" attribute.

<!--My XSLT File ->

<xsl:template match="/">

...

<ns1:PatentTag>

....

<MyCRMHeader xmlns=http://www.siebel.com/module/ns/input/01>

<xsl:value-of ..../>

</MyCRMHeader>

</ns1:PatentTag>

</xsl:template>

This helped me in getting rid of the empty namespace.

<ns1:ParentTag xmlns="http://mynamespace.com/parent">

<MyCRMHeader> ....</MyCRMHeader>

</ns1:ParentTag>

TrackBack

TrackBack URL for this entry:
http://blogs.oracle.com/mt/mt-tb.cgi/16692

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)

About This Entry

This page contains a single entry from the blog posted on March 4, 2010 2:59 PM.

The previous post in this blog was Oracle Apps Adapter Runtime Configurations using a non APPS Schema.

Many more can be found on the main index page or by looking through the archives.

Top Tags

Powered by
Movable Type and Oracle