Skip to Content
0
Dec 07, 2006 at 05:21 PM

Couldn't update the Content of xml docs created using XML form HTML editor

29 Views

Hi All,

I have some xml documents created using XML form builder HTML editor.

Now programatically when i try to update the contents of xml documents, the document is going blank. I wrote the following piece of code to update the content. Pls let me know if I am going wrong somewhere ans what is the workaround with sample code.

RID cntExpRid = RID.getRID("/documents//TestFolder/acbcd.xml");

IResource cntExpRsc = ResourceFactory.getInstance().getResource(cntExpRid, ctxt);

StringBuffer contBuff = new StringBuffer();

contBuff .append("Content expired"); contBuff.append("please update the content.");

ByteArrayInputStream is = new ByteArrayInputStream(contBuff.toString().getBytes("UTF-8"));

IContent newCont = new Content(is, "text/html", is.available());

cntExpRsc.updateContent(newCont);

Thanks in advance,

Siva