handling of abstract types [message #1508490] |
Fri, 12 December 2014 13:06 |
Daniele Pala Messages: 9 Registered: September 2011 |
Junior Member |
|
|
Hello, I'm working with an XSD-derived model, where I have the following complexType:
<xs:complexType name="IntervalType">
<xs:sequence>
<xs:element ref="xcal:dtstart" minOccurs="0"/>
<xs:element ref="xcal:duration" minOccurs="0"/>
<xs:element ref="xcal:uid" minOccurs="0"/>
<xs:element ref="strm:streamPayloadBase" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
I'm trying, in QVTO, to assign to "streamPayloadBase", which is abstract:
<xs:complexType name="StreamPayloadBaseType" abstract="true">
<xs:annotation>
<xs:documentation>Abstract class to convey a payload for a stream. When a Stream is transformed to or from a WS-Calendar Interval, the contents of the Stream Payload defined element are transformed into the contents of a WS-Calendar artifactBase.</xs:documentation>
</xs:annotation>
</xs:complexType>
I'm using this syntax:
object IntervalType{
streamPayloadBase += OrderedSet {
object SignalPayloadType {}
}
};
where "SignalPayloadType" is a concrete child of "StreamPayloadBaseType". However, I cannot do this, since I get the error:
"Property 'streamPayloadBase' is read-only"
How can I solve this problem?
Thanks a lot,
Daniele Pala
|
|
|
Re: handling of abstract types [message #1508548 is a reply to message #1508490] |
Fri, 12 December 2014 14:04 |
Ed Willink Messages: 7670 Registered: July 2009 |
Senior Member |
|
|
Hi
It may be appropriate to start with XSD for external compatibility, but
as soon as you convert to Ecore you can join the grown ups and use models.
It would appear that your Ecore model has a readonly attribute
prohibiting the change. You may investigate whether this is an XSD to
Ecore conversion anomally, or just correct it. You should then be good
to go.
Without a *.ecore to look at it's hard to comment further.
Regards
Ed Willink
On 12/12/2014 13:06, Daniele Pala wrote:
> Hello, I'm working with an XSD-derived model, where I have the following
> complexType:
>
> <xs:complexType name="IntervalType">
> <xs:sequence>
> <xs:element ref="xcal:dtstart" minOccurs="0"/>
> <xs:element ref="xcal:duration" minOccurs="0"/>
> <xs:element ref="xcal:uid" minOccurs="0"/>
> <xs:element ref="strm:streamPayloadBase"
> maxOccurs="unbounded"/>
> </xs:sequence>
> </xs:complexType>
>
> I'm trying, in QVTO, to assign to "streamPayloadBase", which is abstract:
>
> <xs:complexType name="StreamPayloadBaseType" abstract="true">
> <xs:annotation>
> <xs:documentation>Abstract class to convey a payload for a
> stream. When a Stream is transformed to or from a WS-Calendar Interval,
> the contents of the Stream Payload defined element are transformed into
> the contents of a WS-Calendar artifactBase.</xs:documentation>
> </xs:annotation>
> </xs:complexType>
>
> I'm using this syntax:
>
> object IntervalType{
> streamPayloadBase += OrderedSet {
> object SignalPayloadType {}
> }
> };
>
> where "SignalPayloadType" is a concrete child of
> "StreamPayloadBaseType". However, I cannot do this, since I get the error:
>
> "Property 'streamPayloadBase' is read-only"
>
> How can I solve this problem?
>
> Thanks a lot,
> Daniele Pala
>
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.25633 seconds