Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Possible noob issue with xsi:type
Possible noob issue with xsi:type [message #415236] Thu, 06 December 2007 14:54 Go to next message
Eclipse UserFriend
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 Go to previous messageGo to next message
Eclipse UserFriend
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 Go to previous message
Eclipse UserFriend
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! ;)
Previous Topic:Projects compatibility
Next Topic:How to change XML Serilization format
Goto Forum:
  


Current Time: Fri Apr 26 12:39:24 GMT 2024

Powered by FUDForum. Page generated in 0.03857 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top