Skip to content

Commit 2ca8bdf

Browse files
committed
Allow simpler syntax in namespace mapping files
1 parent 4385c6a commit 2ca8bdf

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

XmlSchemaClassGenerator.Console/Program.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ static void Main(string[] args)
6868
{ "h|help", "show this message and exit", v => showHelp = v != null },
6969
{ "n|namespace=", @"map an XML namespace to a C# namespace
7070
Separate XML namespace and C# namespace by '='.
71+
A single value (no '=') is taken as the C# namespace the empty XML namespace is mapped to.
7172
One option must be given for each namespace to be mapped.
7273
A file name may be given by appending a pipe sign (|) followed by a file name (like schema.xsd) to the XML namespace.
7374
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<string> namespaces, List<string> na
269270
{
270271
var parts = line.Split('=');
271272

273+
if (parts.Length == 1)
274+
parts = new[] { string.Empty, parts[0] };
275+
272276
if (parts.Length != 2)
273277
{
274278
System.Console.WriteLine($"{namespaceFile}:{number}: Line format is XML namespace = C# namespace [file name]");

0 commit comments

Comments
 (0)