Possible noob issue with xsi:type [message #415236] |
Thu, 06 December 2007 14:54 |
Eclipse User |
|
|
|
Originally posted by: xa0z.hotmail.com
Dear Fellow-Eclipsers :)
This is my first post and I'm probably an EMF newbie so please don't point and laugh when I'm asking this ;)
I am trying to use JET to generate a GUI (for a school assignment, yes, it has been done before :)). I understand XPATH a little and thought my query would be good:
XPATH: //eClassifier/@*[local-name()='name']
RETURNS: 'Book'
FROM: <eClassifiers xsi:type="ecore:EClass" name="Book">
XPATH: //eClassifier/@*[local-name()='type']
ERROR: XPath expression returned no result
FROM: <eClassifiers xsi:type="ecore:EClass" name="Book">
Which obviously isn't true... Can anyone tell me what query I would need to use to get the value of xsi:type?
Thanks a lot in advance,
A struggling eclipser
|
|
|
[JET] Re: Possible noob issue with xsi:type [message #415239 is a reply to message #415236] |
Thu, 06 December 2007 15:55 |
Eclipse User |
|
|
|
Originally posted by: cdamus.ca.ibm.com
Hi, Merlijn,
The problem is, that xsi:type is not really an attribute in the schema that
you're dealing with. It's just type information, and XPath 1.0 is not
aware of XSD and its type system as XPath 2.0 is.
However, it looks like you are using M2T JET, so I have replied to that
newsgroup because I think JET may provide some "extras" in its XPath
implementation that can help you.
Cheers,
Christian
Merlijn wrote:
> Dear Fellow-Eclipsers :)
>
> This is my first post and I'm probably an EMF newbie so please don't point
> and laugh when I'm asking this ;)
>
> I am trying to use JET to generate a GUI (for a school assignment, yes, it
> has been done before :)). I understand XPATH a little and thought my query
> would be good:
>
> XPATH: //eClassifier/@*[local-name()='name']
> RETURNS: 'Book'
> FROM: <eClassifiers xsi:type="ecore:EClass" name="Book">
>
> XPATH: //eClassifier/@*[local-name()='type']
> ERROR: XPath expression returned no result
> FROM: <eClassifiers xsi:type="ecore:EClass" name="Book">
>
> Which obviously isn't true... Can anyone tell me what query I would need
> to use to get the value of xsi:type?
>
> Thanks a lot in advance,
> A struggling eclipser
|
|
|
Re: Possible noob issue with xsi:type [message #415251 is a reply to message #415236] |
Fri, 07 December 2007 11:19 |
Eclipse User |
|
|
|
Originally posted by: xa0z.hotmail.com
Thank you for your reply :) it made me look past the XPATH and have a look at inserting JET code. It turns out to have the things I need indeed:
((EClassifier)context.getVariable("eClassifier")).getClass().getName()
This prints 'org.eclipse.emf.ecore.impl.EClassImpl' for a class and 'org.eclipse.emf.ecore.impl.EEnumImpl' for an Enumeration. All the other parameters are no problem with XPath, just this one, so I guess I can move on now. Thanks for your hint! ;)
|
|
|
Powered by
FUDForum. Page generated in 0.03857 seconds