Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » Formatting text
Formatting text [message #58137] Tue, 10 March 2009 19:48 Go to next message
Guadalupe Mising name is currently offline Guadalupe Mising nameFriend
Messages: 35
Registered: July 2009
Member
Hi all,
Is it possible to use java.lang.String for formatting Strings in the
printed text.
Thanks a lot,
Guadalupe
Re: Formatting text [message #58185 is a reply to message #58137] Tue, 10 March 2009 20:36 Go to previous messageGo to next message
Paul Elder is currently offline Paul ElderFriend
Messages: 849
Registered: July 2009
Senior Member
I don't understand. Can you provide more details of what you are thinking?

Paul
Re: Formatting text [message #58236 is a reply to message #58185] Wed, 11 March 2009 11:43 Go to previous messageGo to next message
Guadalupe Mising name is currently offline Guadalupe Mising nameFriend
Messages: 35
Registered: July 2009
Member
Yes,
The exactly example is I am exporting UML models designed with RSA to xml.
And when I read attribute types href I obtain
" pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#String"
and I only want to show the text "String" in my generated code (which I
could easily obtain using java String function just asking for the
subString after #)

Thanks a lot for your help,
Guadalupe
Re: Formatting text [message #58285 is a reply to message #58236] Wed, 11 March 2009 14:59 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: johannes.nel.gmail.com

you can use the xpath string functions.

<c:get select="string-func(context)"/>

Guadalupe wrote:
> Yes,
> The exactly example is I am exporting UML models designed with RSA to
> xml. And when I read attribute types href I obtain
> " pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#String" and I
> only want to show the text "String" in my generated code (which I could
> easily obtain using java String function just asking for the subString
> after #)
>
> Thanks a lot for your help,
> Guadalupe
>
Re: Formatting text [message #58332 is a reply to message #58285] Wed, 11 March 2009 15:27 Go to previous messageGo to next message
Paul Elder is currently offline Paul ElderFriend
Messages: 849
Registered: July 2009
Senior Member
More specifically, JET implements all these standard XPath string
functions:

http://www.w3.org/TR/xpath#section-String-Functions

Plus, there are a number of other functions implemented, too:

http://help.eclipse.org/ganymede/index.jsp?topic=/org.eclips e.jet.doc/references/xpathFunctions/overview.html

In your case, I think substring-after($foo/@href, '#') would do.

Paul
Re: Formatting text [message #58440 is a reply to message #58332] Thu, 12 March 2009 19:13 Go to previous message
Guadalupe Mising name is currently offline Guadalupe Mising nameFriend
Messages: 35
Registered: July 2009
Member
Thanks a lot!!
I will record this useful links in a safe place.
Previous Topic:Setting a Template context source in JET2
Next Topic:Adding XSD for validation breaks JET transformation (0.8.x)
Goto Forum:
  


Current Time: Thu Mar 28 12:45:28 GMT 2024

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

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

Back to the top