Re: Adding XSD 1.1 assertions to a complex type

Mukul Gandhi <[email protected]>
Newsgroups gmane.text.xml.xerces-j.user
Message-ID <CABuuzNPL=WZXG28ptNht=-OuH_iSN8TXkdt5nDzRwNADhyAE5A@mail.gmail.com>
On 15 July 2014 21:38, sshanmug <[email protected]> wrote:

>  If I have more than one complex types extending from abstract-comp-type,
> how do I add validation to check if all the sub types have an element named
> element1?
>
> <[email protected]>


I think, this can be simply accomplished by having following assertion
within your type abstract-comp-type,

<xs:assert test="element1"/>

This will work for your requirement, because asserts are derived all the
way down the type hierarchy.




--
Regards,
Mukul Gandhi
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.