Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problems of a new bee

 
vivek sivakumar
Ranch Hand
Posts: 187
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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...
 
Ajith Kallambella
Sheriff
Posts: 5782
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic