Try to get a given tag name out from an XML value, then grab the value from that Grabs the first tag that matches in the object
import Dict
import Xml exposing (Value(..))
tag "name" string (Tag "name" Dict.empty (StrNode "noah"))
--> Ok "noah"
tag "name" string (Tag "name" Dict.empty (IntNode 5))
--> Err "Not a string."
tag "name" string (StrNode "noah")
--> Err "No tag called 'name' found."Collect as many values that pass the given converter
import Dict
import Xml exposing (Value(..))
collect (tag "name" string) [Tag "name" Dict.empty (StrNode "noah")]
--> [ "noah" ]
collect (tag "name" string) [Tag "name" Dict.empty (IntNode 5)]
--> [ ]Set a default for a result
>> default "Cat" (Ok "Fish")
Ok "Fish"
>> default "Dog" (Err "flip")
Ok "Dog"Try to turn a value into a string
import Xml exposing (Value(..))
string (IntNode 5)
--> Err "Not a string."
string (StrNode "hello")
--> Ok "hello"Try to turn a value into an int
import Xml exposing (Value(..))
int (IntNode 5)
--> Ok 5
int (StrNode "hello")
--> Err "Not an int"Try to turn a value into an int
import Xml exposing (Value(..))
float (FloatNode 5.5)
--> Ok 5.5
float (StrNode "hello")
--> Err "Not a float"
Search an XML value for any tags matching