|
|
Re: DOM like fallback [message #540788 is a reply to message #540752] |
Thu, 17 June 2010 11:27 |
|
Hi Dirk,
if I have understood your problem, you need to define a all-in one XML Schema starting from i) an existing one plus some additions or ii) several distinct XML Schemas.
In order to generate the Java code you need you have to define a valid .ecore file (i.e. in other words a "metamodel") including the same elements you can define in an XML Schema.
I think you should take a look to the EMF book, 2nd edition in general. If you need to combine several XML Schemas take a look at chapter 13 on how to combine .ecore files (obtained automatically by XML Schemas).
The reference you posted seems to me quite old (2006). I think you should inspect the documentation and examples on the Eclipse Modeling Project page.
Good luck,
Luca Berardinelli
|
|
|
Re: DOM like fallback [message #541068 is a reply to message #540784] |
Fri, 18 June 2010 08:36 |
Dirk Hoffmann Messages: 163 Registered: July 2009 |
Senior Member |
|
|
Hi Ed,
thanks for your reply.
I indeed found
<xsd:any namespace="##any" processContents="strict" maxOccurs="unbounded"/>
in the definition of one of the top-level types in the schema.
With kind regards,
Dirk
Am 17.06.2010 12:21, schrieb Ed Merks:
> Dirk,
>
> Comments below.
>
> Dirk Hoffmann wrote:
>> Hi,
>>
>> we're dealing with XML instances, namely PLMXML instances, which
>> sometimes do not completely conform to their xsd and contain
>> additional content from other namespaces for which no schema is
>> available.
> Aren't there wildcards in the schema to support that?
>>
>> That means the Java binding needs to provide access to the underlying
>> XML content via a DOM-like API. For example with the XMLBeans binding
>> solution the getDomNode() method provides just that.
>>
>> I wonder how to achieve the same with EMF.
>>
>> I've read
>>
>> http://www.theserverside.com/news/1364302/Binding-XML-to-Jav a
>>
>> If I interpret that correctly it suggests providing a fits-all XML
>> schema, make an ecore model of it and generate the code.
>>
>> The question is: Can I simple combine the proposes fits-all schema
>> with the PLMXML schema (the one we're dealing with) by pasting or
>> including it into the PLMXMLSchema.xsd?
>>
>> Or is there another way to generically access the pure XML content?
> The schema should really include wildcards. Does it?
>>
>> Thanks and regards,
>> Dirk
|
|
|
Powered by
FUDForum. Page generated in 0.03480 seconds