Help parsing XML [message #713331] |
Mon, 08 August 2011 07:07  |
Eclipse User |
|
|
|
Hi,
I've generated Java code from an XML schema using EMF. I want to use this code to parse XML from a remote service. Unfortunately, the service providing the XML doesn't follow the schema correctly:
The schema contains a type called "ows:AnyValue". The service providing the XML however incorrectly uses "wcs:AnyValue" E.g:
<wcs:Definition>
<wcs:AnyValue/>
</wcs:Definition>
Because it's not specified in the schema, "wcs:AnyValue" does not correspond to a Java class to XML parsing fails. Is there any way that I can alter my model so that it allows "wcs:AnyValue" as well as "ows:AnyValue"?
I'm quite unfamiliar with EMF so any help would be greatly appreciated!
Thanks,
Jon
|
|
|
|
Re: Help parsing XML [message #713885 is a reply to message #713584] |
Tue, 09 August 2011 05:55  |
Eclipse User |
|
|
|
Thanks for the reply.
"wcs:AnyValue" and "ows:AnyValue" are not different. The schema defines "ows:AnyValue", but the service I'm trying to parse XML data from uses "wcs:AnyValue".
It seems that using the wrong namespace does have an effect. When I try to parse some XML which uses "ows:AnyValue" then everything is fine. When it uses "wcs:AnyValue" I get:
org.eclipse.emf.ecore.resource.Resource$IOWrappedException: Feature 'AnyValue' not found.
The schemas are available online, but it seems the forum won't let me post a link yet.
Thanks,
Jon
[Updated on: Tue, 09 August 2011 05:55] by Moderator
|
|
|
Powered by
FUDForum. Page generated in 0.03207 seconds