Attributes in Schema [message #18639] |
Thu, 10 April 2003 19:22 |
Eclipse User |
|
|
|
Originally posted by: mgl_ca.yahoo.com
Hello,
I am trying to understand the schema generated by EMF Model Generator for
library example. I have few questions on the following schema for Library
Model Element.
I have very little knowledge on XMI and XSD, so some of these questions
might be very basic.
<xsd:complexType name="Library">
<xsd:choice maxOccurs="unbounded" minOccurs="0">
<xsd:element name="name" nillable="true" type="xsd:string"/>
<xsd:element name="writers"
type="org.eclipse.example.library:Writer"/>
<xsd:element name="books" type="org.eclipse.example.library:Book"/>
<xsd:element ref="xmi:Extension"/>
</xsd:choice>
<xsd:attribute ref="xmi:id"/>
<xsd:attributeGroup ref="xmi:ObjectAttribs"/>
<xsd:attribute name="name" type="xsd:string"/>
</xsd:complexType>
<xsd:element name="Library" type="org.eclipse.example.library:Library"/>
Q1. Why is "name" generated as an Element and a Attribute, even though
'name' was just an attribute on a 'Library' class in rose model?
Q2. What property of Library Element resulted in the generation of element
<xsd:element ref="xmi:Extension"/>?
Q3. What property of Library Element resulted in the generation of element
<xsd:attribute ref="xmi:id"/>?
Q4. What property of Library Element resulted in the generation of element
<xsd:attributeGroup ref="xmi:ObjectAttribs"/>?
Thanks,
Maneesh
|
|
|
Re: Attributes in Schema [message #18662 is a reply to message #18639] |
Thu, 10 April 2003 21:20 |
Eclipse User |
|
|
|
Originally posted by: merks.ca.ibm.com
Maneesh,
This is mostly XMI ugliness...
Q1. We've been thinking we should change some of this. The XMI parser will be
able to process the Name feature as either an element or an attribute, so we've
reflected that in the grammar. But since we serialize it out as an attribute,
it would give a nicer schema to show it only as an attribute (even though the
element form will be accept too). The repeated choice thing reflects the fact
that elements can appear in any order...
Q2. I'm not so sure, but I think that XMI allows an "Extension" element to
appear anywhere...
Q3. Any element is allowed to have an xmi:id.
Q4. Any element may have an xmi:type to indicates it actual type.
It's most certainly a pretty ugly grammar that comes out...
Maneesh wrote:
> Hello,
>
> I am trying to understand the schema generated by EMF Model Generator for
> library example. I have few questions on the following schema for Library
> Model Element.
>
> I have very little knowledge on XMI and XSD, so some of these questions
> might be very basic.
>
> <xsd:complexType name="Library">
> <xsd:choice maxOccurs="unbounded" minOccurs="0">
> <xsd:element name="name" nillable="true" type="xsd:string"/>
> <xsd:element name="writers"
> type="org.eclipse.example.library:Writer"/>
> <xsd:element name="books" type="org.eclipse.example.library:Book"/>
> <xsd:element ref="xmi:Extension"/>
> </xsd:choice>
> <xsd:attribute ref="xmi:id"/>
> <xsd:attributeGroup ref="xmi:ObjectAttribs"/>
> <xsd:attribute name="name" type="xsd:string"/>
> </xsd:complexType>
> <xsd:element name="Library" type="org.eclipse.example.library:Library"/>
>
> Q1. Why is "name" generated as an Element and a Attribute, even though
> 'name' was just an attribute on a 'Library' class in rose model?
> Q2. What property of Library Element resulted in the generation of element
> <xsd:element ref="xmi:Extension"/>?
> Q3. What property of Library Element resulted in the generation of element
> <xsd:attribute ref="xmi:id"/>?
> Q4. What property of Library Element resulted in the generation of element
> <xsd:attributeGroup ref="xmi:ObjectAttribs"/>?
>
> Thanks,
> Maneesh
|
|
|
Re: Attributes in Schema [message #567788 is a reply to message #18639] |
Thu, 10 April 2003 21:20 |
Ed Merks Messages: 33264 Registered: July 2009 |
Senior Member |
|
|
Maneesh,
This is mostly XMI ugliness...
Q1. We've been thinking we should change some of this. The XMI parser will be
able to process the Name feature as either an element or an attribute, so we've
reflected that in the grammar. But since we serialize it out as an attribute,
it would give a nicer schema to show it only as an attribute (even though the
element form will be accept too). The repeated choice thing reflects the fact
that elements can appear in any order...
Q2. I'm not so sure, but I think that XMI allows an "Extension" element to
appear anywhere...
Q3. Any element is allowed to have an xmi:id.
Q4. Any element may have an xmi:type to indicates it actual type.
It's most certainly a pretty ugly grammar that comes out...
Maneesh wrote:
> Hello,
>
> I am trying to understand the schema generated by EMF Model Generator for
> library example. I have few questions on the following schema for Library
> Model Element.
>
> I have very little knowledge on XMI and XSD, so some of these questions
> might be very basic.
>
> <xsd:complexType name="Library">
> <xsd:choice maxOccurs="unbounded" minOccurs="0">
> <xsd:element name="name" nillable="true" type="xsd:string"/>
> <xsd:element name="writers"
> type="org.eclipse.example.library:Writer"/>
> <xsd:element name="books" type="org.eclipse.example.library:Book"/>
> <xsd:element ref="xmi:Extension"/>
> </xsd:choice>
> <xsd:attribute ref="xmi:id"/>
> <xsd:attributeGroup ref="xmi:ObjectAttribs"/>
> <xsd:attribute name="name" type="xsd:string"/>
> </xsd:complexType>
> <xsd:element name="Library" type="org.eclipse.example.library:Library"/>
>
> Q1. Why is "name" generated as an Element and a Attribute, even though
> 'name' was just an attribute on a 'Library' class in rose model?
> Q2. What property of Library Element resulted in the generation of element
> <xsd:element ref="xmi:Extension"/>?
> Q3. What property of Library Element resulted in the generation of element
> <xsd:attribute ref="xmi:id"/>?
> Q4. What property of Library Element resulted in the generation of element
> <xsd:attributeGroup ref="xmi:ObjectAttribs"/>?
>
> Thanks,
> Maneesh
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.05094 seconds