Skip to Main Content

Integration

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Convert string into xml format

852806Jul 28 2011 — edited Jul 28 2011
Hi All,

I am receiving the xml input to my bpel in the form of string.

I am converting that string input into xml format using the following code inside java embedding.

try
{
String input = (String)getVariableData("*xmlData*");
String root;
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
DocumentBuilder db = dbf.newDocumentBuilder();
InputSource is = new InputSource();
is.setCharacterStream(new StringReader(input));
Document doc = db.parse(is);

root=doc.getDocumentElement().toString();
setVariableData("RootElement",root);
}
catch(Exception e)
{
setVariableData("RootElement",e.toString());
}


I also tried printing doc.toString (by assigning it to some variable. but i couldnt get the output as the document. I guess, there is some error in the conversion of the string to the xml document.

Kindly help me in this regard.

Thanks,
Sabarisri. N
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 25 2011
Added on Jul 28 2011
4 comments
598 views