diff --git a/XmlSchemaClassGenerator.Console/Program.cs b/XmlSchemaClassGenerator.Console/Program.cs index 12ef10a3..8888914b 100644 --- a/XmlSchemaClassGenerator.Console/Program.cs +++ b/XmlSchemaClassGenerator.Console/Program.cs @@ -68,6 +68,7 @@ static void Main(string[] args) { "h|help", "show this message and exit", v => showHelp = v != null }, { "n|namespace=", @"map an XML namespace to a C# namespace Separate XML namespace and C# namespace by '='. +A single value (no '=') is taken as the C# namespace the empty XML namespace is mapped to. One option must be given for each namespace to be mapped. A file name may be given by appending a pipe sign (|) followed by a file name (like schema.xsd) to the XML namespace. If no mapping is found for an XML namespace, a name is generated automatically (may fail).", v => namespaces.Add(v) }, @@ -269,6 +270,9 @@ private static void ParseNamespaceFiles(List namespaces, List na { var parts = line.Split('='); + if (parts.Length == 1) + parts = new[] { string.Empty, parts[0] }; + if (parts.Length != 2) { System.Console.WriteLine($"{namespaceFile}:{number}: Line format is XML namespace = C# namespace [file name]");