Skip to main content



      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 14:18 Go to next message
Eclipse UserFriend
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 14:21] by Moderator

Re: [ATL] Reading XML Value [message #765884 is a reply to message #765851] Wed, 14 December 2011 15:47 Go to previous messageGo to next message
Eclipse UserFriend
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 03:00 Go to previous messageGo to next message
Eclipse UserFriend
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 08:54 Go to previous messageGo to next message
Eclipse UserFriend
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 15:16 Go to previous messageGo to next message
Eclipse UserFriend
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 15:25 Go to previous message
Eclipse UserFriend
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: Wed Jul 09 08:48:59 EDT 2025

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

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

Back to the top