aspose file tools*
The moose likes Java in General and the fly likes Parsing XML (using the jakarta commons digester) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Parsing XML (using the jakarta commons digester)" Watch "Parsing XML (using the jakarta commons digester)" New topic
Author

Parsing XML (using the jakarta commons digester)

Katrina Owen
Sheriff

Joined: Nov 03, 2006
Posts: 1347
    
  13
I've run into a snag with a file I am trying to parse.
The file has approximately 700 entries, most of which have the following structure:



Sometimes there will be multiple sections for a single root element, but overall, it follows that basic structure.

There is a small subset of these, approximately 30, that have an extra layer, like so:




For what I'm doing, I don't really need the distinguishing feature, I just want to get to the stuff it wraps.
Would it be completely off the mark to define an additional structure

in addition to the structure that is already defined,

and which works for most of the cases?

Or do I need to approach this in a conceptually different manner?
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Every time I've used that parser, I've made the Java Object model match the structure of the XML document.

I'm not sure what the easiest way to skip a level would be.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Parsing XML (using the jakarta commons digester)
 
Similar Threads
jakarta-tomcat-4.0.1 taglib problem
Database connectivity - Jboss server
ant problme
how to retrieve attribute value of a node
converting a nodelist to a string