on 05-01-2008 9:22 AM
Hi,
I want to read xml file in webdynpro. please let me know as where to place the file and how to read the file.
Thanks a lot in advance
regards,
Satish
Hi
You can use the code to read a file
The file have to be placed in J2EE server. The code will get the result in a string.
try{
FileInputStream instream;
String s = new DataInputStream( instream = new FileInputStream( <Filepath>)).readLine();
instream.close();
}catch( Exception e)
{}
To extract an XML content; go through this blog;
/people/sap.user72/blog/2006/05/04/enhancing-tables-in-webdynpro-java-150-custom-built-table-utilities
Regards
Vinod V
Edited by: Vinod V on May 1, 2008 4:22 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
chk this blog,m not sure if it help:
/people/community.user/blog/2006/10/18/how-to-parse-xml-file-uploaded-from-client
Regards
Priya
award point if helps
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You have to place the file where the server can access. You can read the file using java.io.File class
code:
File xmlFile = new File ("C\\sampledata.xml");
// where C: is in J2EE server itself
int length = (int) xmlFile.length();
try{
byte data[] = new byte[length]; //
FileInputStream stream = new FileInputStream(xmlFile);
stream.read(data);
stream.close();
}
catch(FileNotFoundException e){}
catch(IOException e){}
This will get you the xml file as binary
nikhiL
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
can someone help me in this regards, its urgent.
regards
Satish
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.