1 defmodule Pleroma.Web.XML do
4 def string_from_xpath(_, :error), do: nil
6 def string_from_xpath(xpath, doc) do
7 {:xmlObj, :string, res} = :xmerl_xpath.string('string(#{xpath})', doc)
14 if res == "", do: nil, else: res
17 def parse_document(text) do
21 |> :binary.bin_to_list()
22 |> :xmerl_scan.string()
27 Logger.debug("Couldn't parse XML: #{inspect(text)}")