Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsEOL and feature maps
https://www.eclipse.org/forums/index.php/mv/msg/197509/629719/#msg_629719
I'm using ETL/EOL in the context of an XHTML model (from a QVTO example
I found a reference to). This model uses FeatureMaps heavily and I'm now
struggling with the EOL for adding elements.
If I understand this correctly, a feature map is a way of storing a list
of entry elements, so that the values of the entries also appear in a
set of derived features. In the XHTML model, a Block contains a groups
FeatureMap, and there are derived multi-value references named p, h1,
.... When you add a P to the Block, I believe you have to create an
Entry, set the key to Block's p feature and the value to the new P. Then
the Entry is added to the FeatureMap. There is a convenience method in
FeatureMap for adding the key, value pair. In any case, I have to be
able to get hold of an EPackage instance and ask for a specific
EStructuralFeature, e.g. XhtmlPackage.eINSTANCE.getBlock_P();
I haven't found a way of calling static methods, but know about Native
technique. The question is, do I have to define a new Tool with my own
methods for accessing "static" information, like the EPackage registry?
Hallvard]]>Hallvard Traetteberg2010-09-29T11:13:00-00:00Re: EOL and feature maps
https://www.eclipse.org/forums/index.php/mv/msg/197509/629912/#msg_629912
I managed to solve it, twice in fact. First, I implemented a tool that
exposed necessary method for handling FeatureMaps, and used this by
initializing it in a pre block and using it when needed. Second, I
realized that I only needed methods on objects I already had access to
by means of eClass(). E.g. I could lookup features in the eClass, get
feature values, add values to features maps, etc, using only EOL.
:-)
Hallvard
On 29.09.10 13.13, Hallvard Trætteberg wrote:
>
> I'm using ETL/EOL in the context of an XHTML model (from a QVTO example
> I found a reference to). This model uses FeatureMaps heavily and I'm now
> struggling with the EOL for adding elements.
>
> If I understand this correctly, a feature map is a way of storing a list
> of entry elements, so that the values of the entries also appear in a
> set of derived features. In the XHTML model, a Block contains a groups
> FeatureMap, and there are derived multi-value references named p, h1,
> ... When you add a P to the Block, I believe you have to create an
> Entry, set the key to Block's p feature and the value to the new P. Then
> the Entry is added to the FeatureMap. There is a convenience method in
> FeatureMap for adding the key, value pair. In any case, I have to be
> able to get hold of an EPackage instance and ask for a specific
> EStructuralFeature, e.g. XhtmlPackage.eINSTANCE.getBlock_P();
>
> I haven't found a way of calling static methods, but know about Native
> technique. The question is, do I have to define a new Tool with my own
> methods for accessing "static" information, like the EPackage registry?
>
> Hallvard]]>Hallvard Traetteberg2010-09-29T21:54:45-00:00Re: EOL and feature maps
https://www.eclipse.org/forums/index.php/mv/msg/197509/629986/#msg_629986
Glad you managed to solve this! For XML-based models you may also want
to have a look at the plain XML driver we recently added to Epsilon: http://www.eclipse.org/gmt/epsilon/doc/articles/plain-xml/
Cheers,
Dimitris
Hallvard Trætteberg wrote:
> Hi,
>
> I managed to solve it, twice in fact. First, I implemented a tool that
> exposed necessary method for handling FeatureMaps, and used this by
> initializing it in a pre block and using it when needed. Second, I
> realized that I only needed methods on objects I already had access to
> by means of eClass(). E.g. I could lookup features in the eClass, get
> feature values, add values to features maps, etc, using only EOL.
>
> :-)
>
> Hallvard
>
> On 29.09.10 13.13, Hallvard Trætteberg wrote:
>>
>> I'm using ETL/EOL in the context of an XHTML model (from a QVTO example
>> I found a reference to). This model uses FeatureMaps heavily and I'm now
>> struggling with the EOL for adding elements.
>>
>> If I understand this correctly, a feature map is a way of storing a list
>> of entry elements, so that the values of the entries also appear in a
>> set of derived features. In the XHTML model, a Block contains a groups
>> FeatureMap, and there are derived multi-value references named p, h1,
>> ... When you add a P to the Block, I believe you have to create an
>> Entry, set the key to Block's p feature and the value to the new P. Then
>> the Entry is added to the FeatureMap. There is a convenience method in
>> FeatureMap for adding the key, value pair. In any case, I have to be
>> able to get hold of an EPackage instance and ask for a specific
>> EStructuralFeature, e.g. XhtmlPackage.eINSTANCE.getBlock_P();
>>
>> I haven't found a way of calling static methods, but know about Native
>> technique. The question is, do I have to define a new Tool with my own
>> methods for accessing "static" information, like the EPackage registry?
>>
>> Hallvard
>]]>Dimitrios Kolovos2010-09-30T08:03:42-00:00Re: EOL and feature maps
https://www.eclipse.org/forums/index.php/mv/msg/197509/630168/#msg_630168
>
> Glad you managed to solve this! For XML-based models you may also want
> to have a look at the plain XML driver we recently added to Epsilon:
> http://www.eclipse.org/gmt/epsilon/doc/articles/plain-xml/
Interesting! Although the example I'm working on now is for a lecture
(tomorrow morning) about M2M transformations (followed up by M2T with
EGL using the the same example). Hence, it's better to have an explicit
Ecore model of XHTML (found one in a QVTO example in Eclipse's CVS).