Sponsored Content
Top Forums Shell Programming and Scripting Facing problem in XML::parser module in PERL Post 302384378 by jatanig on Tuesday 5th of January 2010 04:20:23 AM
Old 01-05-2010
Facing problem in XML::parser module in PERL

HI,

I have XML file which is having values as Spanish character (UTF-8 encoding). I am using XML:Smiliearser module but my code is not able to read those characters. I did goggling but not able to find suitable solution. Anybody please help me out.

XML file having characters like: ñ
I am inclusing following lines in code, but it wouldn't work:
open(FOO, "$file");
$parser->parse(*FOO, ProtocolEncoding => 'UTF-8');
close(FOO);

PERL gurus pls help..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

xml parser in perl

hi all i want to read xml file in perl i am using XML::Simple for this. i am not getting how to read following file removing xml file due to some reason (1 Reply)
Discussion started by: zedex
1 Replies

2. Shell Programming and Scripting

Perl XML:Parser help

I am very new to XML. Really I have an excel file that I am trying to read w/ Perl on a Linux machine. I don't have a mod for reading excel files so I have to convert the excel file to xml to be able to read it. I can read the file and everything is ok except...the Number style is being dropped... (0 Replies)
Discussion started by: vincaStar
0 Replies

3. Shell Programming and Scripting

xml-parser with perl

Hello I want to write an xml- parser with perl an i use the libary XML::LibXML. I have a problem with the command getElementsByTagName. If there is an empty tag, the getElementsByTagName method returns a NodeList of length zero. how can i check if this is a nodelist of lenght zero?? i... (1 Reply)
Discussion started by: trek
1 Replies

4. UNIX for Advanced & Expert Users

Apache module & perl problem

I have a very strange problem that I can't seem to solve. I have apache module which filters content and within that module I will add some more content based on this calls: int check; check = system("/usr/bin/check"); check is a perl-script that exits with value 1 if the file doesn't... (2 Replies)
Discussion started by: hjalle
2 Replies

5. Shell Programming and Scripting

Perl - problem with CPAN module XML::Simple

Hi All, I am trying to run the following program #!/usr/bin/perl # use module use XML::Simple; use Data::Dumper; # create object $xml = new XML::Simple; # read XML file $data = $xml->XMLin("dump.xml"); # print output print Dumper($dump); At first i had the error mesage saying... (5 Replies)
Discussion started by: userscript
5 Replies

6. Shell Programming and Scripting

Where to find 64-bit based perl module like XML::Parser::Expat?

Q: Where to get a 64 bit Expat.so? I run a perl script and got this error: Can't load '/usr/perl5/vendor_perl/5.8.4/i86pc-solaris-64int/auto/XML/Parser/Expat/Expat.so' for module XML:parser::Expat: ld.so.1:myPerl: fatal:... (0 Replies)
Discussion started by: lilili07
0 Replies

7. Shell Programming and Scripting

Help required in Building an XML using SAX Parser in perl

I want to use sax parser for my application as i have 5 Lakhs of data. I have the xml file like this <Nodes> <Node> <NodeName>Company</NodeName> <File>employee_details.csv</File> <data>employee_data.txt</data> <Node> <NodeName>dummy</NodeName> ... (8 Replies)
Discussion started by: vanitham
8 Replies

8. AIX

Perl Module (XML:DOM) dependency

Hi All, I am facing dependency on AIX :confused:.I am trying to run an script which requires PERL MODULE (XML::DOM) to be installed. Please find the attached file which shows the error i am getting (cant locate XML/DOM.pm in @INC). Please let me know how to install PERL MODULE (XML::DOM) ... (3 Replies)
Discussion started by: srivatsa86
3 Replies

9. Shell Programming and Scripting

problem during perl module installation

Hi 'm getting error while installing perl mdule on linux.can any one tell me how to resolve that error? problem is: CPAN: File::Temp loaded ok (v0.22) CPAN.pm: Going to build J/JD/JDB/Win32-OLE-0.1709.tar.gz OS unsupported Warning: No success on command Warning (usually harmless):... (1 Reply)
Discussion started by: kavi.mogu
1 Replies

10. Proxy Server

Problem with Installing Perl Module in Fedora 20

Hi, I have downloaded Audio::Beep. I tried to install it through CPAN but i got YAML error. Then I have tried to install it manually. I tried all the instructions provided in README file. It worked but when i am compiling , it still gives me error: # ls acct21.pl~ imap(2).pl ... (15 Replies)
Discussion started by: zak100
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)
All times are GMT -4. The time now is 07:59 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy