Presentation is loading. Please wait.

Presentation is loading. Please wait.

An Introduction to XML Schema CSCI 7818 by Ming Rutar.

Similar presentations

Presentation on theme: "An Introduction to XML Schema CSCI 7818 by Ming Rutar."— Presentation transcript:

1 An Introduction to XML Schema CSCI 7818 by Ming Rutar

2 Resources XML Schema is a W3C Recommendation

3 Motivation Purpose of DTD : Sharing grammar/data with others Validation by the parser Defaulting of values. Shortcomings of DTD a very limited capability for specifying datatypes. incompatible set of datatypes with those found in databases inconsistent syntax with XML

4 XML Schema Requirements Structural Schemas Besides analogizing DTD, there are specific goals beyond DTD: Integration with namespace Definition of incomplete constraints on content of an element type Integration of structural schemas with primitive data types inheritance

5 XML Schema Requirements (2) Primitive Data Typing Based on experience with SQL, Java primitives. Conformance Define the relation of schemata to XML document instances, and obligations on schema-aware processors.

6 Example (DTD) BookStore.dtd

7 Example (Schema) <xsd:schema xmlns:xsd="" targetNamespace="" xmlns="" elementFormDefault="qualified">

8 Example (vocabulary) DTDBookStoreSchema ELEMENT #PCDATA ATTLIST ID NMTOKEN CDATA ENTITY BookStore Book Title Author Date ISBN Publisher complexType element sequence schema string boolean integer

9 Data Types A complex types allow elements in their content and may carry attributes A simple types cannot have element content and cannot carry attributes, such integer. A ur-type definition is present in each ·XML Schema·, serving as the root of the type definition hierarchy for that schema. Primitive datatypes are those that are not defined in terms of other datatypes Derived datatypes are those that are defined in terms of other datatypes.


11 Mapping between DTD and Schema m

12 An Instance Document <BookStore xmlns = xmlns:xsi= xsi:schemaLocation=" BookStore.xsd">-3 My Life and Times Paul McCartney July, 1998 94303-12021-43892 McMillin Publishing...

13 Multiple Level Checking Validator BookStore.XML BookStore.xsd XMLSchema.xsd

14 Other way to define name space Make xsd as default namespace Compare with

15 Conclusion XML Schemas are a tremendous advancement over DTDs XML Schemas are much more complex than DTDs

Download ppt "An Introduction to XML Schema CSCI 7818 by Ming Rutar."

Similar presentations

Ads by Google