19 |
|
|
20 |
=cut |
=cut |
21 |
|
|
|
my $tree = CWMP::Tree->new({ debug => 0 }); |
|
|
|
|
22 |
our $state; # FIXME check this! |
our $state; # FIXME check this! |
23 |
|
|
24 |
my $rules = [ |
my $rules = [ |
95 |
|
|
96 |
confess "need state" unless ( $state ); # don't remove! |
confess "need state" unless ( $state ); # don't remove! |
97 |
|
|
|
=for obsolete |
|
|
|
|
|
# XXX dragons ahead: convert name to tree rewriting it into perl |
|
|
my $s = '$state->{ParameterInfo}->' . $tree->name2perl( $name ) . "->{writable} = $writable;"; |
|
|
eval "$s"; |
|
|
confess "can't eval $s : $@" if ($@); |
|
|
|
|
|
=cut |
|
|
|
|
98 |
$state->{ParameterInfo}->{$name} = $writable; |
$state->{ParameterInfo}->{$name} = $writable; |
99 |
|
|
100 |
#warn "## state = dump( $state ), "\n"; |
#warn "## state = dump( $state ), "\n"; |
117 |
$state->{_trigger} = 'Fault'; |
$state->{_trigger} = 'Fault'; |
118 |
}; |
}; |
119 |
|
|
|
my $parser = XML::Rules->new( |
|
|
# start_rules => [ |
|
|
# '^division_name,fax' => 'skip', |
|
|
# ], |
|
|
namespaces => { |
|
|
'http://schemas.xmlsoap.org/soap/envelope/' => 'soapenv', |
|
|
'http://schemas.xmlsoap.org/soap/encoding/' => 'soap', |
|
|
'http://www.w3.org/2001/XMLSchema' => 'xsd', |
|
|
'http://www.w3.org/2001/XMLSchema-instance' => 'xsi', |
|
|
'urn:dslforum-org:cwmp-1-0' => '', |
|
|
}, |
|
|
rules => $rules, |
|
|
); |
|
|
|
|
120 |
=head1 METHODS |
=head1 METHODS |
121 |
|
|
122 |
=head2 parse |
=head2 parse |
130 |
|
|
131 |
my $xml = shift || confess "no xml?"; |
my $xml = shift || confess "no xml?"; |
132 |
|
|
133 |
|
my $parser = XML::Rules->new( |
134 |
|
# start_rules => [ |
135 |
|
# '^division_name,fax' => 'skip', |
136 |
|
# ], |
137 |
|
namespaces => { |
138 |
|
'http://schemas.xmlsoap.org/soap/envelope/' => 'soapenv', |
139 |
|
'http://schemas.xmlsoap.org/soap/encoding/' => 'soap', |
140 |
|
'http://www.w3.org/2001/XMLSchema' => 'xsd', |
141 |
|
'http://www.w3.org/2001/XMLSchema-instance' => 'xsi', |
142 |
|
'urn:dslforum-org:cwmp-1-0' => '', |
143 |
|
}, |
144 |
|
rules => $rules, |
145 |
|
); |
146 |
|
|
147 |
$state = {}; |
$state = {}; |
148 |
|
|
149 |
$parser->parsestring( $xml ); |
$parser->parsestring( $xml ); |
150 |
if ( my $trigger = $state->{_trigger} ) { |
if ( my $trigger = $state->{_trigger} ) { |
151 |
warn "### call_trigger( $trigger )\n"; |
warn "### call_trigger( $trigger )\n"; |