What is Schema?
An XML schema describes the structure of an XML document. The XML schema language is called XML Schema Definition (XSD). WSDLs contain embedded schemas that describe the inputs and outputs to the service operations.
See W3schools for information on creating and working with schemas.
Briefly, an XML schema defines:
- elements within a document, including whether an element is empty or can include text
- attributes within a document
- which elements are child elements, and the number and order of the child elements
- data types for elements and attributes
- default and fixed values for elements and attributes
There are three types represented within a schema; simple, complex, and data.
|XSD Elements||A simple element is an XML element that contains only text. It cannot contain any other elements or attributes.|
|XSD Attributes||All attributes are simple types. Simple elements cannot have attributes. It an element has an attribute it is always "complex", but the attribute itself is a simple type.|
|XSD Restrictions||Restrictions are used to define acceptable values for XML elements or attributes. For example, you can define an element called "weight" with a restriction. The value of weight cannot be lower than 10 or greater than 300. Restrictions on XML elements are called facets.|
|XSD Elements||A complex element contains other elements and attributes.|
|XSD Empty||An empty complex element cannot have contents, only attributes.|
|XSD Elements Only||An "elements-only" complex type contains an element that contains only other elements.|
|XSD Text Only||A complex text-only element can contain text and attributes.|
|XSD Mixed||A mixed complex type element can contain attributes, elements, and text.|
|XSD Indicators||You can use indicators to control how elements are used in documents. These indicators are order, occurrence, and group indicators.|
|XSD \<any>||The \<any> element can be used to extend the XML document with elements not specified by the schema.|
|XSD \<anyAttribute>||The \<anyAttribute> element can be used to extend the XML document with attributes not specified by the schema.|
|XSD Substitution||You can substitute one element for another element.|
|XSD String||String data types are used for values that contains character strings. The string data type can contain characters, line feeds, carriage returns, and tab characters.|
|XSD Date||This data type is used to specify a date in the following format; YYYY-MM-DD where YYYY is the year, MM is the month, and DD is the day. All components are required.|
|XSD Numeric||The decimal data type is used for numeric values|
|XSD Misc||Other miscellaneous data types are boolean, base64Binary, hexBinary, float, double, anyURI, QName, and NOTATION. See the W3School site for information on these data types.|
In the Design Studio
You can import existing schemas into the Design Studio from either the Internet or from a local file.