XML Parsing

Ok so I’m in a rut.
I’ve looked all over, and found tons of libraries included with JME3 for XML parsing, and yet it seems im the only person that has ever had trouble getting any of them to work.

I’m making an algorithm that procedurally generates buildings based on a set of rules and predefined tiles. The algorithm requires a blueprint(xml file) that defines the limitations to the footprint of the building. I also intend for the xml format to be flexible enough to allow for users to create their own blueprints.

The root of the document is “blueprint” with a required child “footprint” and optional children “floor”
floor and footprint are really the same thing, i just intend to reject a file if it doesn’t have a footprint child.
each floor has a “row” child which contains an id, and data element that my algorithm uses to continue on with its process.
essentially im defining a collection of 2-dimensional arrays in xml form for ease of customization.

A long time ago i used an xml parser that was fairly simple, had a sort of “get all tags by name” type of interface. it was very nice for small files like this, but its no longer supported. I was hoping to find one similar in the many xml parsers packaged with the engine, but they all are rather ambiguously documented or not documented at all.

I’m in the middle of implementing the load() on a custom AssetLoader, but now i need to actually parse the xml.
can someone point me on the right path?

If you just want to load an XML and interrogate it then why isn’t Java’s XML parsing enough? Load it into a DOM, run xpath expressions on it or whatever. (XPath support may require an additional library, I don’t remember… but it’s easy to directly interrogate a DOM.)

sigh

Ive been busting my head open trying to understand these other libraries that the basic java api completely slipped my mind…

Thanks

@stephanator said: *sigh*

Ive been busting my head open trying to understand these other libraries that the basic java api completely slipped my mind…

Thanks

It’s a big tool box. It’s understandable to forget about a drawer or two. :slight_smile: