Hello. I have Java knowledge and I need to extract information from a .xml file. I thought I could create my custom program to do what I need. I've been reading around on the internet examples about how to do it in Java. But there are many different parsers classes and the usage is different. I've seen examples but I'm getting confused. If anyone have a java xml parser coded, that I could use, it would ease the trouble... I'd just have to shape it to my needs. I'd be happy with a program that would read all the XML fields and load them into some structure, like a Vector. Anyone?
If you don't need to handle large XML files, look at DOM parsers. JDOM or DOM4J. If you need to have great performance, use StAX parsers.
I have used JAXB in the past. You could always input the file using FileInputStream and then parse it line by line. I've done it in the past, but it's better to use JAXB or another parser to do it.
I think that parsing method depends on performed task. In one cases it will be better to use JAXB or JiBX, in another tasks it will be better to parse it by hand using DOM or SAX.