Peter Tandler > Bundle-PBib-2.08.01 > PBib::Document::XML



Annotate this POD



Open  1
View/Report Bugs
Module Version: 1.13   Source  


PBib::Document::XML - XML documents


        use PBib::Document;
        my $doc = new PBib::Document(
                'filename' => 'sample.xml',
                'mode' => 'r',
        print $doc->filename();


Provide an interface to XML for PBib.

Main difference to other documents is that XML documents have a hierarchical structure, not a linear one.

Therefore, processParagraphs() is overwritten.

Used as base class for OpenOffice documents.

File Handling Methods ^


Return the document's encoding.

Returns undef if not specified.


Read the document from disk. Return the content of the document in a format internal to the document class. (Per default a ref to an array of the lines.)


Write the document back to disk, if the document has been opened and it contains paragraphs().

$fh is the FileHandle it should print to. If undef, $self->handle() is used.

Text Access Methods ^

Methods used by PBib to access the document.

$inDoc->processParagraphs($func, $rc, $outDoc, @_)

For an XML document, a "paragraph" is each CDATA element.

Here, we return the number of paragraphs.

$arrref = $doc->tagPath();

While processing the document (processParagraphs()), this returns an array with all parent [tag, attrib]

$int = $doc->paragraphCount();

Return the number of paragraphs in document.


Return the doc root as XML::Parser's hash encoding.

(Equivalent of PBib::Document::paragraphs().)


Return element at @path, e.g. getElement('body', 'p', 'ol', 'i').

If there are multiple elements with the same tag, the first is used.

Formatting Methods ^

Methods used by PBib to create formatted text.

syntax highlighting: