|
Re: Problems with complexType [message #1062673 is a reply to message #1062668] |
Mon, 10 June 2013 10:37 |
Ed Merks Messages: 33264 Registered: July 2009 |
Senior Member |
|
|
Arjan,
Comments below.
On 10/06/2013 12:14 PM, Arjan Kok wrote:
> Hi,
>
> I am working on a project that extends the org.eclipse.xsd module. There seem to be two problems regarding the handling of complexType.
>
>
> 1. The attributes of the complexContent element are lost when loading an xsd schema into the ecore model, and then deriving the xsd from the model again.
> For example, when running XSDMainExample::loadAndPrint (in org.eclipse.xsd.example) for the xsd file example 1 (is attached), then the attributes of the complexContent element are lost. It looks like the attributes are not loaded into the model.
For me that prints out
<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema"
xmlns:link="http://www.xbrl.org/2003/linkbase"
xmlns:xl="http://www.xbrl.org/2003/XLink">
<import namespace="http://www.xbrl.org/2003/XLink"
schemaLocation="http://www.xbrl.org/2003/xl-2003-12-31.xsd"/>
<import namespace="http://www.xbrl.org/2003/linkbase"
schemaLocation="http://www.xbrl.org/2003/xbrl-linkbase-2003-12-31.xsd"/>
<element name="reference" substitutionGroup="xl:resource">
<complexType mixed="true">
<complexContent>
<extension base="xl:resourceType">
<sequence>
<element maxOccurs="unbounded" minOccurs="0" ref="link:part"/>
</sequence>
</extension>
</complexContent>
</complexType>
</element>
</schema>
So you're specifically referring to the id attribute? I've not looked
closely, but the DOM itself should preserve that. They're not recorded
in the model. Are you discarding the DOM and regenerating it?
>
> 2. The complexContent element and restriction element are lost when the attribute base of the contained restriction element has value 'anyType'. See example 2.
The same issue here. What's serialized is semantically equivalent to
what's read in, so if you discard the DOM, you should expect this type
of thing.
>
> Are these bugs or features? Should I enter a bugzilla, or is there a workaround?
Are you discarding the DOM?
>
> Kind Regards,
>
> Arjan Kok.
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Re: Problems with complexType [message #1062687 is a reply to message #1062673] |
Mon, 10 June 2013 11:43 |
Arjan Kok Messages: 40 Registered: July 2009 |
Member |
|
|
Hi Ed,
1) The complexContent element misses the attribute mixed = "true". Yes, I am discarding the DOM and regenerating the DOM from the model (that is what XSDMainExample::loadAndPrint does).
2) Yes, I am discarding the DOM. If the results are semantically equivalent then I am OK with it.
The goal is to work on the model level. Discarding the DOM reassures me that I don't miss information in the model.
Arjan.
[Updated on: Mon, 10 June 2013 11:47] Report message to a moderator
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03591 seconds