What is the difference between xsd and xsi? What is the difference between xsd and xsi? xml xml

What is the difference between xsd and xsi?


xsd and xsi Similarities

  • Both are XML namespace prefixes, abbreviations for anXML namespace.
  • Both are, as are all namespace prefixes, arbitrarily named; other namespace prefix abbreviationscould equally well be used. However, both prefixes are conventional and thereforerecommended. (An also-conventional alternative to xsd is xs.)

xsd and xsi Differences

See Also


http://www.w3.org/2001/XMLSchema

The Simple Version : This is the namespace used within an XML Schema (XSD). An XML schema is used to describe what's valid within an XML instance document.

The Less Simple Version : This is the namespace of an XML Schema that describes the structure of an XML Schema. In other words a schema that describes itself.

An XML Schema (XSD) must be written using the types defined within this schema.

For Example.

<xs:schema elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">    <xs:element name="MyElement" type="xs:string" /></xs:schema>

http://www.w3.org/2001/XMLSchema-instance

This is a namespace used within XML Instance documents to provide additional data to the XML Parser that is processing it. It describes the attributes xsi:schemalocation, xsi:noSchemalocation, xsi:type and xsi:nil which the XML parser can use to assist it with validation.

For Example.

<MyElement xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"            xsi:noNamespaceSchemaLocation="MySchema.xsd">    string</MyElement>