| 160 |
|
|
| 161 |
for my $set (@{$list->child_nodes}) { |
for my $set (@{$list->child_nodes}) { |
| 162 |
if ($set->local_name eq 'StyleSet') { |
if ($set->local_name eq 'StyleSet') { |
| 163 |
|
my $apply = $set->get_attribute_value ('Apply', |
| 164 |
|
default => ['alternate'], |
| 165 |
|
as_array => 1); |
| 166 |
my $type = { |
my $type = { |
| 167 |
map {$_ => 1} |
map {$_ => 1} |
| 168 |
map {ref $_ ? @$_ : [$_]} |
\ @$apply |
|
$set->get_attribute_value ('Apply', default => ['alternate']) |
|
| 169 |
}; |
}; |
| 170 |
next if $ua_apply and not $type->{$ua_apply}; |
next if $ua_apply and not $type->{$ua_apply}; |
| 171 |
my $rel = $type->{alternate} ? 'alternate stylesheet' : 'stylesheet'; |
my $rel = $type->{alternate} ? 'alternate stylesheet' : 'stylesheet'; |
| 174 |
type => $type); |
type => $type); |
| 175 |
for my $sheet (@{$set->child_nodes}) { |
for my $sheet (@{$set->child_nodes}) { |
| 176 |
if ($sheet->local_name eq 'StyleSheet') { |
if ($sheet->local_name eq 'StyleSheet') { |
| 177 |
|
my $stype = { |
| 178 |
|
map {$_ => 1} |
| 179 |
|
\ @{$sheet->get_attribute_value ('Apply', default => $apply, |
| 180 |
|
as_array => 1)} |
| 181 |
|
}; |
| 182 |
|
next if $ua_apply and not $stype->{$ua_apply}; |
| 183 |
|
next if not $ua_apply and (not $stype->{alternate} and |
| 184 |
|
not $stype->{preferred} and |
| 185 |
|
not $stype->{persistent}); |
| 186 |
my $link = $parent->append_new_node |
my $link = $parent->append_new_node |
| 187 |
(type => '#element', |
(type => '#element', |
| 188 |
namespace_uri => $NS_XHTML1, |
namespace_uri => $NS_XHTML1, |
| 256 |
|
|
| 257 |
for my $set (@{$list->child_nodes}) { |
for my $set (@{$list->child_nodes}) { |
| 258 |
if ($set->local_name eq 'StyleSet') { |
if ($set->local_name eq 'StyleSet') { |
| 259 |
my $type = {map {$_ => 1} |
my $apply = $set->get_attribute_value |
| 260 |
@{ |
('Apply', default => ['alternate'], |
| 261 |
$set->get_attribute_value ('Apply', default => ['alternate']) |
as_array => 1); |
| 262 |
}}; |
my $type = {map {$_ => 1} @$apply}; |
| 263 |
my $rel = $type->{alternate} ? 'alternate stylesheet' : 'stylesheet'; |
my $rel = $type->{alternate} ? 'alternate stylesheet' : 'stylesheet'; |
| 264 |
my $title = __FUNCPACK__->_get_styleset_title |
my $title = __FUNCPACK__->_get_styleset_title |
| 265 |
(StyleSet => $set, o => $o, |
(StyleSet => $set, o => $o, |
| 266 |
type => $type); |
type => $type); |
| 267 |
for my $sheet (@{$set->child_nodes}) { |
for my $sheet (@{$set->child_nodes}) { |
| 268 |
if ($sheet->local_name eq 'StyleSheet') { |
if ($sheet->local_name eq 'StyleSheet') { |
| 269 |
|
my $stype = { |
| 270 |
|
map {$_ => 1} |
| 271 |
|
\ @{$sheet->get_attribute_value ('Apply', default => $apply, |
| 272 |
|
as_array => 1)} |
| 273 |
|
}; |
| 274 |
|
next if (not $stype->{alternate} and |
| 275 |
|
not $stype->{preferred} and |
| 276 |
|
not $stype->{persistent}); |
| 277 |
my $link = $parent->append_new_node |
my $link = $parent->append_new_node |
| 278 |
(type => '#pi', |
(type => '#pi', |
| 279 |
local_name => 'xml-stylesheet'); |
local_name => 'xml-stylesheet'); |