What is the purpose of XSD files?

前端 未结 10 1521
抹茶落季
抹茶落季 2020-11-30 20:25

Since we can query on the XML file from C# (.NET), why do we need an XSD file? I know it is metadata file of particular XML file. We can specify the relationships in XSD, b

10条回答
  •  谎友^
    谎友^ (楼主)
    2020-11-30 20:59

    XSDs constrain the vocabulary and structure of XML documents.

    • Without an XSD, an XML document need only follow the rules for being well-formed as given in the W3C XML Recommendation.
    • With an XSD, an XML document must adhere to additional constraints placed upon the names and values of its elements and attributes in order to be considered valid against the XSD per the W3C XML Schema Recommendation.

    XML is all about agreement, and XSDs provide the means for structuring and communicating the agreement beyond the basic definition of XML itself.

提交回复
热议问题