I have a file with the following representation:
Joe|Leduc|34 avenue|Montreal
need to take the file and transform is into XML like:
<record>
<fname>Joe</fname>
<lname>Leduc</lname>
<street>34 avenue</street>
<city>Montreal</city>
</record>
I would thank anyone in advance for any help or ideas? Thanks fellow programmers.
-
Need help with generating XML files (8 messages)
- Posted by: Web Master
- Posted on: August 21 2001 17:25 EDT
Threaded Messages (8)
- Need help with generating XML files by Chiew Lee on August 21 2001 17:50 EDT
- Need help with generating XML files by Web Master on August 21 2001 17:54 EDT
-
Need help with generating XML files by Chiew Lee on August 22 2001 02:57 EDT
- Need help with generating XML files by Web Master on August 22 2001 05:29 EDT
-
Need help with generating XML files by Chiew Lee on August 22 2001 02:57 EDT
- Need help with generating XML files by prabin mahapatra on August 22 2001 01:13 EDT
- Need help with generating XML files by Web Master on August 22 2001 09:41 EDT
- Need help with generating XML files by Web Master on August 21 2001 17:54 EDT
- Need help with generating XML files by Nicolas K on August 22 2001 10:10 EDT
- Need help with generating XML files by Web Master on August 22 2001 10:30 EDT
-
Need help with generating XML files[ Go to top ]
- Posted by: Chiew Lee
- Posted on: August 21 2001 17:50 EDT
- in response to Web Master
1. create a class say Person:
class Person {
String fname;
String lname;
String street;
String city;
}
2. parse the file and populates data read into a Person object.
3. pass this Person object to a XMLGenerator class which create an XML files.
4. The XMLGenerator class create the XML file using reflection. In that way, it supports any object that u pass to it.
i've a class that does something similar to XMLGenerator. it creates a DOM document instead of a XML file.
if u are interested, i can send u the src.
alex
-
Need help with generating XML files[ Go to top ]
- Posted by: Web Master
- Posted on: August 21 2001 17:54 EDT
- in response to Chiew Lee
please send it to me. I would really appreciate it.
I have another question, if I want to copy a file from a server locally. How do I do it? -
Need help with generating XML files[ Go to top ]
- Posted by: Chiew Lee
- Posted on: August 22 2001 14:57 EDT
- in response to Web Master
pl give me ur email addr.
alex -
Need help with generating XML files[ Go to top ]
- Posted by: Web Master
- Posted on: August 22 2001 17:29 EDT
- in response to Chiew Lee
My email is the following
rassaad at hotmail dot com
Anything to give me some help would do. Thanks. -
Need help with generating XML files[ Go to top ]
- Posted by: prabin mahapatra
- Posted on: August 22 2001 01:13 EDT
- in response to Chiew Lee
Can you send the document to me?
mail-id: prabinkumar dot mahapatra at in dot efunds dot com
Thanx.
Prabin -
Need help with generating XML files[ Go to top ]
- Posted by: Web Master
- Posted on: August 22 2001 09:41 EDT
- in response to prabin mahapatra
Take the previous example. I just need some help to start coding. Thanks. -
Need help with generating XML files[ Go to top ]
- Posted by: Nicolas K
- Posted on: August 22 2001 10:10 EDT
- in response to Web Master
For creating your file, you can also use the following UNIX shell script line :
cat yourfile|sed '/|/s//<\/fname><lname>/' | sed '/|/s//<\/lname><street>/'|sed '/|/<\/street><city>/'|awk '{print "<record><fname>" $0 "</city></record>"}
It's quick and easy isn't it ? -
Need help with generating XML files[ Go to top ]
- Posted by: Web Master
- Posted on: August 22 2001 10:30 EDT
- in response to Nicolas K
Thanks for your help. But I need to do it in a Java Application.