Reference no: EM132654365
Write a program that parses a given XML document in a file (in next page) using any existing XML parser that supports DOM to do the followings:
a) Extract data from the document and
b) Transforms the data into structured text files in CSV/TBS and/or into tables in a SQL database.
For this task,
1) Check the links given above to learn about DOM and an existing XML parser (ex: DOM parse, MSXML parser, or SAX Parser)
1) Download any available XML parser that supports DOM library (ex: DOM/MSXML into VS or DOM/SAX Parser for Java) to set up
2) Write a program that loads the given XML documents in a file (in next page) as input and parses to extract terminal data to write into an output file.
3) Write Stored Procedures to read data from the files and then store them in the tables in database
4) For this task, you need to have a mapping strategy to carry the relationships in XML to write data into the output files then store them into tables
Use the following XML document as an input file. Assume that you have <bibs> as a root element and you can assume you have a root in the input file as you need.
Automatic database table creation in a SQL Server in your program using JDBC/ODBC is recommended.
This lab is to learn how to handle a multivalued columns, nested and irregular data in semi-structured data to transform them to a correct relational database scheme, which is a common task in real life applications.
There are many ways to transform XML to Table structures. You are to design a correct database scheme to convert the XML data to table structures.
Two common ways could be:
I. One Way:
1) Create a big dirty table in CSV in your program and
2) Create multiple tables in correct scheme reading from the big table in a Stored Procedure in a SQL Server.
II. Another Way
1) Design a scheme (multiple CSV file formats) and create multiple CSV files in your program and
2) Create database tables directly from each CSV in a Stored Procedure in a SQL Server.
Design your CSV file formats. There is no one strict file format as a solution. Think about what would be a good database scheme (structure) to transform those irregular multi valued data or nested data to a table (or connected multiple tables) so that you can retrieve them from a database easily and efficiently without losing information. As long as it is transformed to a correct database scheme without losing data, it would be good for this lab.
Attachment:- LAB-4.rar