Answer the question
In order to leave comments, you need to log in
How to indicate the mandatory nature of a separate element in an XSD schema?
I broke my brain...
Given: xml documents.
Task: write XSD schemas for them.
<?xml version="1.0" encoding="UTF-8" ?>
<form>
<id>обязателен</id>
<deliveryMethod>обязателен</deliveryMethod>
<date></date>
<sum></sum>
</form>
<xs:attribute name="r" use="required" />
<id use="required">обязателен</id>
Answer the question
In order to leave comments, you need to log in
The answer to the question is found here .
The problem is solved through the ass: you need to set the optional NOT mandatory :) elements by setting the parameters minOccurs=0 and maxOccurs=1.
The rest of the elements are considered required by default.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question