File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes XML and Related Technologies and the fly likes Load Employee data from text file and convert it to XML and JSON 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 "Load Employee data from text file and convert it to XML and JSON " Watch "Load Employee data from text file and convert it to XML and JSON " New topic
Author

Load Employee data from text file and convert it to XML and JSON

Alvaro San Millan
Ranch Hand

Joined: Mar 31, 2011
Posts: 36
Hello everyone,

I have to load information from an Employee contained in a text file (one field per line), and convert it to a XML or JSON representation MATCHING a schema provided. And this last part it's what I am not sure. I know to load the data, and convert it to XML and also to convert from XML to JSON using XSLT, but how about to matching the schema?

Thanks in advance


OCPJP 6 98%
Jimmy Clark
Ranch Hand

Joined: Apr 16, 2008
Posts: 2187
Depending upon the complexity and size of the XML Schema, this can be relatively very easy or very difficult. You first should analyze the XML Schema and the requirements for the actual XML document that you need to create. Once you cleary understand the XML document structure that is required, you then would check to see if it is valid according to the provided XML Schema. If it is, then you are ready to write code.

When you write the code to create the XML document, you need to write the code to produce the XML document correctly, i.e. a valid XML document that will conform to the rules in the XML Schema. The one check that you should implement is once [the code] has created the document, [the code] should validate against the XML schema to ensure that the document is valid and has been created correctly.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Load Employee data from text file and convert it to XML and JSON