| Perl6-Pod documentation | Contained in the Perl6-Pod distribution. |
Perl6::Pod::To::DocBook::ProcessHeads - convert heads to sections
use Perl6::Pod::To::DocBook::ProcessHeads;
$self->{out_put} =
create_pipe( 'Perl6::Pod::To::DocBook::ProcessHeads', $self->{out_put});
Perl6::Pod::To::DocBook::ProcessHeads - convert heads to sections
| Perl6-Pod documentation | Contained in the Perl6-Pod distribution. |
package Perl6::Pod::To::DocBook::ProcessHeads; #$Id$
use warnings; use strict; use XML::ExtOn; use base 'XML::ExtOn'; sub on_start_element { my ($self, $el ) = @_; my $lname = $el->local_name; if ($lname eq 'headlevel') { my $attrs = $el->attrs_by_name; my $child = $attrs->{child}; #if block semantic # delete head level my $is_semantic = $child eq uc($child); if ( $is_semantic) { $el->delete_element; return $el; } %{ $el->attrs_by_name } = (); $el->local_name('section'); } elsif ($lname =~ /^head/) { $el->local_name('title'); } $el; } 1;