




















































































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
An overview of xml schemas, their purpose, and the benefits they offer in defining elements, attributes, and data types for xml documents. It covers the syntax and structure of xml schemas, their support for data types, and their extensibility. The document also includes examples of xml schema files and their corresponding xml instance documents.
Typology: Slides
1 / 92
This page cannot be seen from the preview
Don't miss anything!





















































































8
XML Schemas
XML Schemas are the Successors of DTDs
XML Schemas will be used in most Web applications as a replacement for DTDs. Here are some reasons:
XML Schemas are extensible to future additions XML Schemas are richer and more powerful than DTDs XML Schemas are written in XML XML Schemas support data types XML Schemas support namespaces
10
XML Schemas
It is easier to describe allowable document content It is easier to validate the correctness of data It is easier to work with data from a database It is easier to define data facets (restrictions on data) It is easier to define data patterns (data formats) It is easier to convert data between different data types
11
XML Schemas
Schemas are XML documents
You don't have to learn a new language You can use your XML editor to edit your Schema files You can use your XML parser to parse your Schema files You can manipulate your Schema with the XML DOM You can transform your Schema with XSLT
13
XML Schemas
Well-Formed is not Enough
A well-formed XML document is a document that conforms to the XML syntax rules, like:
14
XML Schemas
The purpose of a schema is to define a class of XML documents
and so the term "instance document" is often used to describe an XML document that conforms to a particular schema
17
XML Schemas
Simple XML Document "note.xml":
Tove Jani Reminder Don't forget me this weekend!
Start with the standard XML declaration followed by the xs:schema element that defines a schema
**
In the schema above we use the standard namespace (xs), and the URI associated with this namespace is the Schema language definition, which has the standard value of http://www.w3.org/2001/XMLSchema.
The note element is a complex type because it contains other elements. The other elements (to, from,
heading, body) are simple types because they do not contain other elements.
Tove Jani Reminder Don't forget me this weekend!