XML Schema

XML Schema - In this lecture XML Schemas Elements v Types...

Info iconThis preview shows pages 1–8. Sign up to view the full content.

View Full Document Right Arrow Icon
In this lecture • XML Schemas • Elements v. Types • Regular expressions • Expressive power Resources W3C Draft: www.w3.org/TR/2001/REC-xmlschema-1-20010502
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
XML Schemas • http://www.w3.org/TR/xmlschema-1/10/2000 • generalizes DTDs • uses XML syntax • two documents: structure and datatypes – http://www.w3.org/TR/xmlschema-1 – http://www.w3.org/TR/xmlschema-2 • XML-Schema is very complex – often criticized – some alternative proposals
Background image of page 2
XML Schemas < xsd:element name =“paper” type =“papertype”/> < xsd:complexType name =“papertype”> < xsd:sequence > < xsd:element name =“title” type =“xsd:string”/> < xsd:element name =“author” minOccurs =“0”/> < xsd:element name =“year”/> < xsd: choice > < xsd:element name =“journal”/> < xsd:element name =“conference”/> </ xsd:choice > </ xsd:sequence > </ xsd : element > DTD: <!ELEMENT paper ( title , author *, year , ( journal | conference ))>
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Elements v.s. Types in XML Schema < xsd:element name =“person”> < xsd:complexType > < xsd:sequence > < xsd:element name =“name” type =“xsd:string”/> < xsd:element name =“address” type =“xsd:string”/> </ xsd:sequence > </ xsd:complexType > </ xsd:element > < xsd:element name =“person” type =“ttt”/> < xsd:complexType name =“ttt”> < xsd:sequence > < xsd:element name =“name” type =“xsd:string”/> < xsd:element name =“address” type =“xsd:string”/> </ xsd:sequence > </ xsd:complexType > DTD: <!ELEMENT person ( name , address )>
Background image of page 4
• Types: – Simple types (integers, strings, . ..) – Complex types (regular expressions, like in DTDs) • Element-type-element alternation: – Root element has a complex type – That type is a regular expression of elements – Those elements have their complex types. .. – ... – On the leaves we have simple types Elements v.s. Types in XML Schema
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Local and Global Types in XML Schema • Local type: < xsd:element name =“person”> [define locally the person’s type] </ xsd:element > • Global type: < xsd:element name =“person” type =“ ttt ”/> < xsd:complexType name =“ ttt ”> [define here the type ttt] </ xsd:complexType> Global types: can be reused in other elements
Background image of page 6
Local v.s. Global Elements in XML Schema Local element: < xsd:complexType name =“ttt”> < xsd:sequence > < xsd:element name =“address” type =“. ..”/>. .. </ xsd:sequence
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 8
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Page1 / 25

XML Schema - In this lecture XML Schemas Elements v Types...

This preview shows document pages 1 - 8. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online