Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » XML Schema Definition (XSD) » Attributes in Schema
Attributes in Schema [message #18639] Thu, 10 April 2003 19:22 Go to next message
Eclipse UserFriend
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 Go to previous message
Eclipse UserFriend
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 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
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/
Previous Topic:Attributes in Schema
Next Topic:XMI Schema Generation
Goto Forum:
  


Current Time: Thu Apr 25 08:07:55 GMT 2024

Powered by FUDForum. Page generated in 0.03586 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top