Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 02-26-2015, 12:22 PM   #1
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.

<mbean code=""
<attribute name="QueueManagerName">QMSTR01</attribute>
<attribute name="HostName">xx.yy.zz.ww</attribute>
<attribute name="Channel">channel01</attribute>
Old 02-26-2015, 12:26 PM   #2
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.

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


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 07:11 AM
changing the property of inetd controlled service balakodoth Linux - Newbie 3 01-04-2011 09:23 PM
LXer: "Intellectual Property" a Violation of Real Property LXer Syndicated Linux News 1 11-11-2009 05:39 AM
Songbird iTunes importer, xml file, help with changing pathnames shortman101n Linux - Newbie 0 12-22-2008 01:17 PM
JavaScript: Changing a class property tumana Programming 2 02-15-2006 01:35 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:21 AM.

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