projects
/
libwww-opensearch-perl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
new upstream 0.11
[libwww-opensearch-perl.git]
/
lib
/
WWW
/
OpenSearch
/
Description.pm
diff --git
a/lib/WWW/OpenSearch/Description.pm
b/lib/WWW/OpenSearch/Description.pm
index
807c576
..
0075e35
100644
(file)
--- a/
lib/WWW/OpenSearch/Description.pm
+++ b/
lib/WWW/OpenSearch/Description.pm
@@
-125,7
+125,7
@@
whose type is equal to $type.
=head1 COPYRIGHT AND LICENSE
=head1 COPYRIGHT AND LICENSE
-Copyright 200
6
by Tatsuhiko Miyagawa and Brian Cassidy
+Copyright 200
7
by Tatsuhiko Miyagawa and Brian Cassidy
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.
@@
-165,12
+165,13
@@
sub load {
my $ns = $element->getNamespace->value;
my $version;
my $ns = $element->getNamespace->value;
my $version;
- if( $ns eq 'http://a9.com/-/spec/opensearch
/1.1
/' ) {
- $self->ns(
$ns
);
- $version = '1.
1
';
+ if( $ns eq 'http://a9.com/-/spec/opensearch
description/1.0
/' ) {
+ $self->ns(
'http://a9.com/-/spec/opensearchrss/1.0/'
);
+ $version = '1.
0
';
}
else {
}
else {
- $version = '1.0';
+ $self->ns( $ns );
+ ( $version ) = $ns =~ m{([^/]+)/?$};
}
$self->version( $version );
}
$self->version( $version );
@@
-178,7
+179,7
@@
sub load {
my $node = $doc->documentElement->getChildrenByTagName( $column ) or next;
if( $column eq 'Url' ) {
if( $version eq '1.0' ) {
my $node = $doc->documentElement->getChildrenByTagName( $column ) or next;
if( $column eq 'Url' ) {
if( $version eq '1.0' ) {
- $self->Url( [ WWW::OpenSearch::Url->new( template => $node->string_value, type => 'application/rss+xml' ) ] );
+ $self->Url( [ WWW::OpenSearch::Url->new( template => $node->string_value, type => 'application/rss+xml'
, ns => $self->ns
) ] );
next;
}
next;
}
@@
-198,7
+199,7
@@
sub load {
$params{ $param } = $value;
}
$params{ $param } = $value;
}
- push @url, WWW::OpenSearch::Url->new( template => $url, type => $type, method => $method, params => \%params );
+ push @url, WWW::OpenSearch::Url->new( template => $url, type => $type, method => $method, params => \%params
, ns => $self->ns
);
}
$self->Url( \@url );
}
}
$self->Url( \@url );
}
@@
-229,10
+230,6
@@
sub load {
$self->image( $images );
}
$self->image( $images );
}
- elsif( $version eq '1.0' and $column eq 'Format' ) {
- $self->Format( $node->string_value );
- $self->ns( $self->Format );
- }
else {
$self->$column( $node->string_value );
}
else {
$self->$column( $node->string_value );
}
@@
-252,13
+249,11
@@
sub get_url_by_type {
my $self = shift;
my $type = shift;
my $self = shift;
my $type = shift;
- my $template;
for( $self->urls ) {
for( $self->urls ) {
- $template = $_ if $_->type eq $type;
- last;
+ return $_ if $_->type eq $type;
};
};
- return
$template
;
+ return;
}
sub urls {
}
sub urls {