XML-API
view release on metacpan or search on metacpan
lib/XML/API.pm view on Meta::CPAN
# given if this is the root element
#
if ( $element eq $self->_root_element ) {
my $rootattrs = $self->_root_attrs;
while ( my ( $key, $val ) = each %$attrs ) {
$rootattrs->{$key} = $val;
}
$attrs = $rootattrs;
}
my ( $file, $line ) = (caller)[ 1, 2 ] if ( $self->{debug} );
if ( $self->{langnext} ) {
$attrs->{'xml:lang'} = delete $self->{langnext};
}
if ( $self->{dirnext} ) {
$attrs->{'dir'} = delete $self->{dirnext};
}
my $e;
if ( $self->{current} ) {
lib/XML/API.pm view on Meta::CPAN
else {
push( @{ $self->{elements} }, $item );
}
}
}
sub _close {
my $self = shift;
my $element = shift || croak '_close($element)';
my ( $file, $line ) = (caller)[ 1, 2 ] if ( $self->{debug} );
if ( !$self->{current} ) {
carp 'attempt to close non-existent element "' . $element . '"';
return;
}
if ( $element eq $self->{current}->{element} ) {
if ( $self->{current}->parent ) {
$self->{current} = $self->{current}->parent;
$self->_comment("DEBUG: '$element' close at $file:$line")
( run in 1.806 second using v1.01-cache-2.11-cpan-a3c8064c92c )