How can I specify an element to have an attribute that states how many children it contains in an XML Schema?

StackOverflow https://stackoverflow.com/questions/6404029

Вопрос

Is it even possible?

  • I know it’s possible to do a restriction based on regex, but that’s not it
  • I know it’s possible to declare an attribute as a foreign key calculated by an XPath, but it seems it has to be unique

Exemple:

<root children="2">
    <child />
    <child />
</root>

Нет правильного решения

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top