Question

I'm trying to conditionally change an element from being nillable to non-nillable based on the value of 2 other elements in an XSD . Is this possible in XSD 1.1?

I have 3 simple types of type xs:int : VenGrp, VenTyp, SubVen.

VenGrp and VenTyp are non-nillable SubVen is non-nillable if VenGrp=2 and VenTyp=2 and nillable otherwise.

Is it possible to do this in an XSD schema file?

Was it helpful?

Solution

I don't think so. It would be possible if VenGrp and VenTyp were attributes: you could then use conditional type assignment.

Are you really sure you want to be using xsi:nil anyway? I thought the general consensus was that it was a bad feature best forgotten.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top