Re: XML W3C Schema, check excistence of attribute depending on other attributes



On 30 Aug, 12:26, Martin Honnen <mahotr...@xxxxxxxx> wrote:
RolfK wrote:
Case one:
Combination which may exists are A1,AA2,A3 or A1,A4,A5.
<E A1="" A2="" A3="">
<E A1=""  A4"" A5="">

Case two:
The existance of an attribute depnds on a the VALUE of another
attribute
A1=a ==> A1,A2,A3
A1=b ==> A1,A4,A5
A1=c ==> A1,A6,A7

I don't think such restrictions can be modelled with the W3C XML schema
language.

--

        Martin Honnen
       http://JavaScript.FAQTs.com/

I agree Martin. People recommend using things like Schematron or
Relax-NG for this type of thing.

FWIW XSD 1.1 looks like it will include functionality for this sort of
thing in the way of schematron like assertions (xs:assert). For those
interested last call for the current draft of XSD 1.1 ends this Friday
12th Sept! How long it will take before you can assume the additional
functionality is in your tools is anyones guess!

HTH,

Pete Cordell
Codalogic Ltd
Interface XML to C++ the easy way using XML C++
data binding to convert XSD schemas to C++ classes.
Visit http://www.codalogic.com/lmx/ for more info
.



Relevant Pages

  • Re: XSD help
    ... You can embed Schematron rules in an XSD schema to specify co-occurrence ... constraints and layer over XSD validation. ...
    (microsoft.public.dotnet.xml)
  • Re: XML Validation against XSD
    ... Is it possible using XSD? ... if you want to express such constraints then look into Schematron: ... Martin Honnen --- MVP XML ...
    (microsoft.public.dotnet.xml)

Loading