Jump to content

Is this schema constraint possible?


kjkrum

Recommended Posts

Consider this XML:

<root>	 <element>		  <foo>CAKE</foo>		  <bar>42</bar>	 </element>	 <element>		  <foo>CAKE</foo>		  <bar>69</bar>	 </element></root>

I want the above XML to be invalid. Is it possible for a schema to require that elements can have duplicate values of "foo" only if they also have duplicate values of "bar"?Or would I have to refactor my data, e.g., specify a set of "foobar" elements and require that my elements above reference them? (I don't know exactly how to do that, either...)

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...