Presentation is loading. Please wait.

Presentation is loading. Please wait.

CIS 375—Web App Dev II XSD. 2 XSD IntroductionIntroduction XSD stands for XML __________ Definition, which is the XML-based alternative to ______. An.

Similar presentations


Presentation on theme: "CIS 375—Web App Dev II XSD. 2 XSD IntroductionIntroduction XSD stands for XML __________ Definition, which is the XML-based alternative to ______. An."— Presentation transcript:

1 CIS 375—Web App Dev II XSD

2 2 XSD IntroductionIntroduction XSD stands for XML __________ Definition, which is the XML-based alternative to ______. An XML Schema describes the __________ of an XML document and is a _____ Recommendation. An XML Schema (like DTD) defines: elements that can appear in a document attributes that can appear in a document which elements are child elements the order of child elements the number of child elements whether an element is empty or can include text data types for elements and attributes (not in DTD) default and fixed values for elements and attributes Schema DTD structure W3C

3 3 XML Schemas - Why? One of the greatest strength of XML Schemas is the support for data ______ with these benefits: It is easier to describe permissible 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 Example: For 1999-03-11, type=“date” requires the format CCYY-MM-DD. XSD is also ________ since they are written in XML. types extensible

4 4 XML and DTD Example A simple XML document (note.xml): Tove Jani Reminder Don't forget me this weekend! A simple DTD (note.dtd):

5 5 XSD Example (note.xsd)

6 6 A Reference to an XML Schema Tove Jani Reminder Don't forget me this weekend!

7 7 XSD - The Element The element looks like this: xmlns:xs=“http://www.w3.org/2001/XMLSchema” identifies the namespace for entities used in the schema. targetNamespace=“http://www.w3schools.com” identifies the namespace for elements defined by the schema. xmlns=“http://www.w3schools.com” identifies the default namespace. elementFormDefault="qualified“ means elements must be namespace qualified.

8 8 Sample XML Document <shiporder orderid="889923" xmlns:xsi="http://www.w3.org/2001/XML Schema-instance" xsi:noNamespaceSchemaLocation= "shiporder.xsd"> John Smith Ola Nordmann Langgt 23 4000 Stavanger Norway Empire Burlesque Special Edition 1 10.90 Hide your heart 1 9.90

9 XML Schema File (shiporder.xsd)


Download ppt "CIS 375—Web App Dev II XSD. 2 XSD IntroductionIntroduction XSD stands for XML __________ Definition, which is the XML-based alternative to ______. An."

Similar presentations


Ads by Google