Meaningless Drivel is fun!*
The moose likes XML and Related Technologies and the fly likes Need a Help! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Need a Help!" Watch "Need a Help!" New topic
Author

Need a Help!

Ahamed Ali
Greenhorn

Joined: Apr 21, 2005
Posts: 19
Hi Everyone,

I need some help to complete this following task.

The Systems output data in a speciafied CSV format. This CSV is transformed into XML and sent over a network to other machines. When received at the other end, this XML is reverse transformed back to CSV.

I hope someone could helpme out the following:

- Which technologies would be best suitable for this task to complete.
- Is there any sample implementaion examples from CSV to XML to CSV or
similar.

Finally, I am expecting help and hints from experts.

Thanks in advance


Ahamed Ali
Balaji Loganathan
author and deputy
Bartender

Joined: Jul 13, 2001
Posts: 3150
Originally posted by Ahamed Ali:
- Is there any sample implementaion examples from CSV to XML to CSV or
similar.

To answer your above question... look at theJakarta POI.
To answer your other question, we need more info(scope) about requirements, if its all about exchanging xml docs between one to other systems(different domains) using Java, then SOAP would be an option. Also have a look at Javascript AJAX techniques.
Ahamed Ali
Greenhorn

Joined: Apr 21, 2005
Posts: 19
Hi Balaji,

Thanks for your help.

The requirements of the task is: (Overall Aim)

Be able to store and supply multiple transformations. In the future
we wish to transform from one type of data to another. Examples could be CSV, XML, HTML, plain text or MPEG-II. We would like to be
able to plug in new transforms at any time and the system to be able to use these without any recompilation.

Now I got the CSV document and the transformed XML document, and my work is write the code against to that files.

It would be very greatful, if you could provide me some help, and which tools and technologies would be suitable to write code.

Thanks in advance.


Ahamed Ali
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12682
    
    5
In the future we wish to transform from one type of data to another. Examples could be CSV, XML, HTML, plain text or MPEG-II. We would like to be
able to plug in new transforms at any time and the system to be able to use these without any recompilation.

An ambitious goal but obviously of great utility if you can pull it off.
I have done this sort of thing in a restricted environment - there is alot of timesaving possible if you build a framework that can provide common functions. In my example, I use:
1. common input file select dialog
2. common output file creation dialog
3. a transformation selection listbox that draws from an XML description of available transformations.

All transforming classes implement a simple Transform interface and are configured by the appropriate elements in the XML. That lets you use one list of transformations with a huge variety of configuration details.

Bill


Java Resources at www.wbrogden.com
Ahamed Ali
Greenhorn

Joined: Apr 21, 2005
Posts: 19
Hi Bill,

thanks for your message. I am planning to go with JAXP, using JAXP transform CSV files to XML in DOM, then transform XML to CSV file usig XSLT otherwise using Java and SOAP exchange messages.

I would like to know, it would be possible to go with Java and SOAP to transform CSV to XML and reverse transform to CSV file from XML.

It would be very greatful, if you could give me some suggesstions to go with or your openions to go with for writing the code.

Which technologies and tools, I should prefer for implementation of this task?

Thanks in advanced


Ahamed
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12682
    
    5
I think SOAP has a lot of excess baggage and you will probably find it easier to use XSLT or plain Java. Any data that is representable as CSV is probably pretty "flat" as an XML document so you could skip the DOM stage and just write XML with print statements as you parse the CSV with something like StringTokenizer or StreamTokenizer.

If each "line" of CSV values is independent of other lines, you could probably parse the XML document with SAX and write CSV directly from the SAX event handler methods. Much simpler and faster and uses much less memory.
Bill
Ahamed Ali
Greenhorn

Joined: Apr 21, 2005
Posts: 19
thanks Bill for your help.

I am going to study about SAX, and it would be very greatful, if you could provide sample implementation examples, where I can get some more helpful about the technologies.

thanks in advance.

Ahamed
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12682
    
    5
There are MANY xml tutorials on the web. This is the SAX tutorial at Sun.
After you have gone through the tutorial and tried some examples this is a great place to ask for clarification.
Bill
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Need a Help!
 
Similar Threads
create xml from xml schema in java
Hi Need a Help!!
read large CSV file and update the database
StringTokenizer to read CSV file
MYSQL IMPORT