namespacesFileReader

Parse mime/XMLnamespaces file by line ignoring empty lines and comments.

namespacesFileReader
(
Range
)
(
Range byLine
)
if (
isInputRange!Range &&
is(ElementType!Range : string)
)

Return Value

Type: auto

Range of NamespaceLine tuples.

Throws

Examples

string[] lines = ["http://www.w3.org/1999/xhtml html application/xhtml+xml", "http://www.w3.org/2000/svg svg image/svg+xml"];
auto expected = [NamespaceLine("http://www.w3.org/1999/xhtml", "html", "application/xhtml+xml"), NamespaceLine("http://www.w3.org/2000/svg", "svg", "image/svg+xml")];
assert(equal(namespacesFileReader(lines), expected));

assertThrown!MimeFileException(namespacesFileReader(["http://www.example.org nameonly"]).array, "must throw");
assertThrown!MimeFileException(namespacesFileReader(["http://www.example.org"]).array, "must throw");

Meta