C# Namespaces & Java Packages

There are two options for specifying the namespace/package that classes will be generated into:

  1. 1.-csnsname (C#) or -pkgname (Java): This option lets you specify a single namespace/package that all classes will be generated into. This option is a good alternative when your schemas do not have overlapping type names.

  2. 1.-csnspfx (C#) or -pkgpfx (Java): This option causes the classes for each schema to be generated into a separate namespace/package, each of which will be a child of the namespace/package specified with the option. For example, given "-csnspfx com.test", classes from myschema.xsd will be in namespace com.test.myschema

TIP: Choose your namespace/package name carefully. Avoid using a name whose first piece will be used as a name in your schema. For example, using test as a package name when there are elements (and thus generated fields) named test will likely cause C#/Java compilation errors (the field name will hide the namespace/package name).