ExVEx.Packaging.Relationships (ExVEx v0.1.1)

Copy Markdown View Source

An OPC .rels file — a graph of <Relationship> records linking parts of the package together.

Every .rels file lives under a _rels/ directory at its source scope:

  • _rels/.rels — package-level relationships (root).
  • xl/_rels/workbook.xml.rels — relationships for xl/workbook.xml.
  • xl/worksheets/_rels/sheet1.xml.rels — relationships for sheet1.xml.

Relationship targets are resolved relative to the source part's directory, never the .rels file's directory. resolve/2 handles the path arithmetic.

Summary

Functions

Returns the absolute package path that relationship.target points to, given the path of the source .rels file that declared the relationship.

Types

t()

@type t() :: %ExVEx.Packaging.Relationships{
  entries: [ExVEx.Packaging.Relationships.Relationship.t()]
}

Functions

get(relationships, id)

@spec get(t(), String.t()) ::
  {:ok, ExVEx.Packaging.Relationships.Relationship.t()} | :error

parse(xml)

@spec parse(binary()) :: {:ok, t()} | {:error, term()}

resolve(relationship, rels_path)

Returns the absolute package path that relationship.target points to, given the path of the source .rels file that declared the relationship.

serialize(relationships)

@spec serialize(t()) :: binary()