LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-26-2015, 01:22 PM   #1
pandeg
LQ Newbie
 
Registered: Feb 2015
Posts: 2

Rep: Reputation: Disabled
Changing XML property Value


Hi, I am using a XML file in server location which contains some attributes and value.I just want to replace the attribute value inside the tag keeping the complete line and xml file intact. I am looking for Regular expression which can search for attribute name and replace the attribute value with the provided one. Please find below property details.

<server>
<mbean code="com.xyz.domain.wsmq.WSMQConnectionFactory"
name="xyz.qps:service=MQQueueConnectionFactory">
<attribute name="QueueManagerName">QMSTR01</attribute>
<attribute name="HostName">xx.yy.zz.ww</attribute>
<attribute name="Channel">channel01</attribute>
<depends>jboss:service=Naming</depends>
</mbean>
</server>
 
Old 02-26-2015, 01:26 PM   #2
pandeg
LQ Newbie
 
Registered: Feb 2015
Posts: 2

Original Poster
Rep: Reputation: Disabled
I found one regular expression as mentioned below using sed from below link , but it is throwing throwing error.

http://blog.avisi.nl/2013/08/14/chan...comment-362425

Reg Expression: sed -i '' 's/\(<[^"]*"QueueManagerName">\)\([^<]*\)\(<[^>]*\)/\1QMSTG01\3/g' jboss-service.xml

Error Message: sed: can't read s/\(<[^"]*"QueueManagerName">\)\([^<]*\)\(<[^>]*\)/\1QMSTG01\3/g: No such file or directory
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Publisher 'DRMs' Physical Legal Textbook About 'Property,' Undermines Property And First Sale LXer Syndicated Linux News 0 05-08-2014 08:11 AM
changing the property of inetd controlled service balakodoth Linux - Newbie 3 01-04-2011 10:23 PM
LXer: "Intellectual Property" a Violation of Real Property LXer Syndicated Linux News 1 11-11-2009 06:39 AM
Songbird iTunes importer, xml file, help with changing pathnames shortman101n Linux - Newbie 0 12-22-2008 02:17 PM
JavaScript: Changing a class property tumana Programming 2 02-15-2006 02:35 AM


All times are GMT -5. The time now is 02:53 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration