cancel
Showing results for 
Search instead for 
Did you mean: 

XML file into String

Former Member
0 Kudos

Hello,

I want to convert total xml file into string in UDF, i am getting an error. can anybody tell me the solution. what is the wrong in bellow code.

String str =a+b;

String strLine;

StringBuffer sbr=new StringBuffer();

try{

FileInputStream fileInputStream = new FileInputStream(str);

DataInputStream dataInputStream = new DataInputStream(fileInputStream);

BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(dataInputStream));

while ((strLine = bufferedReader.readLine()) != null) {

sbr.append(strLine);

}

}

catch (Exception e){ e.printStackTrace(); }

return sbr.toString();}

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

San,

Did you check this Michal's blog of converting data into string....?? its done in very easy way...

/people/michal.krawczyk2/blog/2005/11/01/xi-xml-node-into-a-string-with-graphical-mapping

Hope this will help you.

Nilesh

Answers (4)

Answers (4)

ravi_raman2
Active Contributor
0 Kudos

Whats the error.......if you havent fixed it already.., you should be getting a NPE.

Regards

Ravi Raman

Former Member
0 Kudos

Hi San,

Please provide me the Error information and Input parameters you are passing to this as Value or Context or Queue??

Warm Regards,

Vijay

Former Member
0 Kudos

check this link

regards,

srinivas

<b>*reward for useful answers*</b>

Former Member
0 Kudos

hi,

what are you passing to UDF as input?

Regards,

Akshay Jamgaonkar.