Validating XML with XSDs … but still allow extensibility

前端 未结 5 992
梦谈多话
梦谈多话 2020-12-13 06:38

Maybe it\'s me, but it appears that if you have an XSD




        
5条回答
  •  自闭症患者
    2020-12-13 07:13

    Well, you can always use DTD :-) except that DTD also prescribes ordering. Validation with "unordered" grammar is terribly expensive. You could play with xsd:choice and min and max occurs but it's probably going to balk as well. You could also write XSD extensions / derived schemas.

    The way you posed the problem it looks like you don't really want XSD at all. You can just load it and then validate whatever minimum you want with XPaths, but just protesting against XSD, how many years after it became omni-present standard is really, really not going to get you anywhere.

提交回复
热议问题