[ATL] Reading XML Value [message #765851] |
Wed, 14 December 2011 19:18  |
Eclipse User |
|
|
|
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] by Moderator Report message to a moderator
|
|
|
Re: [ATL] Reading XML Value [message #765884 is a reply to message #765851] |
Wed, 14 December 2011 20:47   |
Eclipse User |
|
|
|
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   |
Eclipse User |
|
|
|
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   |
Eclipse User |
|
|
|
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   |
Eclipse User |
|
|
|
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.
|
|
|
|
Powered by
FUDForum. Page generated in 0.06861 seconds