| [news.eclipse.tools.emf] Re: Extreme XML deserializing |
Gary,
Comments below.
A format that's not describable with a schema?Hi
could some one suggest where I might start in creating a an xml deserializer for a format that is completely foreign to emf?
I've not seen something that's so funky you couldn't write a schema for it.
Are there any example of this, if so where should I look?
That's where most of the deserialization work will be done. It's effectively just a SAX handler.
Will I need to replace the DefaultHandler in a subclass of XMLLoadImpl?
I'm pretty sure the support added in 2.4 for content types should suffice. You can look in the XMI plugin.xml's registrations for Ecore and EMOF content types as an example. This idea is basically to associate a content type with the namespace of the root element and then to register a content_parser against that content type. You'd still need to list which extensions to consider for content type matching if you use the Eclipse platform's content type registration mechanism. In any case, you should be able to accomplish anything by adding your own ContentHandler to the URIConverter's list of ContentHandlers.
Also the format I am reading doesn't use file extensions and starts with a directory as the root of the pseudo file. This doesn't seem to fit with how resource factories are registered and used will I need to override delegatedGetFactory() in a ResourceFactoryRegistryImpl?
once again as usual and in advance thanks for any help rendered!
regards gary