aspose file tools
The moose likes XML and Related Technologies and the fly likes problems of a new bee Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Reply Bookmark "problems of a new bee" Watch "problems of a new bee" New topic
Author

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
Sheriff

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: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: problems of a new bee
 
Similar Threads
Converting XML to JavaBean
create DTD
XML generation for data in a table
Please Confirm a Very Simple XSD Created by Me
Adding lib jar files for a project in WSAD