iodata rendering of urlsets and sitemap indexes.
Only set values are written, every text and attribute is escaped, and child elements follow the order of the sitemap, image, video and news XSDs.
Summary
Functions
Escapes the five XML entities and drops characters that are not allowed in XML 1.0 (control characters and invalid UTF-8).
One <sitemap> entry of an index.
Closing </sitemapindex>.
XML declaration, optional stylesheet instruction and the opening <sitemapindex>.
One <url> entry. default_changefreq and default_priority of config apply when the
entry has no value of its own.
Closing </urlset>.
XML declaration, optional stylesheet instruction and the opening <urlset> with every namespace.
Functions
Escapes the five XML entities and drops characters that are not allowed in XML 1.0 (control characters and invalid UTF-8).
iex> SiteMaps.XML.escape("a&b <c> \"d\" 'e'") |> IO.iodata_to_binary()
"a&b <c> "d" 'e'"
@spec index_entry(SiteMaps.IndexEntry.t()) :: iodata()
One <sitemap> entry of an index.
@spec index_header(SiteMaps.Config.t()) :: iodata()
XML declaration, optional stylesheet instruction and the opening <sitemapindex>.
@spec url(SiteMaps.URL.t(), SiteMaps.Config.t()) :: iodata()
One <url> entry. default_changefreq and default_priority of config apply when the
entry has no value of its own.
@spec urlset_header(SiteMaps.Config.t()) :: iodata()
XML declaration, optional stylesheet instruction and the opening <urlset> with every namespace.