Peter Tandler
and 1 contributors

NAME

PBib::ReferenceConverter - Main controller class for processing references within documents

SYNOPSIS

        use PBib::ReferenceConverter;
        my $inDoc = new PBib::Document(
                'filename' => 'sample.xml',
                'mode' => 'r',
                );
        my $outDoc = new PBib::Document(
                'filename' => 'sample-pbib.xml',
                'mode' => 'w',
                );
        my $conv = new PBib::ReferenceConverter(
                'inDoc'         => $inDoc,
                'outDoc'        => $outDoc,
                'refStyle'      => new PBib::ReferenceStyle(),
                'labelStyle'    => new PBib::LabelStyle(),
                'bibStyle'      => new PBib::BibliographyStyle(),
                'itemStyle'     => new PBib::BibItemStyle(),
                'verbose' => 1,
                'quiet' => 0,
                );
        $conv->convert($refs);
        $inDoc->close();
        $outDoc->close();

DESCRIPTION

Main controller class of the PBib system for processing references within documents.

See module PBib::PBib for an example how to use it.

METHODS

$rc->scan()

Scan $rc's inDoc for used references and paragraphs that need to be converted. This does preprocessing for convert().

The fields "parInfo" and "foundInfo" are set.

$rc->scanParagraph($par, $i, $parInfo, $foundInfo, $fields)

Scan the inDoc for paragraphs with references and collect information on which references are used, how often they are used, and in which parahraphs they are used.

This method is called by scan() via inDoc's processParagraphs().

$rc->convert($refs, $inDoc, $outDoc)

Convert $inDoc to $outDoc.

This is the main method of ReferenceConverter.

$rc->convertParagraph($par, $i, $final)

Replace references in $par. $i is the index of this paragraph (as used in parInfo().

This method is called by convert() via inDoc's processParagraphs().