Not too complicated. All I had to do was:
- Convert the xml files to Java objects.
- Write some code to perform a calculation on said objects.
I hadn't actually tried this before but I challenged myself to do this (at least the boilerplate of point 1) in 2 lines of code. Here's how I did it:
Step 1 - Create a Java data model
I created a project in IntelliJ and dropped my xsd document in a resources directory.
I then highlighted the xsd file and clicked Tools->JAXB->Generate Java Code
I was presented with a dialogue box as below
Click OK and hey presto your whole data model has been created into Java objects.
Step 2 - Deserialise the xml file into Java Objects
//line 1 create an Unmarshaller for the object type you are reading from the xml file
Unmarshaller um = JAXBContext.newInstance(DataObject.class).createUnmarshaller();
//line 2 deserialise the xml file into a java object
DataObject dataOject = (DataObject)um.unmarshal(new FileReader("DataObject.xml"));
//now run the calculation on dataObject
So that's it - only took 2 lines!
great
ReplyDeletenice
ReplyDeleteNeeded to compose you a very little word to thank you yet again regarding the nice suggestions you’ve contributed here.
ReplyDeleteJava Training in Bangalore
This comment has been removed by the author.
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteThose guidelines additionally worked to become a good way to
ReplyDeleterecognize that other people online have the identical fervor like mine
to grasp great deal more around this condition.
java Training in Bangalore
I and my friends were going through the nice, helpful tips from the blog then the sudden came up with an awful suspicion I never expressed respect to the website owner for those secrets.
ReplyDeleteDevops Training in Bangalore
I really enjoyed while reading your article, the information you have delivered in this post was damn good. Keep sharing your post with efficient news.
ReplyDeleteME/M.Tech Project Center in Chennai | ME/M.Tech Project Center in Velachery
Best Online Software Training Institute | DevOps Training
ReplyDeleteyou have done a good task buddy. just keep posting thi type of articles here. or if want to learn DevOps TRaining in Gurgaon then visit us.
ReplyDeleteThose guidelines additionally worked to become a good way to recognize that other people online have the identical fervor like mine to grasp great deal more around this condition.
ReplyDeletesafety course in chennai
Amazing blog about the various informative information on the programming languages... Java Training in Chennai | Python Training in Chennai
ReplyDeleteThanks! For sharing your views regarding this topic. I really enjoyed your post.
ReplyDeletejava/j2ee classes Bangalore | java Training Center Bangalore | Best Core Java Training in Bangalore | java Course in Bangalore | Best Java Training Institute Bangalore Marathahalli | Core and Advanced Java Institute Marathahalli | Java Training Institute in Bangalore Marathahalli | Advanced java Training in Bangalore | Java Technologies for web applications | Java Training in Bangalore
Hello,
ReplyDeleteThank You Rational Java for the post update regularly. KernelTraining is one of the leading DevOps training institutes. Recently i completed my software course in KernelTraining, good Institute where you can get good knowledge by real-time experts. I would strongly recommend KernelTraining. for more details please go through the link: DevOps Training In Hyderabad
well! Thanks for providing a good stuff related to DevOps Explination is good, nice Article.
ReplyDeleteDevOps Online Training
Well said!! much impressed by reading your article. Keep writing more.
ReplyDeletePHP Training in Chennai
DOT NET Training in Chennai
Big Data Training in Chennai
Hadoop Training in Chennai
Android Training in Chennai
Selenium Training in Chennai
Digital Marketing Course in Chennai
JAVA Training in Chennai
Java training institute in chennai
Thanks for the info on Rational Java JAXB - XML to Java in 2 lines of Code!
ReplyDeleteDevOps Training
Useful post admin, your blog has lots of information about Java. Keep sharing.
ReplyDeletePython Training in Chennai
Python Classes in Chennai
ccna course in Chennai
AWS Training in Chennai
DevOps Training in Chennai
Angularjs Training in Chennai
RPA Training in Chennai
UiPath Training in Chennai
Blue Prism Training in Chennai
Very impressive to read
ReplyDeleteblue prism training course in chennai
This was an excellent post. This blog was really comprehensive and helpful to me. Thanks for sharing.
ReplyDeleteSpoken English Classes in Chennai
Spoken English in Chennai
IELTS Coaching in Chennai
IELTS Coaching Centre in Chennai
IELTS Training in Chennai
Best IELTS Coaching in Chennai
IELTS Classes in Chennai
English Speaking Classes in Mumbai
Spoken English Classes in Anna Nagar
Thank you for sharing wonderful information with us to get some idea about jaxb to xml content. check it once through Devops Training | DevOps Training in Hyderabad | DevOps Online Course
ReplyDeleteVery Nice article, Thanks For Sharing
ReplyDeleteHere a related Stuff:
Power Bi Training In Hyderabad
Power Bi Online Training
its really awesome post..Thanks for sharing ..
ReplyDeletePython training in Chennai/
Python training in OMR/
Python training in Velachery/
Python certification training in Chennai/
Python training fees in Chennai/
Python training with placement in Chennai/
Python training in Chennai with Placement/
Python course in Chennai/
Python Certification course in Chennai/
Python online training in Chennai/
Python training in Chennai Quora/
Best Python Training in Chennai/
Best Python training in OMR/
Best Python training in Velachery/
Best Python course in Chennai/
Excellent post...! It is very helpful for developing my knowledge and Keep it up...
ReplyDeleteUnix Training in Chennai
Unix Certification in Chennai
Oracle DBA Training in Chennai
Social Media Marketing Courses in Chennai
Pega Training in Chennai
Tableau Training in Chennai
Spark Training in Chennai
Linux Training in Chennai
Primavera Training in Chennai
Power BI Training in Chennai
Your info is really amazing with impressive content..Excellent blog with informative concept. Really I feel happy to see this useful blog, Thanks for sharing such a nice blog..
ReplyDeleteIf you are looking for any Data science Related information please visit our website Data Science Course In Bangalore page!
Such a great blog. I Got Lots of informations about this technology.Keep update like this....
ReplyDeleteBest IELTS Coaching in Bangalore
IELTS Training in Bangalore
IELTS Coaching centre in Chennai
IELTS Training in Chennai
IELTS Coaching in Bangalore
IELTS Coaching centre in coimbatore
IELTS Coaching in madurai
IELTS Coaching in Hyderabad
Selenium Training in Chennai
Ethical hacking course in bangalore
There's definately a great deal to find out about this subject. I like all the points you made. oneplus 7 pro display replacement bangalore You made some good points there. I looked on the net to learn more about the issue and found most people will go along with your views on this web site. vivo V17 pro display replacement marathahalli
ReplyDeleteHowdy! This article couldn’t be written any better! Looking at this article reminds me of my previous roommate! He constantly kept talking about this. I am going to send this article to him. Pretty sure he's going to have a very good read. I appreciate you for sharing! iphone 11 pro display replacement marathahalli Greetings, There's no doubt that your website may be having web browser compatibility problems. When I take a look at your website in Safari, it looks fine however, when opening in I.E., it has some overlapping issues. I just wanted to provide you with a quick heads up! Other than that, fantastic website! samsung M30s display replacement
ReplyDeleteYour style is unique in comparison to other people I've read stuff from. I appreciate you for posting when you have the opportunity, Guess I'll just bookmark this site. redmi note 8 pro display replacement bangalore I was able to find good information from your content. realme x display replacement
ReplyDeleteThanks for sharing such valuable blog post, thanks again.
ReplyDeleteca coaching in delhi
banking coaching in delhi
cat coaching in delhi
gate coaching in delhi
dance classes in delhi
ReplyDeleteThanks for this wonderful blog it is really informative to all.keep update more information about this
Selenium Training in Chennai
Selenium Training in Bangalore
Selenium Training in Coimbatore
Best Selenium Training in Bangalore
Selenium Course in Bangalore
Selenium Training Institute in Bangalore
selenium training in marathahalli
Software Testing Course in Chennai
Hacking Course in Bangalore
It is an excellent blog. Your post is very good and unique. I eagerly waiting for your new post. Thanks for sharing keep sharing more good blogs.
ReplyDeleteDOT NET Training in Bangalore
DOT NET Training in Chennai
DOT NET Training Institutes in Bangalore
DOT NET Course in Bangalore
Best DOT NET Training Institutes in Bangalore
DOT NET Institute in Bangalore
AWS Training in Bangalore
Data Science Courses in Bangalore
DevOps Training in Bangalore
PHP Training in Bangalore
Thanks for sharing this amazing blog post. keep posting.
ReplyDeleteDigital Marketing Course in GTB Nagar
Digital Marketing Course Janakpuri
ReplyDeleteExcellent post and it is really useful for most of the freshers.
Node JS Training in Chennai
Node JS Advanced Training
IELTS Training in Chennai
Japanese Language Course in Chennai
TOEFL Training in Chennai
spoken english coaching centre in chennai
best spoken english in chennai
French Language Classes in Chennai
content writing course in chennai
spanish coaching in chennai
Node JS Training in Adyar
Node JS Training in Anna Nagar
It's a very awesome article! Thanks a lot for sharing information.
ReplyDeleteSelenium Training Institute in Bangalore
angularjs training in marathahalli
python course in hyderabad
Software Testing Course in Chennai
web designing course in coimbatore
Web Development courses in bangalore
Web Designing Course in bangalore
web designing course in madurai
Web development training in bangalore
Python Training in Bangalore
angularjs training in marathahalli
This is really very nice post you shared, i like the post, thanks for sharing DevOps Training in Chennai | DevOps Training in anna nagar | DevOps Training in omr | DevOps Training in porur | DevOps Training in tambaram | DevOps Training in velachery
ReplyDeleteNice blog.Thank you for this valuable information.
ReplyDeleteAngular JS Training in Chennai | Certification | Online Training Course | Angular JS Training in Bangalore | Certification | Online Training Course | Angular JS Training in Hyderabad | Certification | Online Training Course | Angular JS Training in Coimbatore | Certification | Online Training Course | Angular JS Training | Certification | Angular JS Online Training Course
Learned a lot of new things in this post. Thanks for taking the time to share this blog..
ReplyDeletecloud computing skills
scope of automation
google digital marketing coursegoogle digital marketing certification
technical skills required for cloud computing
I really enjoyed reading your blog. Great blog
ReplyDeletecommon errors
artificial intelligence future scope
angularjs charts
benefits of rpa
angularjs interview questions and answers for experienced
Thank you for sharing the article. The data that you provided in the blog is informative and effective.
ReplyDeletePostgreSQL Training
Nice article. Thank you for sharing devops online training
ReplyDeleteUseful post power bi training
ReplyDeleteSalesforce communities have an important role in improving the connection among the customers, channel partners and internal employees of a company. lightning interview questions 2021
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteThanks for the valuable information shared here, Keep sharing https://powerbipros.in/
ReplyDeleteThank you for sharing such a nice information. iFuture Technologies Private Limited is computer courses in thane & Kalyan
ReplyDeletesuperb post.
ReplyDeleteJava course in Pune