This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread 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 OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA 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.
 
Consider Paul's rocket mass heater.
 
subject: Need help with xml schema for the given XML