Skip to Content
Former Member
Dec 19, 2007 at 09:37 PM

XML structure from Form Based Published Document


Hi experts,

I want to read the contents of a Form Based XML Document to my Web Dynpro project. I'm using this code to do so:




IWDClientUser wdClientUser = WDClientUser.getCurrentUser(); sapUser = wdClientUser.getSAPUser();

//create an ep5 user from the retrieved user ep5User = WPUMFactory.getUserFactory().getEP5User(sapUser);

IResourceContext context = new ResourceContext(ep5User);

/Specify the path of ur document here./

RID pathRID = RID.getRID(wdContext.currentTableContentElement().getLink());

IResource resource = ResourceFactory.getInstance().getResource(pathRID,context);

InputStream in;

in = resource.getContent().getInputStream();

ByteArrayOutputStream out = new ByteArrayOutputStream();

byte[] buffer = new byte[4096];

int bytesread = 0;

while ((bytesread = != -1) {

out.write(buffer, 0, bytesread);


String myData = out.toString();



The problem now is: When I'm reading the contents of a Form Based XML Document I'm getting HTML code from the document.

When I try to do the same with an XML document that wasn't created by a XML Form, I get the contents in default XML markup.

My question is: how can I get the Form Based XML Document to my Web Dynpro Project in default XML markup?


Edwin van der Palen