Sponsored Content
Top Forums Shell Programming and Scripting Insert a new line between the XML tags?. Post 302735531 by laknar on Sunday 25th of November 2012 02:05:59 PM
Old 11-25-2012
Insert a new line between the XML tags?.

Code:
<TestLog>
<TriggerAPI>
<StartDate>Nov 16, 2012 6:34:02 AM com.satttest01.Response() </StartDate>
<RequestType>SUCCESS: Send :</RequestType>
        <TranNumber>5210203</TranNumber>
        <TranId>8585319731207148</TranId>
</TriggerAPI>
<TriggerAPI>
<StartDate>Nov 16, 2012 6:34:02 AM com.satttest01.Response() </StartDate>
<RequestType>FAILED: Receive :</RequestType>
        <TranNumber>5210203</TranNumber>
        <TranId>8585319731207148</TranId>
</TriggerAPI>
</TestLog>

Expected output

Code:
<TestLog>
<TriggerAPI>
<StartDate>Nov 16, 2012 6:34:02 AM</StartDate>
<RequestType>Send :</RequestType>
        <Status>SUCCESS</Status>
        <TranNumber>5210203</TranNumber>
        <TranId>8585319731207148</TranId>
</TriggerAPI>
<TriggerAPI>
<StartDate>Nov 16, 2012 6:34:02 AM</StartDate>
<RequestType>Receive :</RequestType>
        <Status>FAILED</Status>
        <TranNumber>5210203</TranNumber>
        <TranId>8585319731207148</TranId>
</TriggerAPI>
</TestLog>

Split a element into another element within xml.
can anyone suggest me?.

Last edited by Scrutinizer; 11-25-2012 at 03:33 PM.. Reason: icode to code tags
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Closing XML tags in one line

Any one can help Example having an spml output as below (the complete one has more than 10000 tags): ============= <ts11> <msisdn>123</msisdn> <bcieID>TELEPHON</bcieID> </ts11> <ts21> <msisdn>987</msisdn> </ts21> ... ======= I want to have every tag closed in one line ... (10 Replies)
Discussion started by: hafidiw
10 Replies

2. Shell Programming and Scripting

How to add the multiple lines of xml tags before a particular xml tag in a file

Hi All, I'm stuck with adding multiple lines(irrespective of line number) to a file before a particular xml tag. Please help me. <A>testing_Location</A> <value>LA</value> <zone>US</zone> <B>Region</B> <value>Russia</value> <zone>Washington</zone> <C>Country</C>... (0 Replies)
Discussion started by: mjavalkar
0 Replies

3. Shell Programming and Scripting

Insert value of env variable in xml file

Hello, I have the following variables set in my env echo $MY_XSD_FILE /home/jak/sample.xsd echo $MY_INTERVAL_VALUE 4 I want to insert them between the xml tags in my xml file cat sample.xml ::::::::::::::: ::::::::::::::: <property name="FILE"></property> :::::::::::::::::::::::... (2 Replies)
Discussion started by: jakSun8
2 Replies

4. Shell Programming and Scripting

Insert a new subnode in a xml file

Hi, i have an xml file and i want to edit a new sub node in a file like val="<activity android:label="@string/app_name" android_name=".MainActivity1" android:launchMode="singleTask" android:screenOrientation="portrait" ... (1 Reply)
Discussion started by: gautamshrm3
1 Replies

5. Shell Programming and Scripting

Shell Command to compare two xml lines while ignoring xml tags

I've got two different files and want to compare them. File 1 : HTML Code: <response ticketId="944" type="getQueryResults"><status>COMPLETE</status><description>Query results fetched successfully</description><recordSet totalCount="1" type="sms_records"><record... (1 Reply)
Discussion started by: Shaishav Shah
1 Replies

6. Shell Programming and Scripting

How to add Xml tags to an existing xml using shell or awk?

Hi , I have a below xml: <ns:Body> <ns:result> <Date Month="June" Day="Monday:/> </ns:result> </ns:Body> i have a lookup abc.txtt text file with below details Month June July August Day Monday Tuesday Wednesday I need a output xml with below tags <ns:Body> <ns:result>... (2 Replies)
Discussion started by: Nevergivup
2 Replies

7. Shell Programming and Scripting

Insert a newline in XML

Hi guys, I got a requirement that ... (5 Replies)
Discussion started by: mohanalakshmi
5 Replies

8. Shell Programming and Scripting

How to insert new line in xml?

I have an xml like below and wanted to insert a new line between end of the tag and start of the new tag. <partyaddress><addressline1>gandhi stree</addressline1><city>hyderbad</city><state>AP</state><addressline1>xyz stree</addressline1><city>bangalore</city><state>Karnataka</state>... (6 Replies)
Discussion started by: D_Sethi
6 Replies

9. Shell Programming and Scripting

Cutting all xml tags out of a line

I would like search and find a word (easily identified by 'key') from an xml file and then cut all of the tags out of the resulting line (anything between a < and a >) and display the remaining material. I am running Debian and mksh shell. dictionary.sh: #!/bin/sh key='key="'$1'"><form'... (3 Replies)
Discussion started by: bedtime
3 Replies

10. UNIX for Beginners Questions & Answers

How to pull multiple XML tags from the same XML file in Shell.?

I'm searching for the names of a TV show in the XML file I've attached at the end of this post. What I'm trying to do now is pull out/list the data from each of the <SeriesName> tags throughout the document. Currently, I'm only able to get data the first instance of that XML field using the... (9 Replies)
Discussion started by: hungryd
9 Replies
WebService::MusicBrainz::Response(3pm)			User Contributed Perl Documentation		    WebService::MusicBrainz::Response(3pm)

NAME
WebService::MusicBrainz::Response SYNOPSIS
DESCRIPTION
This module will hide the details of the XML web service response and provide an API to query the XML data which has been returned. This module is responsible for parsing the XML web service response and instantiating objects to provide access to the details of the response. METHODS
new() This method is the constructor and it will call for initialization. xpc() as_xml() This method returns the raw XML from the MusicBrainz web service response. generator() This method will return an optional value of the generator. created() This method will return an optional value of the created date. score() This method will return an optional value of the relevance score. metadata() This method will return an Response::Metadata object. artist() This method will return an Response::Artist object. release() This method will return an Reponse::Release object;. track() This method will return an Response::Track object. label() This method will return an Response::Label object. artist_list() This method will return a reference to the Response::ArtistList object in a scalar context. If in a array context, an array of Response::Artist objects will be returned. release_list() This method will return a reference to the Response::ReleaseList object in a scalar context. If in a array context, an array of Response::Release objects will be returned. track_list() This method will return a reference to the Response::TrackList object in a scalar context. If in a array context, an array of Response::Track objects will be returned. label_list() This method will return a reference to the Response::LabelList object in a scalar context. If in a array context, an array of Response::Label objects will be returned. AUTHOR
Bob Faist <bob.faist@gmail.com> COPYRIGHT AND LICENSE
Copyright 2006-2007 by Bob Faist This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. SEE ALSO
http://wiki.musicbrainz.org/XMLWebService perl v5.10.1 2009-12-06 WebService::MusicBrainz::Response(3pm)
All times are GMT -4. The time now is 10:22 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy