This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Web Services and the fly likes Question using XSD with JAXB Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Question using XSD with JAXB" Watch "Question using XSD with JAXB" New topic
Author

Question using XSD with JAXB

Scott McGhee
Greenhorn

Joined: Apr 10, 2007
Posts: 22
I'm working on a project which currently has the following XSD defined:So one may see XML similar to this:But now we want to change the schema such that the following will be possibleBut I'm having trouble figuring out how to modify the XSD. I was thinking something like this:Can someone give me some advise?
Scott McGhee
Greenhorn

Joined: Apr 10, 2007
Posts: 22
Some more notes here.

My issue is that I think the XSD is thinking the "value" element inside the label complex type is treated as a sub-tag and not the actual value of the tag - like it would expect thisinstead of thisOr maybe I'm mistaken?

When using this XSD to generate java code, I'm expecting to get a Label.java with a getter/setter for "value" to set the text inside the <label> tag.

I also want the XSD to be completely backwards compatible, so any existing XMLs in the database will not fail to parse.
Scott McGhee
Greenhorn

Joined: Apr 10, 2007
Posts: 22
I gave up and read an XSD tutorial and figured out what to do on my own. Here is the final XSD that worked like I wanted it to.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Question using XSD with JAXB
 
Similar Threads
Returning complex datatypes in a Web Service response
AXis 2 and Array in doc literal wsdl
Is it possible to retrive multiple objects at one time ?
xsd for complex element structure
WSDL generation in Axis - item is referenced but not defined