--- nfo/perl/libs/Data/Storage/Handler/XML.pm 2003/02/20 20:20:54 1.1 +++ nfo/perl/libs/Data/Storage/Handler/XML.pm 2003/05/13 08:08:17 1.3 @@ -1,7 +1,13 @@ ## ------------------------------------------------------------------------ -## $Id: XML.pm,v 1.1 2003/02/20 20:20:54 joko Exp $ +## $Id: XML.pm,v 1.3 2003/05/13 08:08:17 joko Exp $ ## ------------------------------------------------------------------------ ## $Log: XML.pm,v $ +## Revision 1.3 2003/05/13 08:08:17 joko +## comments, todos +## +## Revision 1.2 2003/02/21 07:58:48 joko +## enhanced error detection +## ## Revision 1.1 2003/02/20 20:20:54 joko ## + initial commit ## @@ -25,14 +31,14 @@ use XML::Parser; use XML::Parser::EasyTree; use XML::XPath; - +# TODO: use XML::Writer and/or XML::ValidWriter sub sendQuery { my $self = shift; my $xpq = shift; my $options = shift; - $self->log( "xpq='$xpq'", 'info' ); + $self->log( "xpq='$xpq'", 'debug' ); # trace #print Dumper($self); @@ -40,6 +46,11 @@ my $file = $self->{filename}; + if (!$file) { + $self->log("No filename given.", 'error'); + return; + } + if (! -e $file) { $self->log("File not found: '$file'.", 'error'); return; @@ -89,6 +100,11 @@ my $self = shift; $XML::Parser::EasyTree::Noempty = 1; + # what about ... + #$XML::Parser::EasyTree::Latin = 1; + # ... instead of an otherwise required + # "expand" with proper utf8/latin-conversion + # parameters set? # convert xml data to native perl data structure #my $parser = XML::Parser->new( Style => 'EasyTree', Handlers => { Char => sub { my $char = shift; print "char: ", Dumper($char), "\n"; } } );