CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Perl Programming Help: Advanced:
XML::Parser help


New User

Mar 31, 2008, 1:41 PM

Post #1 of 3 (1962 views)
XML::Parser help Can't Post

In the case that there are two cells under one row, I can only read the first cell. If anyone thinks they know how to deal with this please let me know...or another place that I can go to get help?

#XML code:
<Cell><Data ss:Type="String">Loved</Data></Cell>
<Cell ss:Index="3"><Data ss:Type="Number">3.0</Data></Cell>
<Cell ss:MergeAcross="1"><Data ss:Type="String">12-18 months</Data></Cell>

#Perl code:
use XML::Parser;
$xp=new XML::Parser();
$xp->setHandlers(Start => \&start, End => \&end, Char => \&cdata);
sub start(){
my ($p, $name, %attr) = @_;
$ctag = lc($name);
sub cdata(){
my ($parser, $target, $data) = @_;
if (lc($target) == "cell"{
if (($target=~/\w|\d/) && ($target ne "False" && ($target !~ /#/)){
push @array, $target;
sub end(){
my ($p, $name) = @_;
$ctag = lc($name);
foreach $a (@array){
print $a."<br>";

12-18 months


Mar 31, 2008, 1:46 PM

Post #2 of 3 (1960 views)
Re: [tiffbrink] XML::Parser help [In reply to] Can't Post

I just posted a reply to this same question on

New User

Mar 31, 2008, 2:08 PM

Post #3 of 3 (1958 views)
Re: [KevinR] XML::Parser help [In reply to] Can't Post

Hey! Thanks for the reply. Although that was the problem the fix was a little different...used if (lc($target)){ and it worked perfectly.


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives