Skip to main content



      Home
Home » Modeling » QVT-OML » Access localPart of QName
Access localPart of QName [message #870005] Sat, 05 May 2012 12:03 Go to next message
Eclipse UserFriend
Hi,

as I could not add comments in the old M2M forum, I repeat the question in this new forum:

I want to access the local part of a qName in Qvto. In ATL I did this:

name <- s.qName.getLocalPart()


in QVT:

name := self.qName.???


Any ideas? getLocalPart seems not to work.


Edit:

In the WSDL.ecore there is qName of type javax.xml.namespace.QName. So obviously it is not possible to call the according java methods in Qvt?

Regards

Tex
Re: Access localPart of QName [message #870007 is a reply to message #870005] Sat, 05 May 2012 12:43 Go to previous messageGo to next message
Eclipse UserFriend
Hi

Have you tried qName.localPart ??? If its a property then you just use
the name. If it was a helper function then you will need to provide it.

Regards

Ed Willink


On 05/05/2012 17:03, Tex Iano wrote:
> Hi,
>
> as I could not add comments in the old M2M forum, I repeat the
> question in this new forum:
>
> I want to access the local part of a qName in Qvto. In ATL I did this:
>
>
> name <- s.qName.getLocalPart()
>
>
> in QVT:
>
>
> name := self.qName.???
>
>
> Any ideas? getLocalPart seems not to work.
>
>
> Edit:
>
> In the WSDL.ecore there is qName of type javax.xml.namespace.QName. So
> obviously it is not possible to call the according java methods in Qvt?
>
> Regards
>
> Tex
Re: Access localPart of QName [message #870010 is a reply to message #870007] Sat, 05 May 2012 12:55 Go to previous messageGo to next message
Eclipse UserFriend
(old account)

[Updated on: Sat, 05 May 2012 12:56] by Moderator

Re: Access localPart of QName [message #870011 is a reply to message #870010] Sat, 05 May 2012 12:57 Go to previous messageGo to next message
Eclipse UserFriend
Hi Ed,

thanks for your answer. Yes, I tried it too, does not work.

docs.oracle.com/javase/1.5.0/docs/api/javax/xml/namespace/QName.html

QName has a method "getLocalPart()". Maybe the problem is, that QVTo does not recognize that qName field is of type javax.xml.namespace.QName or is not able to work on this java implementation.

Regards,

Tex
Re: Access localPart of QName [message #870019 is a reply to message #870011] Sat, 05 May 2012 14:17 Go to previous messageGo to next message
Eclipse UserFriend
Hi

You looking at the Javadoc that describes a Java API.

When you use modeling tools you should look at the models directly. So
you probably want XMLType.ecore where you will finf that QName is an
EDataType, so ATL's getLocalPart() is a helper function. Write something
similar for QVTo.

Regards

Ed Willink

On 05/05/2012 17:57, Tex Iano wrote:
> Hi Ed,
>
> thanks for your answer. Yes, I tried it too, does not work.
>
> docs.oracle.com/javase/1.5.0/docs/api/javax/xml/namespace/QName.html
>
> QName has a method "getLocalPart()". Maybe the problem is, that QVTo
> does not recognize that qName field is of type
> javax.xml.namespace.QName or is not able to work on this java
> implementation.
> Regards,
>
> Tex
Re: Access localPart of QName [message #870021 is a reply to message #870005] Sat, 05 May 2012 14:59 Go to previous messageGo to next message
Eclipse UserFriend
Aja.. very interesting.

So... the getLocalPart() I used in ATL was a helper function of ATL implementation?

What do you suggest: Writing it as extension for QVTo in Java or writing it as OCL expression?

Regards,

Tex
Re: Access localPart of QName [message #870023 is a reply to message #870021] Sat, 05 May 2012 15:16 Go to previous message
Eclipse UserFriend
Hi

You cannot write it in OCL because UML DataTypes are opaque. Only
Classes have useable structure.

If you have an OCL that supports toString() you could then dismantle the
string representation, but toString() is something that has been added
very recently.

localPart is an unmodelled capability so use an unmodelled solution.

Regards

Ed Willink

On 05/05/2012 19:59, Tex Iano wrote:
> Aja.. very interesting.
> So... the getLocalPart() I used in ATL was a helper function of ATL
> implementation?
> What do you suggest: Writing it as extension for QVTo in Java or
> writing it as OCL expression?
>
> Regards,
>
> Tex
Previous Topic:Apply stereotypes
Next Topic:Code Completion / Operations in QVT installation
Goto Forum:
  


Current Time: Sun Jul 13 01:35:54 EDT 2025

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

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

Back to the top