Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Java by (4k points)

I'm searching the java library for parsing XML (complex configuration and data files), I googled a bit but couldn't found other than dom4j (Seems like they are working on V2).. I have taken look at commons configuration but didn't like it, Other apache projects on XML seems under hibernation. I haven't evaluated dom4j by myself but just wanted to know - Does java has other (Good) open source xml parsing libraries? and how's your experience with dom4j?

After the @Voo's answer let me ask another one - Should I use java's built-in classes or any third-party library like dom4j.. What are the advantages?

1 Answer

0 votes
by (46k points)

Java supports two methods for XML parsing out of the box.

SAXParser

You can use this parser if you want to parse large XML files and/or don't want to use a lot of memory.

http://download.oracle.com/javase/6/docs/api/javax/xml/parsers/SAXParserFactory.html

DOMParser

You can use this parser if you need to do XPath queries or need to have the complete DOM available.

http://download.oracle.com/javase/6/docs/api/javax/xml/parsers/DocumentBuilderFactory.html

Related questions

0 votes
1 answer
0 votes
1 answer
asked Nov 12, 2019 in Java by Anvi (10.2k points)
0 votes
1 answer
0 votes
1 answer
asked Jul 18, 2019 in Java by Shubham (3.9k points)
0 votes
1 answer

Browse Categories

...