Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [ATL] Reading XML Value(How can I reference a xml element value with the ATL)
[ATL] Reading XML Value [message #765851] Wed, 14 December 2011 19:18 Go to next message
schabel  is currently offline schabel Friend
Messages: 6
Registered: September 2011
Junior Member
Hi,

(it may be a stupid question, sorry)

How can I read the node value "DBConnection" from
<Performers>
<Performer>DBConnection</Performer>
</Performers>

Given is the xsd (from XPDL2.1):
...
<xsd:element name="Performer">
<xsd:annotation>
<xsd:documentation>A String or Expression designating the Performer</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:simpleContent>
<xsd:extension base="xsd:string">
<xsd:anyAttribute namespace="##other" processContents="lax"/>
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType>
</xsd:element>

Any help would be great!

[Updated on: Wed, 14 December 2011 19:21]

Report message to a moderator

Re: [ATL] Reading XML Value [message #765884 is a reply to message #765851] Wed, 14 December 2011 20:47 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

We don't use XSD for modeling; we use Ecore, so perform the XSD to Ecore
conversion to Ecore to see what your converted XSD is like. Then you'll
know what you can access.

Regards

Ed Willink


On 14/12/2011 11:19, schabel wrote:
> Hi,
>
> (it may be a stupid question, sorry)
>
> How can I read the node value "DBConnection" from
> <Performers>
> <Performer>DBConnection</Performer>
> </Performers>
>
> Given is the xsd (from XPDL2.1):
> ..
> <xsd:element name="Performer">
> <xsd:annotation>
> <xsd:documentation>A String or Expression designating the
> Performer</xsd:documentation>
> </xsd:annotation>
> <xsd:complexType>
> <xsd:simpleContent>
> <xsd:extension base="xsd:string">
> <xsd:anyAttribute namespace="##other" processContents="lax"/>
> </xsd:extension>
> </xsd:simpleContent>
> </xsd:complexType>
> </xsd:element>
>
> Any help would be great!
Re: [ATL] Reading XML Value [message #766083 is a reply to message #765884] Thu, 15 December 2011 08:00 Go to previous messageGo to next message
schabel  is currently offline schabel Friend
Messages: 6
Registered: September 2011
Junior Member
Hi Ed,
thanks. The ecore is below and it only gives access to the attributes.
If the input is:
<Performer Value="DBConnection"></Performer>
...I can pick it.

But is there a way to handle this input?
<Performer>DBConnection</Performer>

Kind regards
Gerhard

class PerformerType
{
attribute Value : _'ecore.xml.type'::String[?] { ordered }
{
annotation _'<some link>'
(
name = ':0',
kind = 'simple'
);
}
attribute Relationship : _'ecore.xml.type'::String[?] { ordered }
{
annotation _'<some link>'
(
kind = 'attribute',
name = 'Relationship'
);
}
attribute AnyAttribute : ecore::EFeatureMapEntry[*] { ordered !unique }
{
annotation _'<some link>'
(
kind = 'attributeWildcard',
wildcards = '##other',
name = ':2',
processing = 'lax'
);
}
annotation _'<some link>'
(
name = 'Performer_._type',
kind = 'simple'
);
}
Re: [ATL] Reading XML Value [message #766283 is a reply to message #766083] Thu, 15 December 2011 13:54 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

The EMF project provides a variety of capabilities to read a variety of
different XML styles specifically to help those with non-standard or
legacy XML requirements. I do not need them, so I can only refer you to
the EMF book that I would consult if I needed to use them.

Regards

Ed Willink

On 15/12/2011 00:00, schabel wrote:
> Hi Ed,
> thanks. The ecore is below and it only gives access to the attributes.
> If the input is:
> <Performer Value="DBConnection"></Performer>
> ..I can pick it.
>
> But is there a way to handle this input?
> <Performer>DBConnection</Performer>
>
> Kind regards
> Gerhard
>
> class PerformerType
> {
> attribute Value : _'ecore.xml.type'::String[?] { ordered }
> {
> annotation _'<some link>'
> (
> name = ':0',
> kind = 'simple'
> );
> }
> attribute Relationship : _'ecore.xml.type'::String[?] { ordered }
> {
> annotation _'<some link>'
> (
> kind = 'attribute',
> name = 'Relationship'
> );
> }
> attribute AnyAttribute : ecore::EFeatureMapEntry[*] { ordered
> !unique }
> {
> annotation _'<some link>'
> (
> kind = 'attributeWildcard',
> wildcards = '##other',
> name = ':2',
> processing = 'lax'
> );
> }
> annotation _'<some link>'
> (
> name = 'Performer_._type',
> kind = 'simple'
> );
> }
>
Re: [ATL] Reading XML Value [message #766449 is a reply to message #766283] Thu, 15 December 2011 20:16 Go to previous messageGo to next message
schabel  is currently offline schabel Friend
Messages: 6
Registered: September 2011
Junior Member
Hi Ed,

concerning my XML example: its neither legacy nor special, it's frequently used.

(I didn't find it in the ATL manual, shouldn't I?)

Could you please tell me what you mean by "the EMF book"?

Regards Gerhard.
Re: [ATL] Reading XML Value [message #766455 is a reply to message #766449] Thu, 15 December 2011 20:25 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

http://www.amazon.com/EMF-Eclipse-Modeling-Framework-2nd/dp/0321331885

Regards

Ed Willink

On 15/12/2011 12:16, schabel wrote:
> Hi Ed,
>
> concerning my XML example: its neither legacy nor special, it's
> frequently used.
>
> (I didn't find it in the ATL manual, shouldn't I?)
>
> Could you please tell me what you mean by "the EMF book"?
>
> Regards Gerhard.
Previous Topic:[ATL] The purpose of Injector and Extractor?
Next Topic:Check duplicates
Goto Forum:
  


Current Time: Fri Apr 19 06:30:18 GMT 2024

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

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

Back to the top