Bio-Biblio

 view release on metacpan or  search on metacpan

lib/Bio/Biblio/IO/medlinexml.pm  view on Meta::CPAN

        push (@ObjectStack, \%p);
#       push (@ObjectStack, { 'type' => 'Abstract' });
    }
}


sub handle_end {
    my ($expat, $e) = @_;
    #
    # First I have to deal with those elements which are both PCDATA
    # (and therefore they are on the pcdataStack) and which have an
    # attribute list (therefore they are also known as a separate
    # p-object on the objectStack.
    #
    if ($e eq 'QualifierName' or
        $e eq 'SubHeading') {
        my $p = pop @ObjectStack;   # pSubHeading
        $$p{'subHeading'} = pop @PCDataStack;
        &_add_element ('subHeadings', $p);  # adding to pMeshHeadings
#       &_debug_object_stack ("END", $e);
        return;

lib/Bio/Biblio/IO/medlinexml.pm  view on Meta::CPAN


    } elsif ($e eq 'OtherID') {
        my $p = pop @ObjectStack;  # pOtherID
        $$p{'otherID'} = pop @PCDataStack;
        &_add_element ('otherIDs', $p);  # adding to pMedlineCitation
#       &_debug_object_stack ("END", $e);
        return;
    }

    #
    # both object and pcdata stacks elements mixed here together
    # (the element names appear in the order of frequency in the
    # medline data set)
    #

    if (exists $POP_DATA_AND_PEEK_OBJ{$e}) {
        &_data2obj ("\l$e");

    } elsif (exists $POP_OBJ_AND_PEEK_OBJ{$e}) {
        &_obj2obj ("\l$e");

lib/Bio/Biblio/IO/pubmedxml.pm  view on Meta::CPAN

        &Bio::Biblio::IO::medlinexml::handle_start ($expat, $e, %attrs);
    }
}


sub handle_end {
    my ($expat, $e) = @_;

    #
    # First I have to deal with those elements which are both PCDATA
    # (and therefore they are on the pcdataStack) and which have an
    # attribute list (therefore they are also known as a separate
    # p-object on the objectStack.
    #
    if ($e eq 'ArticleId') {
        &Bio::Biblio::IO::medlinexml::_data2obj ('id');
        &Bio::Biblio::IO::medlinexml::_add_element ('pubmedArticleIds', pop @Bio::Biblio::IO::medlinexml::ObjectStack);
#       &Bio::Biblio::IO::medlinexml::_debug_object_stack ("END", $e);
        return;
    }

    if ($e eq 'URL') {
        &Bio::Biblio::IO::medlinexml::_data2obj ('URL');
        &Bio::Biblio::IO::medlinexml::_add_element ('pubmedURLs', pop @Bio::Biblio::IO::medlinexml::ObjectStack);
#       &Bio::Biblio::IO::medlinexml::_debug_object_stack ("END", $e);
        return;
    }


    #
    # both object and pcdata stacks elements mixed here together
    #

    if (exists $POP_DATA_AND_PEEK_OBJ{$e}) {
        &Bio::Biblio::IO::medlinexml::_data2obj ("\l$e");

    } elsif (exists $POP_AND_ADD_DATA_ELEMENT{$e}) {
        &Bio::Biblio::IO::medlinexml::_add_element ($POP_AND_ADD_DATA_ELEMENT{$e}, pop @Bio::Biblio::IO::medlinexml::ObjectStack);

    } elsif ($e eq 'MedlineCitation' ||
             $e eq 'NCBIArticle') {



( run in 0.485 second using v1.01-cache-2.11-cpan-454fe037f31 )