One element is required if another element is empty

2 views
Skip to first unread message

DB

unread,
Jul 30, 2008, 10:54:52 PM7/30/08
to XML Schema
Hi,

I've got something like this:

<address>
<line1></line1>
<line2></line2>
</address>

Different suppliers provide the address in different ways - I need a
rule in my XSD that say if line1 is empty, then line2 is required OR
if line2 is empty then line1 is required.

In some cases line1 and line2 will both have values.

Any help on implementing this?

Thanks,
David.
Reply all
Reply to author
Forward
0 new messages