Skip to main content

Attributes

5 replies [Last post]
mshaffer55
Offline
Joined: 2007-02-07
Points: 0

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 7.1.3.1), 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?

Thanks...

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
kohsuke
Offline
Joined: 2003-06-09
Points: 0

That 7.1.3.1 needs to be removed. That should have never been there.

And sorry for not updating samples. We really should have gone through all samples to use the latest greatest 2.1 features, but we never really got around doing it.

The binding file you have there is perfectly legal. We'll try to overhaul our samples.

mshaffer55
Offline
Joined: 2007-02-07
Points: 0

Good, thanks. Where should JAXB spec errors in general be reported (I assume not in this forum)? I have detected a few additional problems besides this one. Nothing really dramatic, mostly things like broken pointers to numbered tables and code samples, and erroneous (and therefore misleading) in-line sample code.

kohsuke
Offline
Joined: 2003-06-09
Points: 0

http://jaxb.dev.java.net/issues/ would do. Thank you for finding those.

mshaffer55
Offline
Joined: 2007-02-07
Points: 0

OK, I will try to keep track of them as I go along, and then submit them all in one big issue, once I get sick of reading this thing.

kohsuke
Offline
Joined: 2003-06-09
Points: 0

> once I get sick of reading this thing.

:-) It's no laughing matter, but couldn't help...