Skip to Content
Former Member
Apr 29, 2014 at 11:17 AM

Namespace tag change in receiver file adapter


Hi Group,

My requirement: Need to change the Namespace tag at the receiver side.

My XML will be something like below:

<?xml version="1.0" encoding="UTF-8"?>

<ns0:ASNList xmlns:ns0="">




<TimeUTC>10:00:00 IST</TimeUTC>






I need to transform the message like below;

<?xml version="1.0" encoding="UTF-8"?>

<n1:ASNList xsi:schemaLocation=" SXI.GLS.ASN.xsd" xmlns:n1="" xmlns:xsi="">










I have tried to achieve by writing a UDF, all seems to be fine but the "XML is not well-formed". Below is my UDF code:

public String setNSDeclarations(String a,String b,String c,Container container){

StructureNode node = ((StructureNode) container.getParameter("STRUCTURE_NODE"));

node.setNSDeclarations(" xmlns:" + c + "=" + b);

node.setQName(a + "ASNLIST");

return "";

Please suggest if there is any other way to achieve this requirement.