10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
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
2. UNIX for Dummies Questions & Answers
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
3. Shell Programming and Scripting
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
4. Shell Programming and Scripting
for some reasons, i need to parse the XML result by using perl.
for instance, this is a sample XML result:
<Response>
<status>success</status>
<answer>AAA::AAA</answer>
<answer>BBB::BBB</answer>
</Response>
then i can use this way :
my @output = ();
foreach my $parts (@all) ##@all... (2 Replies)
Discussion started by: tiger2000
2 Replies
5. Shell Programming and Scripting
Hello!
We need to parse weblogic config.xml file and display rows in format:
machine:listen-port:name:application_name
In our enviroment the output should be (one line for every instance):
Crm-Test-Web:8001:PIA:peoplesoft
Crm-Test-Web:8011:PIA:peoplesoft... (9 Replies)
Discussion started by: annar
9 Replies
6. Shell Programming and Scripting
I have a bash script that needs to read input from an XML file, which includes varying numbers of a certain type of child node. I want to be able to iterate through all the child nodes of a given parent. I installed the Perl XML-XPath package from
search.cpan.org. Once it's installed, from bash,... (4 Replies)
Discussion started by: jfmorales
4 Replies
7. Shell Programming and Scripting
Given the XML:
<?xml version="1.0" encoding="UTF-8"?>
<reference>
<refbody>
<section>
<p>
<ul>
<li><xref href="file1.dita#anchor" /></li>
<li><xref href="file2.dita#anchor" /></li>
</ul>
</p>
</section>
<section>
<p>
<xref href="file3.dita#anchor" />
</p>
<p>
<xref... (4 Replies)
Discussion started by: ricksj
4 Replies
8. UNIX for Dummies Questions & Answers
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
9. UNIX for Advanced & Expert Users
******************PERL VERSION************************
This is perl, v5.8.1 built for i386-linux-thread-multi
ERROR!!!!---Undefined subroutine &main::start called at /usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi/XML/Parser/Expat.pm line 469.
*********************PERL... (1 Reply)
Discussion started by: bishweshwar
1 Replies
10. Shell Programming and Scripting
I have a PERL script from which I need to make a HTTP request to Web Servlet (Essentially a URL with variables and values like &Variable1=AAAAAA&Variable2=BBBBBBBBB&Variable3=CCCCCCC). The Web servlet returns an XML result which needs to be parsed for the contents of the result within the program.... (15 Replies)
Discussion started by: jerardfjay
15 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)