users@jaxb.java.net

Understanding _at_XmlType

From: Joe Kutner <jpkutner_at_gmail.com>
Date: Mon, 27 Jul 2009 11:20:37 -0500

I am having difficult understanding the expected behavior of the
@XmlType attribute as described here:
https://jaxb.dev.java.net/guide/Evolving_annotated_classes.html#Changing_class_names

If I have a class such as:

  @XmlType(name = "foo")
  class Bar {}

Should it not marshal to the following XML?

  <foo />

I am not able to get this to work. I always get <bar/>.

Thanks!

Joe