Skip to Content
0
Former Member
May 17, 2005 at 11:20 AM

Read XML Form source

18 Views

Hello all,

I'm trying to programaticaly read the contents of an XML Form. I get my resource, grab it's content, get an input stream and start reading. The problem is that instead of a simple XML file being read, what comes back is an entire HTML page with all the layout for the list viewer form, not the XML source.

The code that I'm using is below, I know that it's bad but this is just a test program so it doesn't matter.

StringBuffer sb = new StringBuffer();
IResource res = ....;// Here I get my resource
try{
  IContent con = res.getContent();
  try{
    InputStream is = con.getInputStream();
    int c;
    while((c = is.read())!=-1){
      sb.append((char)c);
    }
    scrollingText = addToText(scrollingText, sb.toString()+"<br>");
  }catch(ContentException e){
  }catch(IOException e){
  }
}catch(ResourceException rE){
}

So is it possible to access the XML source so that I can read values of specific elements? How?

Regards,

Patrick.