Blog coding and discussion of coding about JavaScript, PHP, CGI, general web building etc.

Wednesday, August 31, 2016

What is the purpose of XSD files?

What is the purpose of XSD files?


though we can query on the xml file from c# (.net). why need of .xsd file ? I know it is metadata file of particular xml file. we can specify the relationships in xsd. but what its functioning then ?

Sure: See, I have the xml:

      Customers->      ->Customer           ->CustomerID="GREAL">->        Great Lakes Food Market        Howard Snyder        Marketing Manager        (503) 555-7555                  
2732 Baker Blvd.
Eugene OR 97403 USA
<- <- GREAL 6 1997-05-06T00:00:00 1997-05-20T00:00:00 2 3.35 Great Lakes Food Market 2732 Baker Blvd. Eugene OR 97403 USA GREAL 8 1997-07-04T00:00:00 1997-08-01T00:00:00 2 4.42 Great Lakes Food Market 2732 Baker Blvd. Eugene OR 97403 USA

I want to get data from the ORDERS elements according to provided CustomeId.

Also questions is: What is the purpose of giving the relationships in xsd.

Answer by Oded for What is the purpose of XSD files?


XSD files are used to validate XML - that is conforms to a certain format.

In that respect they are similar to DTDs that existed before them.

The main difference between XSD and DTD is that XSD is written in XML and is considered easier to read and understand.

Answer by mort for What is the purpose of XSD files?


The xsd file is the schema of the xml file - it defines which elements may occur and their restrictions (like amount, order, boundaries, relationships,...)

Answer by a'r for What is the purpose of XSD files?


An XSD file is an XML Schema Definition and it is used to provide a standard method of checking that a given XML document conforms to what you expect.

Answer by Garry for What is the purpose of XSD files?


You mention C# in your question so it may help to think of as XSD as serving a similar role to a C# interface.

It defines what the XML should 'look like' in a similar way that an interface defines what a class should implement.

Answer by delnan for What is the purpose of XSD files?


An .xsd file is called an XML schema. Via an XML schema, we may require a certain structure in a given XML - which elements in which order, how many times, with which attributes, how they are nested, etc. If we have a schema for our XML input, we can verify that it contains the data we need it to contain, and nothing else, with a few lines invoking a schema validator.

Answer by Oleg for What is the purpose of XSD files?


Without XML Schema (XSD file) an XML file is a relatively free set of elements and attributes. The XSD file defines which elements and attributes are permitted and in which order.

In general XML is a metalanguage. XSD files define specific languages within that metalanguage. For example, if your XSD file contains the definition of XHTML 1.0, then your XML file is required to fit XHTML 1.0 rather than some other format.

Answer by Robert for What is the purpose of XSD files?


Also questions is: What is the purpose of giving the relationships in xsd.

Suppose you want to generate some XML for an external party's tool, or similar - how would you know what structure it is allowed to follow to be used correctly for their tool? you write to a schema. Likewise if you want other people to use your tool, you would write a schema for them to follow. It may also be useful for validating your own XML.

Answer by troelskn for What is the purpose of XSD files?


An XSD is a formal contract that specifies how an XML document can be formed. It is often used to validate an XML document, or to generate code from.

Answer by kjhughes for What is the purpose of XSD files?


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.

Answer by Premraj for What is the purpose of XSD files?


Before understanding the XSD(XML Schema Definition) let me explain;

What is schema?

for example; emailID: peter#gmail

You can identify the above emailID is not valid because there is no @, .com or .net or .org.

We know the email schema it looks like peter@gmail.com.

Conclusion: Schema does not validate the data, It does the validation of structure.

XSD is actually one of the implementation of XML Schema. others we have

We use XSD to validate XML data.


Fatal error: Call to a member function getElementsByTagName() on a non-object in D:\XAMPP INSTALLASTION\xampp\htdocs\endunpratama9i\www-stackoverflow-info-proses.php on line 72

0 comments:

Post a Comment

Popular Posts

Powered by Blogger.