Compilation returns a parser factory, which must be interrogated for diagnostics to see if compilation was successful or not.
There are two places you can set the root element, or you can omit it.
There are two places you can set the root element, or you can omit it. You can set it here on the compiler. This saves compilation time, as it will only compile things needed by your root element. (Good to make tests run fast.) If you don't specify a root, then it compiles all top level elements, anticipating that different uses of the compiled schema might subsequently ask for different top level elements.
If you don't specify a root here, then you can specify one later on the ProcessorFactory object, but that won't save you as much compilation time.
If you don't set a root at all, then it compiles all top level elements and uses the first element in the first schema file as the root.
When specifying a root element, you either specify its namespace, or you can specify the empty string "" as the namespace which means "no namespace". If you specify a root element name, but pass null as the namespace, then it will search for a unique element with your root element name, and if that is unambiguous, it will use it as the root.