This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| defmodule XmlNode do | |
| require Record | |
| Record.defrecord :xmlAttribute, Record.extract(:xmlAttribute, from_lib: "xmerl/include/xmerl.hrl") | |
| Record.defrecord :xmlText, Record.extract(:xmlText, from_lib: "xmerl/include/xmerl.hrl") | |
| def from_string(xml_string, options \\ [quiet: true]) do | |
| {doc, []} = | |
| xml_string | |
| |> :binary.bin_to_list | |
| |> :xmerl_scan.string(options) |