devsource360

Unwanted xmlns="" empty namespace attribute

This item was filled under [ MISC. ]


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>






Rate this topic:
1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...
Popularity: 169 views
You can follow any responses to this entry through the RSS 2.0 feed. Responses are currently closed, but you can trackback from your own site.


Unwanted xmlns="" empty namespace attribute Copyright: You should confirm all information about Unwanted xmlns="" empty namespace attribute full version edition(freeware/shareware) before downloading or relying on it. Software piracy is theft, Using crack, password, serial numbers, registration codes, key generators or key gen, cd key, hacks, dvd rip is illegal and prevent future development of Unwanted xmlns="" empty namespace attribute full version edition. Download links are directly from our publisher sites or from the link provided by users, torrent files or links from rapidshare.com, yousendit.com, megaupload.com, netload.in, storage.to or depositfiles.com are not allowed.