Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » ATL » Getting elements from a XSD Complex Type - ATL
Getting elements from a XSD Complex Type - ATL [message #1228778] Wed, 08 January 2014 02:47 Go to next message
michel souza is currently offline michel souzaFriend
Messages: 18
Registered: December 2013
Junior Member
Hi guys,

My transformation is XSD -> UML
I tried a little bit everything to get the elements from a complex type or to know with which complex type an given element is related to (if any):

Here is .xsd file example:

<xs:element name="sayGoodbye" type="tns:sayGoodbye"/>

<xs:element name="sayGoodbyeResponse" type="tns:sayGoodbyeResponse"/>

<xs:element name="sayHello" type="tns:sayHello"/>

<xs:element name="sayHelloResponse" type="tns:sayHelloResponse"/>

<xs:complexType name="sayHello">
<xs:sequence>
<xs:element name="arg0" type="xs:string" minOccurs="0"/>
</xs:sequence>
</xs:complexType>

<xs:complexType name="sayHelloResponse">
<xs:sequence>
<xs:element name="return" type="xs:string" minOccurs="0"/>
</xs:sequence>
</xs:complexType>

<xs:complexType name="sayGoodbye">
<xs:sequence>
<xs:element name="arg0" type="xs:string" minOccurs="0"/>
</xs:sequence>
</xs:complexType>

<xs:complexType name="sayGoodbyeResponse">
<xs:sequence>
<xs:element name="return" type="xs:string" minOccurs="0"/>
</xs:sequence>
</xs:complexType>

By now.. I couldn't get the list of elements from a XSD!XSDComplexTypeDefinition (if is really here I will find).. or to get the complextype related to a XSD!XSDElementDeclaration. If anyone could help me.

Many thanks in advance
Re: Getting elements from a XSD Complex Type - ATL [message #1228821 is a reply to message #1228778] Wed, 08 January 2014 05:59 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
Michel,

Of course if you're using the XSD model, you'll have to look closely at
that model to understand the structure you'll have to navigate using
ATL. Have you done that? Base on that, what specifically have you tried?

On 08/01/2014 3:47 AM, michel souza wrote:
> Hi guys,
>
> My transformation is XSD -> UML
> I tried a little bit everything to get the elements from a complex
> type or to know with which complex type an given element is related to
> (if any):
>
> Here is .xsd file example:
>
> <xs:element name="sayGoodbye" type="tns:sayGoodbye"/>
>
> <xs:element name="sayGoodbyeResponse" type="tns:sayGoodbyeResponse"/>
>
> <xs:element name="sayHello" type="tns:sayHello"/>
>
> <xs:element name="sayHelloResponse" type="tns:sayHelloResponse"/>
>
> <xs:complexType name="sayHello">
> <xs:sequence>
> <xs:element name="arg0" type="xs:string" minOccurs="0"/>
> </xs:sequence>
> </xs:complexType>
>
> <xs:complexType name="sayHelloResponse">
> <xs:sequence>
> <xs:element name="return" type="xs:string" minOccurs="0"/>
> </xs:sequence>
> </xs:complexType>
>
> <xs:complexType name="sayGoodbye">
> <xs:sequence>
> <xs:element name="arg0" type="xs:string" minOccurs="0"/>
> </xs:sequence>
> </xs:complexType>
>
> <xs:complexType name="sayGoodbyeResponse">
> <xs:sequence>
> <xs:element name="return" type="xs:string" minOccurs="0"/>
> </xs:sequence>
> </xs:complexType>
>
> By now.. I couldn't get the list of elements from a
> XSD!XSDComplexTypeDefinition (if is really here I will find).. or to
> get the complextype related to a XSD!XSDElementDeclaration. If anyone
> could help me.
>
> Many thanks in advance


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Getting elements from a XSD Complex Type - ATL [message #1229012 is a reply to message #1228821] Wed, 08 January 2014 14:41 Go to previous messageGo to next message
michel souza is currently offline michel souzaFriend
Messages: 18
Registered: December 2013
Junior Member
Hi Ed Merks...

I figured out how to get them. Doing:

s.contentType.content.contents.first().content.name (only the first here)
's' being a XSD!XSDComplexTypeDefinition

Trying to write the transformation.. I just could see "s.contentType". When I tried to use the shortcut (ctrl + space) to see what I could get from "s.contentType.(ctrl + space) this ".content" option was not available.. in some way it was hidden. Only in debug mode it was possible to access.. I don't know why.

Now I'm trying to get the list of ComplexType inside a XSD file.. I can only see the list of Element Declaration (elements). Maybe the same happens..
Re: Getting elements from a XSD Complex Type - ATL [message #1229025 is a reply to message #1229012] Wed, 08 January 2014 15:07 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
Michel,

Yes, the XSD model is quite complex and the elements in a complex type
are part of complex content's particle structure which is in general a
tree structure that can nest arbitrarily deep. You might find it
helpful to use the Sample XSD editor that comes with the XSD SDK in
order to view/understand the tree structure as well as the logical
semantic structure of an instance to better understand how to navigate it.


On 08/01/2014 3:41 PM, michel souza wrote:
> Hi Ed Merks...
> I figured out how to get them. Doing:
> s.contentType.content.contents.first().content.name (only the first here)
> 's' being a XSD!XSDComplexTypeDefinition
>
> Trying to write the transformation.. I just could see "s.contentType".
> When I tried to use the shortcut (ctrl + space) to see what I could
> get from "s.contentType.(ctrl + space) this ".content" option was not
> available.. in some way it was hidden. Only in debug mode it was
> possible to access.. I don't know why.
>
> Now I'm trying to get the list of ComplexType inside a XSD file.. I
> can only see the list of Element Declaration (elements). Maybe the
> same happens..


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Getting elements from a XSD Complex Type - ATL [message #1229029 is a reply to message #1229025] Wed, 08 January 2014 15:14 Go to previous message
michel souza is currently offline michel souzaFriend
Messages: 18
Registered: December 2013
Junior Member
Hi Ed Merks,

thanks for your advice. I'll take a look at it!

[Updated on: Wed, 08 January 2014 15:14]

Report message to a moderator

Previous Topic:ATL dynamic creation and referencing
Next Topic:Problem whe using "Support UML2 Stereotypes application" in the run configuration's advanc
Goto Forum:
  


Current Time: Thu Apr 25 13:28:09 GMT 2024

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

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

Back to the top