I'm a little confused about the usage of the schemaLocation and node attributes of . The JAXB 2.1 spec (FR, 12/11/06, section 7.1.3) says this:
"The schemaLocation attribute is optional for specifying , and The node attribute is optional for specifying ."
But a little further on (section 220.127.116.11), it says this:
"The top-most element within an element or the root element of an external binding file must have its schemaLocation attribute set."
And indeed all of the external binding files in the samples have both attributes set. Yet xjc happily swallows an external binding file with the following contents, when applied to any schema:
<?xml version="1.0" encoding="UTF-8"?>
I'm certainly glad this works, rather than having to have a separate version of it for every schema, but it does raise doubts in my mind as to whether it is really permitted by the spec.
The episode files generated by xjc also have neither of these attributes.
So: Exactly what are the rules around when the schemaLocation and node attributes are required vs. optional?