FeedReader. Media. CandidateTracker
(FeedReader v0.4.0)
Copy Markdown
Shared bookkeeping for media candidates captured by the built-in XML handlers.
Parser state must contain :feed_candidate_sequence and
:item_candidate_sequence, each initialized with FeedReader.Media.CandidateSequence.new/0.
path/3 turns the top-first frame stack and current element into a root-to-leaf
path. A handler decides whether that path is eligible, then start/2 records
the candidate's position in the feed or item sequence. complete/3 stores its
value when the element closes; finalization therefore retains encounter order
even when nested candidates close out of order. reset_item/1 starts a fresh
sequence for the next item, and expanded_attributes/2 resolves attribute
names in the element's namespace scope.
This module is an internal helper for the built-in format handlers, not a public extension API.
Summary
Types
@type position() :: {scope(), FeedReader.Media.CandidateSequence.position()}
@type scope() :: :feed | :item
Functions
@spec expanded_attributes( [{String.t(), String.t()}], FeedReader.XML.NamespaceScope.t() ) :: map()
@spec path([map()], String.t(), FeedReader.XML.NamespaceScope.t()) :: [ {String.t(), FeedReader.XML.NamespaceScope.t()} ]