[ATL] Getting the text of a xml element [message #42897] |
Tue, 29 May 2007 14:05 |
Eclipse User |
|
|
|
Originally posted by: erik_becker.gmx.de
Hi all,
I'm working on the transformation of a XML-based model. Is there a way
to get the text value of a XML element / tag? I need this value so set
attribute value of my target model.
I used the XML Injector to get an ecore-based instance from my source
XML model. My helper to get the text looks like this:
helper context XML!Element def: getText() : String =
self.children->select(e | e.oclIsKindOf(XML!Text))->first();
This work fine so far but now I don't know how to get the text value.
Could anyone help?
Greetings
Erik
|
|
|
|
Re: [ATL] Getting the text of a xml element [message #42958 is a reply to message #42927] |
Tue, 29 May 2007 16:44 |
Eclipse User |
|
|
|
Originally posted by: erik_becker.gmx.de
oh thanks and sorry, i tried already 'Value' and this didn't work but
'value' i haven't tried.
greetings
erik
Éric Vépa schrieb:
> Hi Erik,
>
> You can access the value of any XML!Node (or subclasses) using the
> attribute "value".
>
> For more details, see the XML metamodel available in the Zoo
> (http://www.eclipse.org/gmt/am3/zoos/atlanticZoo/#XML).
>
>
> Erik Becker wrote:
>> Hi all,
>>
>> I'm working on the transformation of a XML-based model. Is there a way
>> to get the text value of a XML element / tag? I need this value so set
>> attribute value of my target model.
>>
>> I used the XML Injector to get an ecore-based instance from my source
>> XML model. My helper to get the text looks like this:
>>
>> helper context XML!Element def: getText() : String =
>> self.children->select(e | e.oclIsKindOf(XML!Text))->first();
>>
>> This work fine so far but now I don't know how to get the text value.
>> Could anyone help?
>>
>> Greetings
>>
>> Erik
|
|
|
Powered by
FUDForum. Page generated in 0.04062 seconds