xmleam/builder

Types

pub type Option {
  Opt(label: String, value: String)
}

Constructors

  • Opt(label: String, value: String)
pub type XmlError {
  ContentsEmpty
  TagNameEmpty
  OptionsEmpty
}

Constructors

  • ContentsEmpty
  • TagNameEmpty
  • OptionsEmpty

Functions

pub fn basic_tag(
  tag_name: String,
  contents: String,
) -> Result(String, XmlError)

This is a basic tag, ie. name and the contents Ex. builder.basic_tag(“pubDate”, “12 Mar 2024”) to 12 Mar 2024 \n basic_tag(tag_name, contents)

pub fn opts_cont_tag(
  tag_name: String,
  options: List(Option),
  contents: String,
) -> Result(String, XmlError)

This is a tag with options and content Ex. opts_cont_tag(“enclosure”, [opts(“url”, “https://example.com”)], “IDK why you would use this”) -> IDK why you would use this

Search Document