/[cvs]/nfo/perl/libs/Data/Storage/Handler/XML.pm
ViewVC logotype

Diff of /nfo/perl/libs/Data/Storage/Handler/XML.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.3 by joko, Tue May 13 08:08:17 2003 UTC revision 1.5 by joko, Fri Dec 5 04:52:40 2003 UTC
# Line 2  Line 2 
2  ##  $Id$  ##  $Id$
3  ## ------------------------------------------------------------------------  ## ------------------------------------------------------------------------
4  ##  $Log$  ##  $Log$
5    ##  Revision 1.5  2003/12/05 04:52:40  joko
6    ##  + minor update: changed some loglevel to debug
7    ##
8    ##  Revision 1.4  2003/06/06 03:58:13  joko
9    ##  minor updates to logging
10    ##
11  ##  Revision 1.3  2003/05/13 08:08:17  joko  ##  Revision 1.3  2003/05/13 08:08:17  joko
12  ##  comments, todos  ##  comments, todos
13  ##  ##
# Line 25  use base qw( Line 31  use base qw(
31  );  );
32    
33    
34    # TODO: Load them on demand!
35  use Data::Dumper;  use Data::Dumper;
36  #use Data::Storage::Handler::File::Basic qw( s2f a2f f2s );  #use Data::Storage::Handler::File::Basic qw( s2f a2f f2s );
37  use XML::Simple;  use XML::Simple;
# Line 33  use XML::Parser::EasyTree; Line 40  use XML::Parser::EasyTree;
40  use XML::XPath;  use XML::XPath;
41  # TODO: use XML::Writer and/or XML::ValidWriter  # TODO: use XML::Writer and/or XML::ValidWriter
42    
43    
44    # get logger instance
45    my $logger = Log::Dispatch::Config->instance;
46    
47  sub sendQuery {  sub sendQuery {
48    my $self = shift;    my $self = shift;
49    my $xpq = shift;    my $xpq = shift;
# Line 47  sub sendQuery { Line 58  sub sendQuery {
58    my $file = $self->{filename};    my $file = $self->{filename};
59        
60    if (!$file) {    if (!$file) {
61      $self->log("No filename given.", 'error');      $logger->error("No filename given.");
62      return;      return;
63    }    }
64        
65    if (! -e $file) {    if (! -e $file) {
66      $self->log("File not found: '$file'.", 'error');      $logger->error("File not found: '$file'.");
67      return;      return;
68    }    }
69    
70    #print "file: $file", "\n";    #print "file: $file", "\n";
71    #print "xpq: $xpq", "\n";    #print "xpq: $xpq", "\n";
72      
73      $logger->debug( __PACKAGE__ . "->sendQuery - File: $file, xpq: $xpq");
74    
75    # filter nodes by xpath-query    # filter nodes by xpath-query
76      my $xp = XML::XPath->new( filename => $file );      my $xp = XML::XPath->new( filename => $file );
77      my $nodeset = $xp->find($xpq);      my $nodeset = $xp->find($xpq);

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.5

MailToCvsAdmin">MailToCvsAdmin
ViewVC Help
Powered by ViewVC 1.1.26 RSS 2.0 feed