NAME

Document::OOXML::Rels - Class representing ".rels" (relationships) files in OOXML

VERSION

version 0.181410

SYNOPSIS

my $rels = Document::OOXML::Rels->new_from_xml($rels_xml);

my $rel1 = $rels->get_part_relation_by_type('http://purl.oclc.org/ooxml/officeDocument/relationships/officeDocument');
my $rel2 = $rels->get_part_relation_by_id('someId1');

DESCRIPTION

Class representing a .rels file in an OOXML file. These files specify where to find related document parts in the package.

They can be referenced from the document by type (this is called an "implicit reference", footnotes in WordprocessingML work like this), or by id (called an "explicit reference", headings and footers in WordprocessingML work like this).

METHODS

new_from_xml($xml_data)

Parse the "rels" (relationships) XML file data, so it can be queried.

Returns a new instance of Document::OOXML::Rels.

get_part_relation_by_type($type)

Retrieves the properties (id, type, part name) of a related part, searching for the Type.

Returns a hash reference with the following keys if the relation is found:

  • id

  • type

  • part_name

get_part_relation_by_id($type)

Retrieves the properties (id, type, part name) of a related part, searching for the Id.

Returns a hash reference with the following keys if the relation is found:

  • id

  • type

  • part_name

SEE ALSO

AUTHOR

Martijn van de Streek <martijn@vandestreek.net>

COPYRIGHT AND LICENSE

This software is copyright (c) 2018 by Martijn van de Streek.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.