Answer the question
In order to leave comments, you need to log in
XSD syntax, is it possible to implement an if else construct?
The question is, is it possible to implement something like this:
Если элемент <frist_name>Вася</> то <last_name></> обязательно к заполнению.
Если элемент <frist_name>СуперВася</> то <last_name></> не обязательно к заполнению.
Answer the question
In order to leave comments, you need to log in
There are substitution groups. That is, we can say that either such content is valid, or such. I think this is a good example of using groups: stackoverflow.com/questions/39868769/xsd-element-s...
But are you sure you should use XSD for this task? This should also be a means of formal validation. That is, if your component received a valid XSD as input, it means that it can parse such a document. And even then you can conduct business validation, check invariants, etc.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question