How can I control XML parsing in Java (using JDOM)?

I am developing an application that parses large XML files (more than 200 thousand lines, about 4-5 MB), and I would like to track parsing using a progress bar. I am using JDOM v1.1.1 and SaxBuilder.

Does anyone know how to achieve this?

thank

+3
source share
1 answer

You could, I suppose, subclass org.jdom.DefaultJDOMFactory, and override some of the tracking methods when creating specific nodes. You can then pass the object of this subclass to SAXBuilder.setFactory.

It is up to you to decide what “progress” is, although you can only decide based on the XML structure.

+2
source

All Articles