XML Schema for sequence of elements with same name but different attribute values?

前端 未结 5 1937
南笙
南笙 2021-01-18 00:37

How can I specify an XML schema for an instance document like this:


  
  

        
5条回答
  •  青春惊慌失措
    2021-01-18 00:56

    In VS, reports an error: Elements with the same name and in the same scope must have the same type.
    I think XSD can't fullfill your requirement, you can try to solve it from another direction.for example, use xslt to validate XML. XSLT is xpath based and rule based, it can check every places in xml.
    XSD + XSLT is a good solution, XSD for schema check, XSLT for information check.

提交回复
热议问题