This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes XML and Related Technologies and the fly likes Need help with xml schema for the given XML Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Need help with xml schema for the given XML" Watch "Need help with xml schema for the given XML" New topic
Author

Need help with xml schema for the given XML

Vlad Golodov
Ranch Hand

Joined: Jul 05, 2004
Posts: 50
Hi All!

I have an XML file like that:



How can I restrict special types in XML Schema for the special TYPE of the component?

For the ADDRESS type: picture, thumbnail, description.
For the BOOKMARK type: url, description.

At the moment I have a schema like that:



Thanks in advance.
[ February 16, 2005: Message edited by: Vlad Golodov ]

SCJP, SCJWSD prepairing<br /><a href="http://www.vladgolodov.com" target="_blank" rel="nofollow">http://www.vladgolodov.com</a>
Balaji Loganathan
author and deputy
Bartender

Joined: Jul 13, 2001
Posts: 3150
Guess no..
Vlad Golodov
Ranch Hand

Joined: Jul 05, 2004
Posts: 50
Thanks for the answer. My solution will be to put all the possible parameters into one node: <component>. Some of the parameters will be just minOccurs="0".

If you have better solution for the given problem, I would be very glad to here that.
 
Don't get me started about those stupid light bulbs.
 
subject: Need help with xml schema for the given XML