/[cwmp]/google/trunk/lib/CWMP/Request.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /google/trunk/lib/CWMP/Request.pm

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

revision 31 by dpavlin, Mon Jun 18 20:07:17 2007 UTC revision 50 by dpavlin, Tue Jun 19 21:29:04 2007 UTC
# Line 68  my $parser = XML::Rules->new( Line 68  my $parser = XML::Rules->new(
68                  #                  #
69                  # Inform                  # Inform
70                  #                  #
71                    'Inform' => sub {
72                            $state->{_dispatch} = 'Inform';         # what reponse to call
73                    },
74                  qr/DeviceId/ => sub {                  qr/DeviceId/ => sub {
75                          my ($tag_name, $tag_hash, $context, $parent_data) = @_;                          my ($tag_name, $tag_hash, $context, $parent_data) = @_;
76                          foreach my $name ( keys %$tag_hash ) {                          foreach my $name ( keys %$tag_hash ) {
# Line 99  my $parser = XML::Rules->new( Line 102  my $parser = XML::Rules->new(
102                          my ($tag_name, $tag_hash, $context, $parent_data) = @_;                          my ($tag_name, $tag_hash, $context, $parent_data) = @_;
103                          $state->{MethodList} = _tag( $tag_hash, 'string' );                          $state->{MethodList} = _tag( $tag_hash, 'string' );
104                  },                        },      
105                    #
106                    # Fault
107                    #
108                    qr/^Fault$/ => sub {
109                            my ($tag_name, $tag_hash, $context, $parent_data) = @_;
110                            $state->{Fault} = {
111                                    FaultCode => _tag( $tag_hash, 'FaultCode', '_content' ),
112                                    FaultString => _tag( $tag_hash, 'FaultString', '_content' ),
113                            };
114                            warn "FAULT: ", $state->{Fault}->{FaultCode}, " ", $state->{Fault}->{FaultString}, "\n";
115                    }
116          ]          ]
117  );  );
118    
# Line 117  sub parse { Line 131  sub parse {
131          $parser->parsestring( $xml );          $parser->parsestring( $xml );
132          return $state;          return $state;
133  }  }
134    
135    1;

Legend:
Removed from v.31  
changed lines
  Added in v.50

  ViewVC Help
Powered by ViewVC 1.1.26