Questions tagged [xsd]

XSD generally refers to a document written in the W3C XML Schema format, containing a description of a particular type of XML document.

XML Schema, published as a W3C recommendation in May 2001, is one of several XML schema languages.

Because of confusion between XML Schema as a specific W3C specification, and the use of the same term to describe schema languages in general, some parts of the user community referred to this language as WXS, an initialism for W3C XML Schema, while others referred to it as XSD, an initialism for XML Schema Document — a document written in the XML Schema language, typically containing the "xsd" XML namespace prefix and stored with the ".xsd" filename extension.

As of April 5th 2012, the XML Schema Definition (XSD) 1.1 is a W3C Recommendation; W3C has adopted XSD as the preferred acronym.

What is an XML Schema?

The purpose of an XML Schema is to define the legal building blocks of an XML document, just like a DTD.

An XML Schema:

  • defines elements that can appear in a document.
  • defines attributes that can appear in a document.
  • defines which elements are child elements.
  • defines the order of child elements.
  • defines the number of child elements.
  • defines whether an element is empty or can include text.
  • defines data types for elements and attributes.
  • defines default and fixed values for elements and attributes.

See also:

14065 questions
47
votes
8 answers

How to convert xsd to human readable documentation?

We have a few XML based interfaces that is quite well documented in XSD schemas. The interfaces are now going to be publicly available and we would like to create reference documentation for them. Is there a tool that can automatically convert XSD…
Jonas Pegerfalk
  • 9,016
  • 9
  • 29
  • 29
47
votes
6 answers

How to resolve "Could not find schema information for the element/attribute "?

In visual studio, I have an asp.net 3.5 project that is using MS Enterprise Library 4.0 application blocks. When I have my web config file open, my Error list fills up with 99 messages with things like Could not find schema information for the…
StingyJack
  • 19,041
  • 10
  • 63
  • 122
47
votes
3 answers

Recursion in an XML schema?

I need to create an XML schema that validates a tree structure of an XML document. I don't know exactly the occurrences or depth level of the tree. XML example:
Miguel Mulero
  • 473
  • 1
  • 4
  • 6
46
votes
3 answers

Generating XML file using XSD file

How do you generate an XML file from an XSD file?
sachin kulkarni
  • 2,618
  • 7
  • 28
  • 33
45
votes
6 answers

Generating a WSDL from an XSD file

I need to generate a WSDL file given an XSD file. How do I do this? Can I do this in VS2005? What is the simplest way to do this?
Ausgar
  • 693
  • 1
  • 8
  • 12
45
votes
3 answers

XML validation with XSD: how to avoid caring about the sequence of the elements?

I have following XSD code:
jcborges
  • 1,064
  • 2
  • 10
  • 13
45
votes
2 answers

Automatically generate C# from XSD in Visual Studio IDE

I am running Visual Studio 2010. I have a XSD schema and want to use xsd.exe tool to generate appropriate C# file. I have done this successfully from a command line but now I want to do the same from IDE. Is there some well-known route for this? I…
wpfwannabe
  • 14,587
  • 16
  • 78
  • 129
44
votes
14 answers

What are best practices for designing XML schemas?

As an amateur software developer (I'm still in academia) I've written a few schemas for XML documents. I routinely run into design flubs that cause ugly-looking XML documents because I'm not entirely certain what the semantics of XML exactly are. My…
evizaer
  • 1,583
  • 3
  • 14
  • 17
43
votes
5 answers

XSD: how to restrict number of characters in string type attribute?

I have a question regarding adding restriction in my xml schema(xsd). I have a complex-type like: ..... I have many attributes in this complex-type, and few of them are of…
Ankush
  • 787
  • 3
  • 12
  • 23
43
votes
4 answers

Validating XML against XSD

I need to validate an XML file with a given XSD file. I simply need the method to return true if the validation went fine or false otherwise.
Shai
  • 1,093
  • 4
  • 13
  • 20
43
votes
3 answers

What is the difference between targetNamespace and xmlns:target?

What is targetNamespace's function? I understand that xmlns="http://www.w3.org/2001/SchemaXML…
jojo10
  • 567
  • 2
  • 5
  • 7
43
votes
2 answers

What is the difference between xsd and xsi?

What exactly is the difference between XML Schema Document and XML Schema Instance ? xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" Please elaborate.
Piyush
  • 599
  • 1
  • 7
  • 16
42
votes
1 answer

xml : how to reference a .xsd file at .xml file?

I want to see xml file in browser as I define in .xsd file. Please check the following two files for me and point out what do I need to do. These two files are under same folder. employee.xml
RedsDevils
  • 1,413
  • 9
  • 26
  • 47
42
votes
3 answers

Required Multiple beans of same type in Spring

A request before you mark it as duplicate. I have gone through the forum and couldn't find the solution for the problem anywhere. I am writing a code using Spring 3.2 and everything is purely annotation based. The code receives XML files which are…
dharam
  • 7,882
  • 15
  • 65
  • 93
40
votes
2 answers

Can I have one XML Schema (XSD) include another XML-Schema?

I currently have two XSD schemes and one is a "light" version of the other. Right now I have everything in the "light" version repeated in the "complete" schema, but this becomes a pain when I need to make a change, and it goes against the DRY…
Robert Gould
  • 68,773
  • 61
  • 187
  • 272