Presentation is loading. Please wait.

Presentation is loading. Please wait.

XSD 2015, Fall Pusan National University HyungGyu Ryoo 1.

Similar presentations


Presentation on theme: "XSD 2015, Fall Pusan National University HyungGyu Ryoo 1."— Presentation transcript:

1 XSD 2015, Fall Pusan National University HyungGyu Ryoo 1

2 XML Schema An XML Schema describes the structure of an XML document An XML document with correct syntax is called “Well Formed” An XML document validated against an XML Schema is both "Well Formed" and "Valid" To define the legal building blocks of an XML document the elements and attributes that can appear in a document the number of (and order of) child elements data types for elements and attributes default and fixed values for elements and attributes 2

3 XSD vs DTD – DTD? <!DOCTYPE note [ ]> Tove Jani Reminder Don't forget me this weekend 3

4 XML Schema Definition An XML Schema describes the structure of an XML document To define the legal building blocks of an XML document XSD supports data types XSD uses XML Syntax 4

5 The Element <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.opengis.net/indoorgml/1.0/core" xmlns=http://www.opengis.net/indoorgml/1.0/corehttp://www.opengis.net/indoorgml/1.0/core xmlns:gml="http://www.opengis.net/gml/3.2" elementFormDefault="qualified">... 5

6 Simple Element A simple element is an XML element that can contain only text. It cannot contain any other elements or attributes. xsd:string, xsd:integer, xsd:positiveInteger, xsd:decimal, xsd:boolean, xsd:date, xsd:time, etc. You can also add restrictions (facets) to a data type in order to limit its content, or you can require the data to match a specific pattern. 6

7 Example of Simple Element Refsnes 36 1970-03-27 7

8 Example of Restrictions 8

9 Complex Element A complex element is an XML element that contains other elements and/or attributes. Attribute Smith Complex elements - Empty Elements John Smith 9

10 A reference to an XML Schema 10 <purchaseOrder xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://stem.cs.pusan.ac.kr/" xsi:schemaLocation="http://stem.cs.pusan.ac.kr/ xsd_example.xsd" orderDate="1999-10-20"> Alice Smith 123 Maple Street Mill Valley CA 90952 ….

11 11 Validating XML Schema

12 XML Parsing - JAXB 12


Download ppt "XSD 2015, Fall Pusan National University HyungGyu Ryoo 1."

Similar presentations


Ads by Google