I want to use XML to store data for an assignment . In this Java assignment I'll get data from the user in form of lines in a file below
INSERT INTO student(id,name,family,isMale) VALUES (10,null,”Maryam”, “Hasani”, false) CREATE TABLE student(id:integer, gpa:decimal, name:string, family:string,isMale:Boolean) INSERT INTO student(id,gpa,name,family,isMale) VALUES (50,”Ali”, “Hasani”, true) SELECT id, name FROM student WHERE id=0 so on ..
and after reading the file and processing them ,the program will generate logs about the outcome of the input files .like examples below:
ERROR: Invalid data type for value of column family ERROR: Invalid table name st
my question is about the processing data and storing them. I shouldn't use the usual tools for database like sql as the assignment wants me to somehow do what sql does without sql. I've chosen XML for this job so after reading the input ;program will parse the data of each line using regex and then store the data in a third file (between output and input files) using XML to have a more organized data.
<student id = "1" > <active>True</active> <gpa> 12 </gpa> <name> ali </name> <family>alavi</name> <isMale>True</isMale> </student>
is XML a good choice for what I want?
if it is what parts of XML should I learn for this task as there seems to be a lot to learn?
what things should I note in working with XML and coding the program working with XML file ?
if XML is not suited for this task what are the alternatives ?especially the ones who are easier to learn and work with for someone like me(look at p.s).
p.s:I'm quite new to java and programming as whole