Process SMIL directives in XML data: Difference between revisions

Content added Content deleted
(added Perl 6 programming solution)
m (→‎{{header|Perl 6}}: wrong version)
Line 216: Line 216:
%Parents{$y}:exists ?? die() !! %Parents{$y} = Animatee.new; # unique only
%Parents{$y}:exists ?? die() !! %Parents{$y} = Animatee.new; # unique only
for .parent.elements {
for .parent.elements {
(%Parents{$y}).todo = .attribs<attributeName>;
%Parents{$y}.todo = .attribs<attributeName>;
(%Parents{$y}).from = .attribs<from>.split(/\s+/);
%Parents{$y}.from = .attribs<from>.split(/\s+/);
(%Parents{$y}).to = .attribs<to>.split(/\s+/);
%Parents{$y}.to = .attribs<to>.split(/\s+/);
(%Parents{$y}).begin = .attribs<begin>.match(/\d+/);
%Parents{$y}.begin = .attribs<begin>.match(/\d+/);
(%Parents{$y}).dur = .attribs<dur>.match(/\d+/);
%Parents{$y}.dur = .attribs<dur>.match(/\d+/);
}
}
}
}