Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Enterprise IT [Πληροφοριακές Τεχνολογίες της Επιχείρησης] Lecture 6-9: XSD Overview Univ. of the Aegean Financial and Management Engineering Dpt Petros.

Similar presentations


Presentation on theme: "1 Enterprise IT [Πληροφοριακές Τεχνολογίες της Επιχείρησης] Lecture 6-9: XSD Overview Univ. of the Aegean Financial and Management Engineering Dpt Petros."— Presentation transcript:

1 1 Enterprise IT [Πληροφοριακές Τεχνολογίες της Επιχείρησης] Lecture 6-9: XSD Overview Univ. of the Aegean Financial and Management Engineering Dpt Petros KAVASSALIS

2 2 What you will learn in this course A set of fundamental concepts for understanding basic Enterprise Information Technologies A set of fundamental concepts for understanding basic Enterprise Information Technologies  Enterprise Software Applications  Enterprise Architecture Integration (EAI) Best practices and techniques for building and migrating to a service- oriented enterprise Best practices and techniques for building and migrating to a service- oriented enterprise Strategies for integrating applications using standard technologies Strategies for integrating applications using standard technologies  XML  Web Services Familiarization with concepts such as: Familiarization with concepts such as:  Interoperability  e-business  e-government 2.0

3 3 Communication tools e-mail: pkavassalis@atlantis-group.gr e-mail: pkavassalis@atlantis-group.gr Course web site: see FME web site Course web site: see FME web site

4 4 Students evaluation Class Participation (20%) Class Participation (20%)+ Assignments (20%) Assignments (20%)+ Final Exam (650%) Final Exam (650%)

5 First go to http://www.w3schools.com/Schema/default.asp http://www.w3schools.com/Schema/default.asp 5

6 XSD in a nutshell XML: XML Schema Definition Language XML: XML Schema Definition Language  XML Working Group at W3C (please visit!) Used for the definition of XML tags and structure Used for the definition of XML tags and structure  … the content and the structure of a class of XML documents Schemas provide capabilities for expressing XML documents (the “logical structure” of the XML document Schemas provide capabilities for expressing XML documents (the “logical structure” of the XML document  Support for metadata characteristics o Relationships o Cardinality o Valid Values o Data Types XML documents without a referenced schema cannot be “validated” XML documents without a referenced schema cannot be “validated”  If validated, the XML document has a valid construction…  Note: “Simple”, “short” XML documents do not necessarily require the use of an XSD scheme 6

7 XSD: components Schema components = building blocks Schema components = building blocks  Elements declarations  Attribute declarations  Simple Type definitions  Complex Type definitions  Notifications  etc… 7

8 XSD: architecture (1) <xsd:schema>NAMESPACEBODY</xsd/schema> 8 Root element

9 XSD: architecture (2) 9 J. Bean (2003)

10 XSD: Global and Local Elements Global Elements: Available to be used in the rest of the schema Global Elements: Available to be used in the rest of the schema  They are declared at the top level of the schema (BODY) o This declaration determines how the element will look like  They are “referenced” each time we want to use somewhere in the schema Local Elements: Elements “on the spot” Local Elements: Elements “on the spot”  They may not be used elsewhere in the schema  Their names are “locally” unique, i.e. unique only in the context in which they appear 10

11 XSD: Simple Types  Elements with a built-in Type xml xml  data xml xml  200 kg  Custom Simple Types xml xml  data 11

12 XSD: Simple Types Example 12

13 XSD: built-in DataTypes and limitations for Simple Types Data and Time Types (built-in) Data and Time Types (built-in) Number Types (built-in) Number Types (built-in) Other built-in Types Other built-in Types  Locate them Acceptable Values foe simple Types Acceptable Values foe simple Types Patterns for simple Types Patterns for simple Types Range of Acceptable Values for simple Types Range of Acceptable Values for simple Types Length Limits for simple Types Length Limits for simple Types Number’s Digits Length for simple Types Number’s Digits Length for simple Types List Types List Types Element’s Content: pre-definition Element’s Content: pre-definition 13

14 XSD: Restrictions/Facets for Datatypes http://www.w3schools.com/Schema/schema_elements_ref.a sp http://www.w3schools.com/Schema/schema_elements_ref.a sp http://www.w3schools.com/Schema/schema_elements_ref.a sp http://www.w3schools.com/Schema/schema_elements_ref.a sp  Restrictions/Facets for Datatypes 14

15 XSD: Complex Types 15  Complex Types  Complex Types <xsd:sequence> </xsd:sequence></xsd:complexType  Simple Types  Simple Types </xsd:restriction></xsd:simpleType> xml xml  data  data

16 XSD: Complex Types Explicitly naming the xml element (restricted) xml xml John Smith John Smith </employee> xsd xsd </xsd:element> 16

17 XSD: Complex Types Several elements can refer to a complex type xml xml John Smith John Smith </employee> xsd xsd 17

18 XSD: Complex Types Extend a complex element 18

19 XSD: Complex Types XSD Elements http://www.w3schools.com/Schema/schema_elements_ref.a sp http://www.w3schools.com/Schema/schema_elements_ref.a sp http://www.w3schools.com/Schema/schema_elements_ref.a sp http://www.w3schools.com/Schema/schema_elements_ref.a sp  XSD Elements 19

20 Set of choices Set of choices Elements appearing with no order Elements appearing with no order Max-Min Occurs Max-Min Occurs Groups of elements Groups of elements  Referencing a named group  How many elements? XSD Attributes XSD Attributes  xml o Smith o Smith  xsd o o XSD: Complex Types Choice, Order and Groups 20

21 XSD: Complex Types Empty Elements Empty Elements Empty Elements  xml o o  xsd o o  xsd (2) o 4 o 4 21

22 XSD: Complex Types Elements with Mixed Content Text-Only Elements (text, attributes) ........ Mixed Elements xml  Dear Mr. John Smith. Your order 1032 will be shipped on 2001-07- 13. xsd  22

23 XSD: Complex Types More Substitution Substitution 23

24 XSD: Simple & Complex Types All in One All in One  http://www.codeguru.com/java/article.php/c13529 (*) http://www.codeguru.com/java/article.php/c13529  http://www.learn-xml-schema-tutorial.com/ http://www.learn-xml-schema-tutorial.com/ 24

25 XSD: Complex Types Examples http://www.w3schools.com/Schema/schema_example.asp http://www.w3schools.com/Schema/schema_example.asp http://www.w3schools.com/Schema/schema_example.asp http://www2.it.lut.fi/kurssit/08- 09/CT30A2900/Lectures/Examples/An XML schema example.pdf http://www2.it.lut.fi/kurssit/08- 09/CT30A2900/Lectures/Examples/An XML schema example.pdf http://www2.it.lut.fi/kurssit/08- 09/CT30A2900/Lectures/Examples/An XML schema example.pdf http://www2.it.lut.fi/kurssit/08- 09/CT30A2900/Lectures/Examples/An XML schema example.pdf 25

26 [References] E. Castro, 2001, XML for the World Wide Web, Peachpit Press E. Castro, 2001, XML for the World Wide Web, Peachpit Press  Chapters 5, 6, 7, 8, 9 J. Bean, 2003, XML for Data Architects, Morgan Kaufmann Pub. J. Bean, 2003, XML for Data Architects, Morgan Kaufmann Pub.  Chapter 4 26


Download ppt "1 Enterprise IT [Πληροφοριακές Τεχνολογίες της Επιχείρησης] Lecture 6-9: XSD Overview Univ. of the Aegean Financial and Management Engineering Dpt Petros."

Similar presentations


Ads by Google