[Home] [By Thread] [By Date] [Recent Entries]

  • To: xml-dev@l...
  • Subject: semantics in schema (xsd)
  • From: Pedro Salazar <pedro-b-salazar@p...>
  • Date: 25 Feb 2004 20:28:59 +0000
  • Organization: Portugal Telecom Inovação, S.A.

Greetings,

I'm creating a schema file but by several times I feel the needed of
something to validate my sub-elements in tree (children elements)
subordinated to an attribute value on the parent element.

Is it possible to validate this with the schema semantics?

For instance, a schema may define an element called "human" that would
allow to have a <wife> or <husband> element below it. However, I would
like to apply an extra semantic rule that would only allow the <wife>
element be inside a human of gender type "female", and the same thing
for <husband> with "male". Is it possible?  

<human gender="female">
   <wife />
</human>

<human gender="male">
   <husband />
</human>

thanks,
Pedro Salazar.
-- 
PS
pedro-b-salazar_at_ptinovacao_dot_pt
PGP:0E129E31D803BC61


Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member