XSD: How to validate the XML file according to value of some tag?

后端 未结 4 619
醉梦人生
醉梦人生 2020-12-19 11:13

I was trying to validate this XML file ... where if

  1. is \"Y\" then must appear

  2. if

4条回答
  •  轮回少年
    2020-12-19 11:41

    Unfortunately this problem cannot be fixed using XSD. The reason is that XSD can only be used to define the structure (syntax) of XML-Files. What you would like to do is to couple the syntax to some semantic properties (some TAG must have a certain content to decide on the syntax of some TAGS nearby).

提交回复
热议问题