aspose file tools*
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 Spring in Action this week in the Spring 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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Question using XSD with JAXB