diff --git a/apps/transport/lib/siri_queries.ex b/apps/transport/lib/siri_queries.ex index e13aa411b7..80e96ac2f8 100644 --- a/apps/transport/lib/siri_queries.ex +++ b/apps/transport/lib/siri_queries.ex @@ -78,22 +78,14 @@ defmodule Transport.SIRI do Saxy.encode!(doc) end - def build_line_refs(line_refs) do - # NOTE: we'll switch to proper well-escaped XML building later, this is research code - line_refs = line_refs |> Enum.map_join("\n", &"#{&1}") - - """ - - #{line_refs} - - """ - end - def line_refs_element([] = _line_refs), do: nil def line_refs_element(line_refs) do - line_refs = line_refs |> Enum.map(&element("siri:LineRef", [], &1)) - element("siri:Lines", [], line_refs) + line_refs = Enum.map(line_refs, &element("siri:LineRef", [], &1)) + + element("siri:Lines", [], [ + element("siri:LineDirection", [], line_refs) + ]) end def append_if_not_nil(list, nil), do: list diff --git a/apps/transport/test/transport/siri_queries_test.exs b/apps/transport/test/transport/siri_queries_test.exs index c874c507e9..02263892a6 100644 --- a/apps/transport/test/transport/siri_queries_test.exs +++ b/apps/transport/test/transport/siri_queries_test.exs @@ -125,8 +125,10 @@ defmodule Transport.SIRITest do #{timestamp} #{message_identifier} - #{line_001} - #{line_002} + + #{line_001} + #{line_002} +