Y
yonido
hi
my xml structure is:
<root>
<a></a>
<b></b>
</root>
a valid xml should be:
1. root element is mandatory.
2. <a> OR <b> OR BOTH, but AT LEAST one of them.
3. cant have 2 <a>'s or 2 <b>'s.
i've tried everything and cant get it to work.
closest things:
1. xsd:choice with maxOccours = 2 for the xsd:choice element. this
works, but 2 <a>'s are legal.
if u add maxOccurs=1 for the <a> element, it ignores it for some
reason.
2. xsd:sequence with 2 elements, a & b - where each gets minOccurs=0,
maxOccurs=1. This works, but an empty <root></root> is valid too. i
need at least one child.
so i tried adding minOccurs=1 for the xsd:sequence but it ignores it
to.
3. also tried playing with groups but nada.
I dont think it should be that complicated..
any ideas?
thanks in advance.
my xml structure is:
<root>
<a></a>
<b></b>
</root>
a valid xml should be:
1. root element is mandatory.
2. <a> OR <b> OR BOTH, but AT LEAST one of them.
3. cant have 2 <a>'s or 2 <b>'s.
i've tried everything and cant get it to work.
closest things:
1. xsd:choice with maxOccours = 2 for the xsd:choice element. this
works, but 2 <a>'s are legal.
if u add maxOccurs=1 for the <a> element, it ignores it for some
reason.
2. xsd:sequence with 2 elements, a & b - where each gets minOccurs=0,
maxOccurs=1. This works, but an empty <root></root> is valid too. i
need at least one child.
so i tried adding minOccurs=1 for the xsd:sequence but it ignores it
to.
3. also tried playing with groups but nada.
I dont think it should be that complicated..
any ideas?
thanks in advance.