• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Attributes of XML schema to Java Bean variable

 
Biswajit Banerjee
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I undestand that when a schema is compiled to Java beans, complex type elements are converted as Bean having simple type elements as instance variable.
My question is how the 'Attributes' are converted in java objects. If they are also converted to variable, how they are distinguised from other variables (simple element types).
 
Ivan Krizsan
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
If you want to find out yourself, I recommend writing an XML schema and the using XJC (the JAXB binding compiler, http://java.sun.com/webservices/docs/1.6/jaxb/xjc.html) to create corresponding JAXB beans for the XML schema.
This way you will find out that attributes are bound to normal instance fields that are annotated with @XmlAttribute.
Best wishes!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic