Sponsored Content
Top Forums Shell Programming and Scripting XML file parsing using script Post 302357109 by daPeach on Monday 28th of September 2009 05:37:47 PM
Old 09-28-2009
what shell?
what did you try so far?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Parsing and getting data from XML file using ksh script

Hi All, I have a xml file for example as described below <xml> <address> <street><street> <address/> <isbn>426728783932020308393930303</isbn> <book> <name> </name> </book> . . . </xml> My problem is to get the isbn number from the above described file using ksh script. Could... (6 Replies)
Discussion started by: vinna
6 Replies

2. Shell Programming and Scripting

Parsing XML using Shell Script

Hello, I'm a starting shell scripter and no Perl knowledge. I've trying to do this for a while: I want to parse an XML file and get certain data out of it and write that data into a CSV file, all this using Shell Scripting (in Bash). Or Perl without any XML Parser/Interpreter (if possible). ... (1 Reply)
Discussion started by: Kage Musha
1 Replies

3. UNIX for Dummies Questions & Answers

Help parsing a XML file ....

Well I have read several threads on the subject ... but being a newbie like me makes it hard to understand ... What I need is the following: Input data: ------- snip --------- <FavouriteLocations> <FavouriteLocations class="FavouriteList"><Item... (6 Replies)
Discussion started by: misak
6 Replies

4. Shell Programming and Scripting

Parsing xml file

hi guys, great help to the original question, can i expand please? i have large files filled with blocks like this <Placemark> network type: hot line1 line2 line3 <styleUrl>red.png</styleUrl> </Placemark> <Placemark> network type: cold line1 line2 line3... (3 Replies)
Discussion started by: garvald
3 Replies

5. Shell Programming and Scripting

XML parsing in a shell script.

Below is a XML I have... <?xml version="1.0" encoding="UTF-8" ?> <component xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:XXXXX-www-Install-Manifest manifest.xsd" xmlns="urn:qqqqq-Install-Manifest" name="OM" ... (1 Reply)
Discussion started by: dashok.83
1 Replies

6. Shell Programming and Scripting

XML parsing using shell script

I have a xml file like this <bul:collectionStrategy name="strategy1"> <bul:collectionTemplateGroup name="15min group"/> <bul:collectionTemplateGroup name="hourly group"/> </bul:collectionStrategy> <bul:CollectionTemplateGroup name="hourly group" > ... (2 Replies)
Discussion started by: LavanyaP
2 Replies

7. Shell Programming and Scripting

Parsing XML using shell script

Well, issue is i have to parse this script to get the VERSION: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>CFBundleAllowMixedLocalizations</key> ... (9 Replies)
Discussion started by: zorosinister
9 Replies

8. Shell Programming and Scripting

XML: parsing of the Google contacts XML file

I am trying to parse the XML Google contact file using tools like xmllint and I even dived into the XSL Style Sheets using xsltproc but I get nowhere. I can not supply any sample file as it contains private data but you can download your own contacts using this script: #!/bin/sh # imports... (9 Replies)
Discussion started by: ripat
9 Replies

9. UNIX for Dummies Questions & Answers

Parsing XML file

I want to parse xml file sample file....... <name locale="en">my_name<>/name><lastChanged>somedate</lastChanged><some more code here> <name locale="en">tablename1<>/name><lastChanged>somedate</lastChanged> <definition><dbquery><sources><sql type="cognos">select * from... (10 Replies)
Discussion started by: ms2001
10 Replies

10. Shell Programming and Scripting

Help with parsing xml file

Hi, Need help with parsing xml data in unix and place it in a csv file. My xml file looks like this: <?xml version="1.0" encoding="UTF-8" standalone="yes" ?> <iwgroups> <nextid value="128"> </nextid> <iwgroup name="RXapproval" id="124" display-name="RXapproval"... (11 Replies)
Discussion started by: ajayakunuri
11 Replies
Node(3pm)						User Contributed Perl Documentation						 Node(3pm)

NAME
XML::Node - Node-based XML parsing: an simplified interface to XML::Parser SYNOPSIS
use XML::Node; $xml_node = new XML::Node; $xml_node->register( $nodetype, $callback_type => &callback_function ); $xml_node->register( $nodetype, $callback_type => $variable ); open(FOO, 'xmlgenerator |'); $p3->parse(*FOO); close(FOO); $xml_node->parsefile( $xml_filename ); DESCRIPTION
If you are only interested in processing certain nodes in an XML file, this module can help you simplify your Perl scripts significantly. The XML::Node module allows you to register callback functions or variables for any XML node. If you register a call back function, it will be called when the node of the type you specified are encountered. If you register a variable, the content of a XML node will be appended to that variable automatically. Subroutine register accepts both absolute and relative node registrations. Here is an example of absolute path registration: 1. register(">TestCase>Name", "start" => &handle_TestCase_Name_start); Here are examples of single node name registration: 2. register( "Name", "start" => &handle_Name_start); 3. register( "Name", "end" => &handle_Name_end); 4. register( "Name", "char" => &handle_Name_char); Here is an example of attribute registration: 5. register(">TestCase:Author", "attr" => $testcase_author); Abosolute path trigger condition is recommended because a "Name" tage could appear in different places and stands for differe names. Example: 1 <Testcase> 2 <Name>Something</Name> 3 <Oracle> 4 <Name>Something</Name> 5 </Oracle> 6 </Testcase> Statement 1 causes &handle_TestCase_Name_start to be called when parsing Line 2. Statements 2,3,4 cause the three handler subroutines to be called when parsing both Line 2 and Line 4. This module uses XML::Parser. EXAMPLE
Examples "test.pl" and "parse_orders.pl" come with this perl module. SEE ALSO
XML::Parser NOTE
When you register a variable, XML::Node appends strings found to that variable. So please be sure to clear that variable before it is used again. AUTHORS
Chang Liu <liu@ics.uci.edu> LAST MODIFIED
$Date: 2001/12/10 11:38:28 $ perl v5.10.0 2001-12-11 Node(3pm)
All times are GMT -4. The time now is 03:23 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy