[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Newsgroup Home]
|
[news.eclipse.modeling.m2t] jet xpath expression to reference properties on an object valued model attribute
|
- From: smackey@xxxxxxxxxxxx (Stuart Mackey)
- Date: Fri, 21 Aug 2009 00:49:05 +0000 (UTC)
- Newsgroups: eclipse.modeling.m2t
- Organization: Eclipse
- User-agent: NewsPortal/0.36 (http://florian-amrhein.de/newsportal)
Working with an EMF model similar to:
MyObject
point : MyPoint
So MyObject is an EObject with an attribute whose EType is MyPoint.
MyPoint is an EDataType that points at a typical POJO Java 'Point' object
with an x and y property.
I'd like to access those x and y values directly in a JET template and
haven't figured out how so far short of having to write a custom tag or
xpath function. Is there a way to do it?
For these examples, assume an instance of 'MyObject' is the context node.
I can't do this, obviously (b/c 'point' is an attribute):
x: <c:get select="point/@x"/>
But if I reference 'point' properly as an attribute, is there any way to
access the properties on it?
x: <c:get select="@point..."/>
One solution might be to have the model changed so that 'MyPoint' is a
normal model object rather than an EDataType so then I could write an
xpath like "point/@x".
A custom tag or xpath function could do it too I guess.
But for the sake of trivia, is there any built-in way to get at properties
on an EDataType via xpath?