[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.tools.emf] Re: Extreme XML deserializing

Gary,

Comments below.


gary thompson wrote:
Hi

could some one suggest where I might start in creating a an xml deserializer for a format that is completely foreign to emf?
A format that's not describable with a schema?

Are there any example of this, if so where should I look?
I've not seen something that's so funky you couldn't write a schema for it.

Will I need to replace the DefaultHandler in a subclass of XMLLoadImpl?
That's where most of the deserialization work will be done. It's effectively just a SAX handler.

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?
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.

once again as usual and in advance thanks for any help rendered!

regards
gary