0

I have an file which contain XML tags and the name of the file is abc.xml,I just want to know which is the best IO technique that I should use to read that xml file means memory mapped IO , buffered reader and which one is fastest to read xml file through a java program.

2 Answers 2

1

There are two main schools of parsing XML files: using SAX and JAXP. SAX is a stream oriented parsing technique. It means that you read a file tag after tag and can't go backward. It's quite simple and fast but using it to realize more advanced tasks might be difficult. JAXP on the other hand represents the document as an object tree (DOM structure). It's slower and needs more memory but it's often easier to use in complex manipulation of XML files. Knowing both techniques is the software-engineer's 'must know'.

Sign up to request clarification or add additional context in comments.

2 Comments

it's SAX and DOM, not SAX and JAXP. JAXP includes both SAX and DOM (and others). en.wikipedia.org/wiki/Java_API_for_XML_Processing
JAXP is not DOM. JAXP is a set of API that provides parsers supporting both SAX and DOM.
0

If its XML file that you want to read quick and dirty....here are the options...

DOM Parser

SAX Parser

Pull Parser

JAXP & JAXB

CASTOR

Frankly i have not used Memory mapped IO, but have been working with Buffered Reader for the same purpose with no probs....

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.