users@jaxb.java.net

Re: optional and conditional xml schema elements

From: Kirill Grouchnikov <kirillcool_at_yahoo.com>
Date: Mon, 5 Feb 2007 11:06:55 -0800 (PST)

You can always add business-specific validation rules. It's quite simple actually - have a validation manager that contains a set of rules and hierarchically traverses your model checking all the rules at each node. Kirill ----- Original Message ---- From: Kohsuke Kawaguchi <Kohsuke.Kawaguchi@Sun.COM> To: users@jaxb.dev.java.net Sent: Monday, February 5, 2007 10:56:29 AM Subject: Re: optional and conditional xml schema elements john.mcclain@homeq.com wrote: > Is there a way to have optional elements in an xml schema be required if > certain other elements exist or have a specific value. > I.E > if I have an optional element X, and a required element Y. What I would > like is to enforce that when element Y = "COMPLETED", then element X > exists? Not really. In XML Schema at least. -- Kohsuke Kawaguchi Sun Microsystems kohsuke.kawaguchi@sun.com ____________________________________________________________________________________ Don't pick lemons. See all the new 2007 cars at Yahoo! Autos. http://autos.yahoo.com/new_cars.html