kbrw/sweet_xml

{:not_a_core_function, :substring}

Closed this issue · 1 comments

Steps to reproduce

xml = "<foo multiLine=\"1\">bar</foo>\n"
xml |> xpath(~x"substring(name(//*), 1)"s)

Expected result

"foo"

Actual result

** (exit) {:not_a_core_function, :substring}
        (xmerl) xmerl_xpath_lib.erl:52: :xmerl_xpath_lib.primary_expr/2
        (xmerl) xmerl_xpath.erl:361: :xmerl_xpath.eval_primary_expr/2
        (xmerl) xmerl_xpath.erl:156: :xmerl_xpath.string/5
    (sweet_xml) lib/sweet_xml.ex:654: SweetXml.get_current_entities/2
    (sweet_xml) lib/sweet_xml.ex:441: SweetXml.xpath/2

Environments

  • Erlang/OTP 19
  • Elixir 1.4.0
  • SweetXml 0.6.5

sweet_xml is a wrapper of the xmerl module. If the function "substring" isn't implemented it's not our fault. Try to report the bug directly on the Erlang tracker https://bugs.erlang.org/