Presentation is loading. Please wait.

Presentation is loading. Please wait.

EGEE is a project funded by the European Union under contract IST-2003-508833 XML Schema 3 – 4 June 2004 www.eu-egee.org.

Similar presentations


Presentation on theme: "EGEE is a project funded by the European Union under contract IST-2003-508833 XML Schema 3 – 4 June 2004 www.eu-egee.org."— Presentation transcript:

1 EGEE is a project funded by the European Union under contract IST-2003-508833 XML Schema 3 – 4 June 2004 www.eu-egee.org

2 Introduction to web services, 3-4 June 2004 - 2 Objectives Development background xs:schema element General structure  overall structure  Annotations Defining elements Associating documents with schemas

3 Introduction to web services, 3-4 June 2004 - 3 Development of Schema Originally the tags in a XML document were defined in Document Type Definition (DTD) document. This was not itself a XML document. DTDs could be inline or separate documents. DTDs did not inherently define namespaces So schemas were developed which were XML documents, are separate from instances and namespaces were integral.

4 Introduction to web services, 3-4 June 2004 - 4 Reference to a Schema Tove Jani Reminder Don't forget me this weekend!

5 Introduction to web services, 3-4 June 2004 - 5 Simple Schema

6 Introduction to web services, 3-4 June 2004 - 6 Common Schema data types xs:string xs:decimal xs:integer xs:boolean xs:date xs:time

7 Introduction to web services, 3-4 June 2004 - 7 Defining Elements Elements defined with element element Name given by name attribute Content and attributes given in two ways:  content of element element defines type  or type attribute refers to type <xs:element name="order" type="order" />......

8 Introduction to web services, 3-4 June 2004 - 8 Defining Text-Only Elements Text-only elements have simple type  basic type is xs:string  also do numbers with xs:decimal  more simple data types later 24.99 Poe

9 Introduction to web services, 3-4 June 2004 - 9 Defining Empty Empty elements have complex type with no content

10 Introduction to web services, 3-4 June 2004 - 10 Open Elements Unconstrained elements are of type xs:anyType  default when no type is specified This can contain any content at all.

11 Introduction to web services, 3-4 June 2004 - 11 Defining Element Values Apply to Post-Schema-Validation Infoset (PSVI)  available to stage after validation Values fixed on element definition  default attribute gives default <xs:element name="surname" type="xs:string" default="Doe" /> Doe Functionally equivalent

12 Introduction to web services, 3-4 June 2004 - 12 Fixed attribute fixed attribute gives fixed (or null) value <xs:element name="surname" type="xs:string" fixed="Doe" /> Doe Smith valid invalid valid

13 Introduction to web services, 3-4 June 2004 - 13 Missing Element Values Element still validated even if has no value  only allowed if nillable is true  xsi:nil="true" used in instance <xs:element name="date-of-birth" type="xs:date" nillable="true"/> invalid valid 1972-05-30 valid

14 Introduction to web services, 3-4 June 2004 - 14 Making an attribute optional All attributes are optional by default. To explicitly specify that the attribute is optional, use the "use" attribute:  To make an attribute required:


Download ppt "EGEE is a project funded by the European Union under contract IST-2003-508833 XML Schema 3 – 4 June 2004 www.eu-egee.org."

Similar presentations


Ads by Google