Skip to Content
avatar image
Former Member

Reading a XML file

Hello,

i need to read a XML from an iView (JSP page) which lays somewhere on a/the server. (http://xyz.abc.com/test.xml). Is there any API available to do this? JDOM maybe?

regards,

Markus

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

2 Answers

  • May 25, 2006 at 09:54 AM

    Hi Markus,

    Have you read this documentation about XML in the portal? Does it address any of your needs?

    http://help.sap.com/saphelp_nw04/helpdata/en/42/930690a5051d6be10000000a1553f6/frameset.htm

    Daniel

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hello,

      yes the idea of a content provider goes in the right direction.

      I was wondering, doesnt have the lib com.tssap.libs.xmltoolkit/lib/sapxmltoolkit.jar anything i need? Anyone has used this lib already?

      regards,

      Markus

  • avatar image
    Former Member
    May 25, 2006 at 01:43 PM

    This code below reads XML from an RSS link.

    import java.io.BufferedInputStream;

    import java.io.BufferedReader;

    import java.io.File;

    import java.io.InputStreamReader;

    import java.net.URL;

    BufferedReader reader = null;

    try {

    URL url = new URL("<put RSS newsfeed link here>");

    reader = new BufferedReader(new InputStreamReader( new BufferedInputStream(url.openStream())));

    StringBuffer buff = new StringBuffer();

    for (int i = reader.read(); i != -1; i = reader.read())

    {

    buff.append((char) i);

    }

    reader.close();

    Its a snip from a program that displays a scrolling RSS news feed, but should give you an idea of how to read in some XML.

    Regards,

    Tom

    Add comment
    10|10000 characters needed characters exceeded