XML Data Objects (XDO)
This is a very fast parser, designed to address the limitations of the SAX and DOM technologies. The generation of XML content is also supported.
The "Schema Assisted" design makes use of schema information to allow the handing of new content without additional coding on your part. You can however construct additional bindings (teaching the parser how to produce explicit java beans).
XDO allows you to declare w/ Objects the Schema you are interested in, and how it should be parsed.
- reuse occurs on a schema by schema basis
- You can "generated" a schema explicitly out into code
- Code has been generated for GML2, WFS, and WMS
- Custom documents, based on an extention of a known schema can be parsed
- generated code also includes support for the production of XML documents.
- validation of content is supported
The exiciting thing here is that the technology works, is fast, and allows for GML to be used the way it is intended.
Code Example with FeatureType
XDO Parsers exist for all sorts of interesting content, GML2, WMS Capabilities documents etc. It was not in the scope of the uDig project to produce a Filter parser, so let me show you an example of parsing a Featuretype.
XMLReader reader = XMLReaderFactory.createXMLReader(); URI schemaLoc = new java.net.URI("http://giswebservices.massgis.state.ma.us/geoserver/wfs?request=describefeaturetype&service=wfs&version=1.0.0&typename=massgis:GISDATA.COUNTIES_POLY"); XSISAXHandler schemaHandler = new XSISAXHandler(schemaLoc); reader.setContentHandler(schemaHandler); reader.parse(new InputSource(new URL(schemaLoc.toString()).openConnection().getInputStream())); FeatureType ft = GMLComplexTypes.createFeatureType(schemaHandler.getSchema().getElements()[0]);