Skip to main content



      Home
Home » Modeling » Epsilon » rename tag name by EOL(How can i change the tag names in XML document )
rename tag name by EOL [message #1729767] Mon, 18 April 2016 13:56 Go to next message
Eclipse UserFriend
Hello,

I have generated XML document but the I need to rename the tag names.
How can I do that using EOL .Is there any built in operation to do rename??

For example :
<activity1 name="OpaqueAction1" hostdemandmean="11.0" phase="1"/>
I need to rename activity1 to activity

Can you please help me.

Thanks ,
Taghreed.

[Updated on: Wed, 20 April 2016 13:11] by Moderator

Re: rename tag name by EOL [message #1729991 is a reply to message #1729767] Wed, 20 April 2016 13:11 Go to previous messageGo to next message
Eclipse UserFriend
Hello ,
I have generated XML document but the I need to rename the tag names.
How can I do that using EOL .Is there any built in operation to do rename??

For example :
<activity1 name="OpaqueAction1" hostdemandmean="11.0" phase="1"/>
I need to rename activity1 to activity

Can you please help me.

Thanks ,
Taghreed.


[Updated on: Wed, 20 April 2016 13:11] by Moderator

Re: rename tag name by EOL [message #1730242 is a reply to message #1729991] Fri, 22 April 2016 09:52 Go to previous messageGo to next message
Eclipse UserFriend
AFAIK, we don't have anything for this. You'll have to add the new children elements and remove the old ones.
Re: rename tag name by EOL [message #1730245 is a reply to message #1730242] Fri, 22 April 2016 10:18 Go to previous messageGo to next message
Eclipse UserFriend
Ok Thanks
Re: rename tag name by EOL [message #1730609 is a reply to message #1730245] Wed, 27 April 2016 02:09 Go to previous messageGo to next message
Eclipse UserFriend
Hello,
How can I remove the old ones??
How can I create new children with attributes that are same to the old ones(removed ones).

for example how can I delete this
<activity1 name="OpaqueAction1" hostdemandmean="11.0" phase="1"/>

and then create this:
<activity name="OpaqueAction1" host_demand_mean="11.0" phase="1"/>




Can you please elaborate more .
Thanks,
Taghreed.

[Updated on: Wed, 27 April 2016 02:10] by Moderator

Re: rename tag name by EOL [message #1730646 is a reply to message #1730609] Wed, 27 April 2016 06:45 Go to previous messageGo to next message
Eclipse UserFriend
The model elements in a plain XML model are instances of Element, so you can use removeChild or replaceChild as usual. Something like this should work:

// find the old one
var oldAc = parent.c_activity1.selectOne(c|c.name='OpaqueAction1');

// create the new one
var newAc = new t_activity;
newAc.a_name = oldAc.a_name;
newAc.a_host_demand_mean = oldAc.a_host_demand_mean;
// same with other attributes ...

// replace within the parent
parent.replaceChild(oldAc, newAc);
Re: rename tag name by EOL [message #1730721 is a reply to message #1730646] Wed, 27 April 2016 20:48 Go to previous message
Eclipse UserFriend
Thanks very much:)
Previous Topic:[ETL] Difference between = and ::=
Next Topic:call java class which has a method from ANT build file
Goto Forum:
  


Current Time: Wed Jul 23 14:00:50 EDT 2025

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

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

Back to the top