TYPED AND UNTYPED XML XML schemas define a

TYPED AND UNTYPED XML XML schemas define a series of data types that exist in a particular namespace. Schemas are themselves well-formed schema-compliant XML documents, just as relational table definitions and other DDL are valid Transact-SQL. Although there can be more than one schema definition document for a particular namespace, a schema definition document defines types in only one namespace. The XML Schema Definition language (XSD) defines a standard set of base types that are supported as types in XML documents, just as the SQL:1999 standard defines a set of base types that relational databases must support. The XSD base data types are shown in Figure 8-1. Schema documents may also import types from other namespaces, using the importelement. There are also some special namespaces that are imported by default in SQL Server s XML type. Two of the most important ones are: The http://www.w3.org/2001/XMLSchema namespace. This namespace defines the constructs (elements and attributes) used in XML schema documents. The http://www.w3.org/2001/XMLSchema-instance namespace. This namespace defines the constructs to be used in XML documents that are not schemas. These are usually assigned the namespace prefixes xs and xsi, respectively, although a lot of other schema-manipulating products will use the xsd prefix rather than xs. A complete explanation of the XML Schema specification is beyond the scope of this book, but Listing 8-5 illustrates the main concept. Built-in Misc. Types date time dateTime duration gDay gMonth gYear gYearMonth gMonthDay Time Cluster boolean base64Binary hexBinary Misc. Cluster Figure 8-1: XSD Base Data Types

Note: If you are looking for good and high quality web space to host and run your application check Lunarwebhost Tomcat Web Hosting services

Bookmark the permalink.

Comments are closed.