Hi all,
I am trying to validate an XML against XSD and facing a problem with
conditional check:
The XML is as below:
<root>
<header></header>
<addresses>
<address type = "P" street = "Melbourne" province =
"STA"/>
<address type = "S" street = "Bradford" province =
"STA"/>
</addresses>
</root>
With my XSD I need to check that there's at least one address which is
of type "P". If there is no address of type "P" the XML is invalid.
Is it possible using XSD? Can anyone please help.
Thanks and Regards,
Ayan
Martin Honnen - 28 Jun 2007 13:05 GMT
> With my XSD I need to check that there's at least one address which is
> of type "P". If there is no address of type "P" the XML is invalid.
>
> Is it possible using XSD?
Not really, if you want to express such constraints then look into
Schematron: <http://www.schematron.com/>

Signature
Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/