Author Topic: Transformation package name  (Read 2845 times)

purplecaesar

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Transformation package name
« on: December 24, 2007, 12:30:19 am »
Hi,

   I want to change the package name in transformation. But the code does not work. Can anyone tell me how to do that.
Code: [Select]

%if packagePath == ""%
%list="Namespace" @separator="\n"%
%list="Class" @separator="\n"%
%endTemplate%

Package
{
 %TRANSFORM_CURRENT()%
 name=%qt%%CONVERT_NAME(packageName, "camel case", "pascal case")%%qt%
%list="Namespace" @separator="\n" @indent="  "%
%list="Class" @separator="\n" @indent="  "%
}

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Transformation package name
« Reply #1 on: December 24, 2007, 06:56:43 am »
[I'm not too sure of this, so please disregard if I've got it wrong.]

Perhaps you could get at this by retrieving the element associated with the package, and using its name.

As it is you seem to be asking for the name of the parent of the package.

David
No, you can't have it!

purplecaesar

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: Transformation package name
« Reply #2 on: December 25, 2007, 12:38:46 am »
I've found the solution that when I change the code to:
Code: [Select]

 %TRANSFORM_CURRENT("name")%
 name=%qt%%CONVERT_NAME(packageName, "Pascal Case, Spaced", "htht")%%qt%

It does works. But I wonder why in package transformation I should exclude the "name" in Transform_current but I need not do that in class transformation.

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Transformation package name
« Reply #3 on: December 25, 2007, 05:27:35 am »
It wouldn't surprise me at all if the default behavior in package transforms is to handle the contents of a package rather than the package element. After all, in EA transformations base their scope on packages.
No, you can't have it!