Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » QVT-OML » Access localPart of QName
Access localPart of QName [message #870005] Sat, 05 May 2012 16:03 Go to next message
Tex Iano is currently offline Tex IanoFriend
Messages: 99
Registered: February 2012
Member
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 16:43 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
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 16:55 Go to previous messageGo to next message
Michael Bob is currently offline Michael BobFriend
Messages: 29
Registered: February 2012
Junior Member
(old account)

[Updated on: Sat, 05 May 2012 16:56]

Report message to a moderator

Re: Access localPart of QName [message #870011 is a reply to message #870010] Sat, 05 May 2012 16:57 Go to previous messageGo to next message
Tex Iano is currently offline Tex IanoFriend
Messages: 99
Registered: February 2012
Member
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 18:17 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
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 18:59 Go to previous messageGo to next message
Tex Iano is currently offline Tex IanoFriend
Messages: 99
Registered: February 2012
Member
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 19:16 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
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: Tue Apr 23 16:52:01 GMT 2024

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

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

Back to the top