----- Original Message -----
From: "Raghu Karamel" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Sunday, July 14, 2002 8:27 AM
Subject: Re: DBD::AnyData and Windows 2000


>
> I do have all the required modules installed in the system. I am actually
> trying to process the XML using DBD::AnyData and it throws the following
> error when I am trying use XML with AnyData
>
> illegal option TableName at C:/Perl/site/lib/AnyData/Format/XML.pm
line 718
(snip)
Well, those carps must be not good code.
I found that AnyData::Format::XML (XML.pm) may have a bug:
(or XML::Twig ?)
AnyData::Format::XML 0.05 (XML.pm)  : line 582
  sub check_twig_options {
      my $flags = shift;
      my $new_flags;
      my %twig_opt = %XML::Twig::valid_option;
      return $flags unless scalar (keys %twig_opt);

It looks "%XML::Twig::valid_option" but it must be empty.
Change XML::Twig 3.02 (Twig.pm) like below:
line : 23
<- use vars qw($VERSION @ISA);
-> use vars qw($VERSION %valid_option @ISA);

line : 264
<- my %valid_option=
-> %valid_option=

These changes must avoid those carps.

> SQL ERROR: Bad table or column name '1' starts with non-alphabetic
> character!
Maybe you just use wrong format or something.

[t1.pl]
use strict;
use DBI;
my $dbh = DBI->connect( 'dbi:AnyData:', undef, undef,
        {RaiseError=>1, AutoCommit=>1} );
$dbh->func('mytable','XML','t1.xml', undef, 'ad_catalog');
my $sth = $dbh->prepare('select * from mytable');
$sth->execute();
my $raRes;
while($raRes=$sth->fetchrow_arrayref()) {
    print "ROW:", join("::", @$raRes), "\n";
}
$sth->finish;
$dbh->disconnect;

[t1.xml]
<table>
    <row row_id="1"><name>Joe</name><location>Seattle</location></row>
    <row row_id="2"><name>Sue</name><location>Portland</location></row>
</table>

[result]
ROW:1::Joe::Seattle
ROW:2::Sue::Portland

[Environment]
WinXP HomeEdtion +ActivePerl Build633

==============================================
Kawai, Takanori(Hippo2000)
   Mail: [EMAIL PROTECTED] [EMAIL PROTECTED]
   http://member.nifty.ne.jp/hippo2000/index_e.htm
   http://www.hippo2000.info/cgi-bin/KbWikiE/KbWiki.pl
The Perl Foundation Grants Are Running Out ?
   http://use.perl.org/articles/02/07/03/2241212.shtml
   http://www.perl-foundation.org/index.cgi?page=grants
==============================================

Reply via email to