Sponsored Content
Top Forums Shell Programming and Scripting Get extract text from xml file Post 302794699 by Jewel on Tuesday 16th of April 2013 01:11:49 PM
Old 04-16-2013
Get extract text from xml file

Hi Collegue,

i have a file say a.xml. it has contents
Code:
<bpelFault><faultType>1</faultType><genericSystemFault xmlns=""><part name="payload"><v2:Fault xmlns:v2="https://www.unix.com/newthread.php?do=newthread&f=30[/SIZE][SIZE=3]"><v2:BusinessScopeReference><v2:BusinessIdentifier>1-MFB0QR</v2:BusinessIdentifier><v2:EnterpriseServiceName>AccountSyncIVS_BRM_2.0</v2:EnterpriseServiceName><v2:EnterpriseServiceOperationName>syncAccount</v2:EnterpriseServiceOperationName></v2:BusinessScopeReference><v2:FaultNotification><v2:ReportingDateTime>2013-04-05T09:46:31.720+11:00</v2:ReportingDateTime><v2:FaultMessage><v2:Code>CORE_SYS_GENERIC</v2:Code><v2:Text>Error from the BRM Adapter : env:Server</v2:Text><v2:ApplicationFaultData>CORE_SYS_GENERIC - Error from the BRM Adapter : env:Server</v2:ApplicationFaultData></v2:FaultMessage><v2:FaultingService><v2:systemProviderID>03</v2:systemProviderID><v2:serviceOperation>VF_EAI_OP_CUST_MAINTAIN_BILLING_PROF </v2:serviceOperation><v2:Code>1201321</v2:Code><v2:Text>FusionId: 50031: A INF application error has occurred: 1201321DeterminateError - 
FList.java:0: ErrBuf Fields:
Error=null    Loc=FM
Field=PIN_FLD_POID    Rec=0    reserved=0
Facility=0    MessageID=0    Time=10:00 AM    Version=0    Reserved2=0
Args=&lt;none>
Nested Error:
&lt;none>
DeterminateError - 
FList.java:0: ErrBuf Fields:
Error=null    Loc=FM
Field=PIN_FLD_POID    Rec=0    reserved=0
Facility=0    MessageID=0    Time=10:00 AM    Version=0    Reserved2=0
Args=&lt;none>
Nested Error:
&lt;none>
</v2:Text></v2:FaultingService></v2:FaultNotification></v2:Fault></part></genericSystemFault></bpelFault>

i need the text between <v2:Text> and </v2:Text>. that is given as below.
Code:
Error from the BRM Adapter : env:Server
FusionId: 50031: A INF application error has occurred: 1201321DeterminateError - 
FList.java:0: ErrBuf Fields:
Error=null    Loc=FM
Field=PIN_FLD_POID    Rec=0    reserved=0
Facility=0    MessageID=0    Time=10:00 AM    Version=0    Reserved2=0
Args=&lt;none>
Nested Error:
&lt;none>
DeterminateError - 
FList.java:0: ErrBuf Fields:
Error=null    Loc=FM
Field=PIN_FLD_POID    Rec=0    reserved=0
Facility=0    MessageID=0    Time=10:00 AM    Version=0    Reserved2=0
Args=&lt;none>
Nested Error:
&lt;none>

quick must be appriciated.
Thanks,
Jewel

Last edited by Corona688; 04-16-2013 at 02:51 PM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to extract text from xml file

I have some xml files that got created by exporting a website from RedDot. I would like to extract the cost, course number, description, and meeting information. <?xml version="1.0" encoding="UTF-16" standalone="yes" ?> - <PAG PAG0="3AE6FCFD86D34896A82FCA3B7B76FF90" PAG3="525312"... (3 Replies)
Discussion started by: chrisf
3 Replies

2. Shell Programming and Scripting

extract a number within an xml file

Hi Everyone, I have an sh script that I am working on and I have run into a little snag that I am hoping someone here can assist me with. I am using wget to retrieve an xml file from thetvdb.com. This part works ok but what I need to be able to do is extract the series ID # from the xml and put... (10 Replies)
Discussion started by: tret
10 Replies

3. Shell Programming and Scripting

Extract XML content from a file

310439 2012-01-11 03:44:42,291 INFO PutServlet:? - Content of the Message is:="1.0" encoding="UTF-8"?><ESP_SSIA_ACC_FEED> 310440 <BATCH_ID>12345678519</BATCH_ID> 310441 <UID>3498748823</UID> 310442 <FEED_TYPE>FULL</FEED_TYPE> 310443 <MART_NAME>SSIA_DM_TRANSACTIONS</MART_NAME> 310444... (11 Replies)
Discussion started by: arukuku
11 Replies

4. Shell Programming and Scripting

sed - extract text from xml file

hi, please help, i have an xml file, e.g: ... <tag> test text asdas="${abc}" xvxvbs:asdas${222}sdad asasa="${aa_bb_22}" </tag> ... i want to extract all "${...}", e.g: ${abc} ${222} ${aa_bb_22} thank you. (2 Replies)
Discussion started by: gioni
2 Replies

5. Shell Programming and Scripting

Extract values from an XML File

Hi, I need to capture all the attributes with delete next to it. The source XML file is attached. The output should contain something like this below: Attributes = legacyExchangeDN Action = Delete Username = Hero Joker Loginid = joker09 OU =... (4 Replies)
Discussion started by: prvnrk
4 Replies

6. Shell Programming and Scripting

Extract a particular xml only from an xml jar file

Hi..need help on how to extract a particular xml file only from an xml jar file... thanks! (2 Replies)
Discussion started by: qwerty000
2 Replies

7. Shell Programming and Scripting

Extract Data from XML file.

Hi Guys, I am in a need to extract data from a xml file. The XML file format is as below. <data jsxnamespace="propsbundle" locales=""> <locale> <!--Error messages starts--> <record jsxid="CHARPAIR001" jsxtext=" must be selected"></record> <record... (1 Reply)
Discussion started by: Showdown
1 Replies

8. UNIX for Dummies Questions & Answers

Extract Element from XML file

<?xml version = '1.0' encoding =... (8 Replies)
Discussion started by: Siva SQL
8 Replies

9. Shell Programming and Scripting

Extract a value from an xml file

I have this XML file format and all in one line: Fri Dec 23 00:14:52 2016 Logged Message:689|<?xml version="1.0" encoding="UTF-8"?><PORT_RESPONSE><HEADER><ORIGINATOR>XMG</ORIGINATOR><DESTINAT... (16 Replies)
Discussion started by: mrn6430
16 Replies

10. Programming

How to write in other language in text/xml file by reading english text/xml file using C++?

Hello Team, I have 2 files.one contains english text and another contains Japanese. so i have to read english text and replace the text with Japanesh text in third file. Basically, I need a help to write japanese language in text/xml file.I heard wstring does this.Not sure how do i write... (2 Replies)
Discussion started by: SA_Palani
2 Replies
XML_PP(1p)						User Contributed Perl Documentation						XML_PP(1p)

NAME
xml_pp - xml pretty-printer SYNOPSYS
xml_pp [options] [<files>] DESCRIPTION
XML pretty printer using XML::Twig OPTIONS
-i[<extension>] edits the file(s) in place, if an extension is provided (no space between "-i" and the extension) then the original file is backed-up with that extension The rules for the extension are the same as Perl's (see perldoc perlrun): if the extension includes no "*" then it is appended to the original file name, If the extension does contain one or more "*" characters, then each "*" is replaced with the current filename. -s <style> the style to use for pretty printing: none, nsgmls, nice, indented, record, or record_c (see XML::Twig docs for the exact description of those styles), 'indented' by default -p <tag(s)> preserves white spaces in tags. You can use several "-p" options or quote the tags if you need more than one -e <encoding> use XML::Twig output_encoding (based on Text::Iconv or Unicode::Map8 and Unicode::String) to set the output encoding. By default the original encoding is preserved. If this option is used the XML declaration is updated (and created if there was none). Make sure that the encoding is supported by the parser you use if you want to be able to process the pretty_printed file (XML::Parser does not support 'latin1' for example, you have to use 'iso-8859-1') -l loads the documents in memory instead of outputing them as they are being parsed. This prevents a bug (see BUGS) but uses more memory -f <file> read the list of files to process from <file>, one per line -v verbose (list the current file being processed) -- stop argument processing (to process files that start with -) -h display help EXAMPLES
xml_pp foo.xml > foo_pp.xml # pretty print foo.xml xml_pp < foo.xml > foo_pp.xml # pretty print from standard input xml_pp -v -i.bak *.xml # pretty print .xml files, with backups xml_pp -v -i'orig_*' *.xml # backups are named orig_<filename> xml_pp -i -p pre foo.xhtml # preserve spaces in pre tags xml_pp -i.bak -p 'pre code' foo.xml # preserve spaces in pre and code tags xml_pp -i.bak -p pre -p code foo.xml # same xml_pp -i -s record mydb_export.xml # pretty print using the record style xml_pp -e utf8 -i foo.xml # output will be in utf8 xml_pp -e iso-8859-1 -i foo.xml # output will be in iso-8859-1 xml_pp -v -i.bak -f lof # pretty print in place files from lof xml_pp -- -i.xml # pretty print the -i.xml file xml_pp -l foo.xml # loads the entire file in memory # before pretty printing it xml_pp -h # display help BUGS
Elements with mixed content that start with an embedded element get an extra <elt><b>b</b>toto<b>bold</b></elt> will be output as <elt> <b>b</b>toto<b>bold</b></elt> Using the "-l" option solves this bug (but uses more memory) TODO
update XML::Twig to use Encode with perl 5.8.0 AUTHOR
Michel Rodriguez <mirod@xmltwig.com> perl v5.12.4 2011-05-18 XML_PP(1p)
All times are GMT -4. The time now is 03:53 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy