Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How I can transform XML to Java-tree-structure?

Tags:

java

xml

I would like to transform XML-document to java-tree-structure, but I do not know what is a java-tree-structure? For example, JTree or another? is it exists any library?

like image 390
Alexander Avatar asked Mar 22 '26 04:03

Alexander


2 Answers

You could use an XML DOM tree expressed in Java. An XML parser will give it to you straight away.

like image 96
duffymo Avatar answered Mar 24 '26 17:03

duffymo


If your XML conforms to a specific schema (and you have an XSD file for it), you can use JAXB to convert the XSD into a bunch of Java classes for conveniently manipulating the data.

like image 43
Chris Jester-Young Avatar answered Mar 24 '26 17:03

Chris Jester-Young



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!