Smee.Transform (Smee v0.1.0) View Source
Tools for manipulating metadata XML.
This module is intended to make common and relatively simple actions on potentially large XML files more efficiently than
processing a metadata or entities using xmerl, and may rely on external tools such as xsltproc
.
These functions are useful for pre-processing metadata XML before it's broken up into entity struct, and to speed-up the internal workings of other modules.
Link to this section Summary
Functions
Strips various extraneous parts from the metadata and returns a new struct in an :ok/:error tuple
Strips various extraneous parts from the metadata and returns a new struct in an :ok/:error tuple
Returns a metadata struct with all comments removed, in an :ok/:error struct
Applies an XSLT stylesheet to a metadata struct, returning a transformed metadata struct in an :ok/error tuple
Returns a metadata struct with the validUntil date updated, in an :ok/:error struct
Returns a metadata struct with the validUntil date updated, or raises if an error occurs
Link to this section Functions
Specs
decruft_idp(metadata :: Smee.Metadata.t()) :: {:ok, Smee.Metadata.t()} | {:error, binary()}
Strips various extraneous parts from the metadata and returns a new struct in an :ok/:error tuple
Specs
decruft_sp(metadata :: Smee.Metadata.t()) :: {:ok, Smee.Metadata.t()} | {:error, binary()}
Strips various extraneous parts from the metadata and returns a new struct in an :ok/:error tuple
Specs
strip_comments(metadata :: Smee.Metadata.t()) :: {:ok, Smee.Metadata.t()} | {:error, binary()}
Returns a metadata struct with all comments removed, in an :ok/:error struct
Specs
transform( metadata :: Smee.Metadata.t(), stylesheet :: binary(), params :: keyword() ) :: {:ok, Smee.Metadata.t()} | {:error, binary()}
Applies an XSLT stylesheet to a metadata struct, returning a transformed metadata struct in an :ok/error tuple
Specs
valid_until(metadata :: Smee.Metadata.t(), date :: DateTime.t()) :: {:ok, Smee.Metadata.t()} | {:error, binary()}
Returns a metadata struct with the validUntil date updated, in an :ok/:error struct
Specs
valid_until!(metadata :: Smee.Metadata.t(), date :: DateTime.t()) :: Smee.Metadata.t()
Returns a metadata struct with the validUntil date updated, or raises if an error occurs