Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 17:56 Go to next message
taghreed altamimi is currently offline taghreed altamimiFriend
Messages: 173
Registered: October 2014
Senior Member
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 17:11]

Report message to a moderator

Re: rename tag name by EOL [message #1729991 is a reply to message #1729767] Wed, 20 April 2016 17:11 Go to previous messageGo to next message
taghreed altamimi is currently offline taghreed altamimiFriend
Messages: 173
Registered: October 2014
Senior Member
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 17:11]

Report message to a moderator

Re: rename tag name by EOL [message #1730242 is a reply to message #1729991] Fri, 22 April 2016 13:52 Go to previous messageGo to next message
Antonio Garcia-Dominguez is currently offline Antonio Garcia-DominguezFriend
Messages: 475
Registered: January 2010
Senior Member
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 14:18 Go to previous messageGo to next message
taghreed altamimi is currently offline taghreed altamimiFriend
Messages: 173
Registered: October 2014
Senior Member
Ok Thanks
Re: rename tag name by EOL [message #1730609 is a reply to message #1730245] Wed, 27 April 2016 06:09 Go to previous messageGo to next message
taghreed altamimi is currently offline taghreed altamimiFriend
Messages: 173
Registered: October 2014
Senior Member
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 06:10]

Report message to a moderator

Re: rename tag name by EOL [message #1730646 is a reply to message #1730609] Wed, 27 April 2016 10:45 Go to previous messageGo to next message
Antonio Garcia-Dominguez is currently offline Antonio Garcia-DominguezFriend
Messages: 475
Registered: January 2010
Senior Member
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] Thu, 28 April 2016 00:48 Go to previous message
taghreed altamimi is currently offline taghreed altamimiFriend
Messages: 173
Registered: October 2014
Senior Member
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: Fri Jun 22 03:55:04 GMT 2018

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

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

Back to the top