File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes XML and Related Technologies and the fly likes problems of a new bee 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 "problems of a new bee" Watch "problems of a new bee" New topic

problems of a new bee

vivek sivakumar
Ranch Hand

Joined: Aug 09, 2001
Posts: 187
i am new to xml . right now i have been told to write a java program to convert a PostScript file to a xml file ??? how can i do this pls supplenet with some idea or snippet...

SCJP, SCWD <br />A farmer learns more from a bad harvest than a good one.
Ajith Kallambella

Joined: Mar 17, 2000
Posts: 5782
First you will have to determine the element mapping. ie., the set of distinct postscript node types and the corresponding set of XML tags that you are goint to define. Lets call these sets as InputSet and XMLSet.
Once you have the mapping in place, you will then write a Java program to parse the postscript input file. Every time you find an element in the InputSet, simply pick the corresponding XML tag from the XMLSet, create a node with the tagnem using DOM and copy the contents of the input file as the content of the node. Repeat the process until you have consumed the entire input file.
Since you will be constructing a DOM tree from scratch as you parse the input file, you will have to learn how to use the DOM API.
Hope that helps!

Open Group Certified Distinguished IT Architect. Open Group Certified Master IT Architect. Sun Certified Architect (SCEA).
I agree. Here's the link:
subject: problems of a new bee
It's not a secret anymore!