Enabling Grids for E-sciencE www.eu-egee.org PPARC Summer School, May 2005 Schemas (and XML) Richard Hopkins, National e-Science Centre, Edinburgh.

Slides:



Advertisements
Similar presentations
XML: text format Dr Andy Evans. Text-based data formats As data space has become cheaper, people have moved away from binary data formats. Text easier.
Advertisements

1 Web Data Management XML Schema. 2 In this lecture XML Schemas Elements v. Types Regular expressions Expressive power Resources W3C Draft:
 Fundamentals of Web Design.  Describe the history and theory of XHTML  Understand the rules for creating valid XHTML documents  Apply a DTD to an.
An Introduction to XML Based on the W3C XML Recommendations.
© De Montfort University, XML – a meta language Howell Istance and Peter Norris School of Computing De Montfort University.
1 XML DTD & XML Schema Monica Farrow G30
Achieving Distributed Extensibility and Versioning in XML Dave Orchard W3C Lead BEA Systems.
Enabling Grids for E-sciencE ISSGC’05 XML documents Richard Hopkins, National e-Science Centre, Edinburgh June 2005.
Introduction to XLink Transparency No. 1 XML Information Set W3C Recommendation 24 October 2001 (1stEdition) 4 February 2004 (2ndEdition) Cheng-Chia Chen.
1 Substitution Groups in XML Schemas Tomer Shiran Winter 2003/4 Semester.
Enabling Grids for E-sciencE ISSGC’05 XML Schemas (XSD) Richard Hopkins, National e-Science Centre, Edinburgh June 2005.
Sunday, June 28, 2015 Abdelali ZAHI : FALL 2003 : XML Schemas XML Schemas Presented By : Abdelali ZAHI Instructor : Dr H.Haddouti.
XML Schema Basics SD2520 Databases using XML and Jquery Chapter 12
Unit 4 – XML Schema XML - Level I Basic.
Introduction to XML This material is based heavily on the tutorial by the same name at
1 Advanced Topics XML and Databases. 2 XML u Overview u Structure of XML Data –XML Document Type Definition DTD –Namespaces –XML Schema u Query and Transformation.
Manohar – Why XML is Required Problem: We want to save the data and retrieve it further or to transfer over the network. This.
XP New Perspectives on XML Tutorial 4 1 XML Schema Tutorial – Carey ISBN Working with Namespaces and Schemas.
XP New Perspectives on XML Tutorial 3 1 DTD Tutorial – Carey ISBN
Enabling Grids for E-sciencE Schemas Richard Hopkins National e-Science Centre, Edinburgh February 23 /
Lecture 15 XML Validation. a simple element containing text attribute; attributes provide additional information about an element and consist of a name.
Enabling Grids for E-sciencE XML – eXtensible Mark-up Language Richard Hopkins, National e-Science Centre, Edinburgh March 15 /
Enabling Grids for E-sciencE XML Richard Hopkins National e-Science Centre, Edinburgh February 23 /
Why XML ? Problems with HTML HTML design - HTML is intended for presentation of information as Web pages. - HTML contains a fixed set of markup tags. This.
VICTORIA UNIVERSITY OF WELLINGTON Te Whare Wananga o te Upoko o te Ika a Maui SWEN 432 Advanced Database Design and Implementation XML Schema 1 Lecturer.
XML Schema Vinod Kumar Kayartaya. What is XML Schema?  XML Schema is an XML based alternative to DTD  An XML schema describes the structure of an XML.
1 XML Schemas. 2 Useful Links Schema tutorial links:
Dr. Azeddine Chikh IS446: Internet Software Development.
Neminath Simmachandran
McGraw-Hill/Irwin © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Schemas Ellen Pearlman Eileen Mullin Programming the Web Using XML.
XML CPSC 315 – Programming Studio Fall 2008 Project 3, Lecture 1.
XP 1 CREATING AN XML DOCUMENT. XP 2 INTRODUCING XML XML stands for Extensible Markup Language. A markup language specifies the structure and content of.
Li Tak Sing COMPS311F. XML Schemas XML Schema is a more powerful alternative to DTD to describe XML document structures. The XML Schema language is also.
1 © Netskills Quality Internet Training, University of Newcastle Introducing XML © Netskills, Quality Internet Training University.
XML 1 Enterprise Applications CE00465-M XML. 2 Enterprise Applications CE00465-M XML Overview Extensible Mark-up Language (XML) is a meta-language that.
Processing of structured documents Spring 2002, Part 2 Helena Ahonen-Myka.
1 Tutorial 13 Validating Documents with DTDs Working with Document Type Definitions.
Avoid using attributes? Some of the problems using attributes: Attributes cannot contain multiple values (child elements can) Attributes are not easily.
Of 33 lecture 3: xml and xml schema. of 33 XML, RDF, RDF Schema overview XML – simple introduction and XML Schema RDF – basics, language RDF Schema –
Beginning XML 4th Edition. Chapter 5: XML Schemas.
1 XML An Overview Roger Debreceny University of Hawai`i Skip White University of Delaware XBRL Workshop, August 2006.
New Perspectives on XML, 2nd Edition
XML Schema. Why Schema? To define a class of XML documents Serve same purpose as DTD “Instance document" used for XML document conforming to schema.
An OO schema language for XML SOX W3C Note 30 July 1999.
XML – Part III. The Element … This type of element either has the element content or the mixed content (child element and data) The attributes of the.
ACG 4401 XML Schemas XML Namespaces XLink. + The XML Foundation Many participants – an extended family! XML Instance documents – carry data in context.
An Introduction to XML Sandeep Bhattaram
McGraw-Hill/Irwin © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Understanding How XML Works Ellen Pearlman Eileen Mullin Programming the.
1 CIS336 Website design, implementation and management (also Semester 2 of CIS219, CIS221 and IT226) Lecture 5 XML Schema (Based on Møller and Schwartzbach,
Sheet 1XML Technology in E-Commerce 2001Lecture 2 XML Technology in E-Commerce Lecture 2 Logical and Physical Structure, Validity, DTD, XML Schema.
XML 2nd EDITION Tutorial 4 Working With Schemas. XP Schemas A schema is an XML document that defines the content and structure of one or more XML documents.
1 Tutorial 14 Validating Documents with Schemas Exploring the XML Schema Vocabulary.
Tutorial 13 Validating Documents with Schemas
Processing of structured documents Spring 2003, Part 3 Helena Ahonen-Myka.
Internet & World Wide Web How to Program, 5/e. © by Pearson Education, Inc. All Rights Reserved.2.
Working with XML Schemas ©NIITeXtensible Markup Language/Lesson 3/Slide 1 of 36 Objectives In this lesson, you will learn to: * Declare attributes in an.
XML Validation II Schemas Robin Burke ECT 360. Outline Namespaces Documents  Data types XML Schemas Elements Attributes Derived data types RELAX NG.
XSD: XML Schema Language Kanda Runapongsa Dept. of Computer Engineering Khon Kaen University.
XML Schema Definition (XSD). Definition of a Schema It is a model for describing the structure and content of data The XML Schema was developed as a content.
XML Validation II Advanced DTDs + Schemas Robin Burke ECT 360.
Lecture 0 W3C XML Schema. Topics Status Motivation Simple type vs. complex type.
XML Validation. a simple element containing text attribute; attributes provide additional information about an element and consist of a name value pair;
CITA 330 Section 4 XML Schema. XML Schema (XSD) An alternative industry standard for defining XML dialects More expressive than DTD Using XML syntax Promoting.
Web Services: Principles & Technology Slide 3.1 Chapter 3 Brief Overview of XML COMP 4302/6302.
4 Copyright © 2004, Oracle. All rights reserved. Validating XML by Using XML Schema.
MSc in Communication Sciences Program in Technologies for Human Communication Davide Eynard Facoltà di scienze della comunicazione Università.
Schemas Richard Hopkins National e-Science Centre, Edinburgh
Data Modeling II XML Schema & JAXB Marc Dumontier May 4, 2004
ISSGC’05 XML Schemas (XSD)
New Perspectives on XML
Presentation transcript:

Enabling Grids for E-sciencE PPARC Summer School, May 2005 Schemas (and XML) Richard Hopkins, National e-Science Centre, Edinburgh

Enabling Grids for E-sciencE PPARC Summer School, May 2005 Schemas (and XML) 2 Overview Goals – –General appreciation of XML and Schemas –Sufficient detail of XML and Schemas to understand WSDLs Structure –XML (review & namespaces) –Schema Structure –Schema Bureaucracy –Extensibility (?)

Enabling Grids for E-sciencE PPARC Summer School, May 2005 Schemas (and XML) 3 An Extensible Markup Language XML = eXtensible Markup Language “Markup” means document is an intermixing of –Content – the actual information to be conveyed - payload –Markup – information about the content - MetaData 22/10/1946 … is markup – says that the content is a date Self-describing document date is an element of a markup vocabulary / language  a collection of keywords used to identify syntax and semantics of constructs in an XML document

Enabling Grids for E-sciencE PPARC Summer School, May 2005 Schemas (and XML) 4 10/24/ dear Joe this … … XML Review Prolog – standard = PI – Processing Instruction can occur elsewhere = comment can occur elsewhere Root Element Element – Start tag & matching end tag Nested structure of child elements Or character data (or Both! – mixed data) Children - “Struct” – item= (date,…,quantity) all different names “Array” – Invoice = item * Attributes in start tag name/value pair – simple string “control” information Empty element – name, possibly attributes, No content, no end tag, use “ ” Combined array & struct Invoice = customer, item*, …

Enabling Grids for E-sciencE PPARC Summer School, May 2005 Schemas (and XML) 5 Notation Use XML a lot - Schemas, Soap, WSDLs – so clearer/briefer notations Textual – Abbreviate End Tags to just direct translation to actual XML use indentation to indicate structure always have to actually put name in end tag !!!! Tree diagram – to emphasise structure 10/24/ …

Enabling Grids for E-sciencE PPARC Summer School, May 2005 Schemas (and XML) 6 <businessForms:Invoice customerType=“businessForms:trade” > 10/22/ Multi-lingual Documents XML = eXtensible Markup Language – the markup vocabulary is not fixed XML requires explicit definition of the language - Schema One document can combine multiple languages – red, green, blue, purple Language = “namespace” identified by prefix - namespace:name Applies to – element names, attribute names, values businessForms:Invoice –An Invoice construct within the businessForms(mythical) language –A language for business interoperability –Defines structure of documents, but –Does not prescribe the language of some individual items such as dates  Taken from separate languages - USnotations:date Usually gives namespace For Children attributes

Enabling Grids for E-sciencE PPARC Summer School, May 2005 Schemas (and XML) 7 Types of XML Language Fundamental Standards –E.g. SOAP - the language for soap messages  soap-envelope:header soap-envelope:body  A soap message is an XML document and its parts are identified using this vocabulary –Goal is a factoring that gives pick-and-mix of combinable standards –Associated with any WS standard will be a Schema definition of its XML language …. Community conventions –Perhaps, our BusinessForms language …. Specific Application Language –myProgram:parameter1 –The language used in invoking particular operations of a web service

Enabling Grids for E-sciencE PPARC Summer School, May 2005 Schemas (and XML) 8 Namespaces A namespace (= “language”) –Defines a collection of names (a vocabulary)  For UK : {address, county, postCode, …. } –Usually has an associated syntax (e.g. Schema definition)  address = … county, postCode, …  Syntax may be available to S/W processing it –Implies a semantics – the (programmer writing) S/W processing a UK:address knows what it means –Provides a unique prefix for disambiguating names from different originators  UK vs. US vs. INT … … … … … … … … … … …. ….

Enabling Grids for E-sciencE PPARC Summer School, May 2005 Schemas (and XML) 9 Namespace Names To get uniqueness of namespace name, use a URI –UK:postCode is really (mythical) –The URI might be a real URL, for accessing the syntax definition, documentation, …. –But it may be just an identifier within the internet domain owned by the namespace owner But is –Tediously long to use throughout the document –Outside XML name syntax  Namespaces are not part of XML  A supplementary standard In an XML document –declare a namespace prefix, as an attribute of an element  xmlns:UK=“ –then use that for names in that namespace - UK:postCode  UK:post code is called a QName (qualified name)

Enabling Grids for E-sciencE PPARC Summer School, May 2005 Schemas (and XML) 10 Namespace Prefix Declarations Namespace declaration occurs as an attribute of an element –i.e. within a start tag Scope is from beginning of that start tag to matching end tag –Excluding scope of nested re-declarations of same prefix Can declare a default namespace –xlmns=“www/3” – this is the name space for all un-qualified names in the scope of this declaration, eg. Street –But no defaulting for attributes – if no prefix, no namespace … … … … … … … … … … …. ….

Enabling Grids for E-sciencE PPARC Summer School, May 2005 Schemas (and XML) 11 Well-formed and Valid Well-formed means it conforms to the XML syntax, e.g. –Start and end tags nest properly with matching names Valid means it conforms to the syntax defined by the namespaces used –Can’t check this without a definition of that syntax –  Normally a Schema  DTD (document Type Definitions) – deprecated  Others type definition system – some more sophisticated than Schemas XMLSPY – an XML editor that can use the schema to –Validate – check a document against the schema –Anticipate – show menu of valid options

Enabling Grids for E-sciencE PPARC Summer School, May 2005 Schemas (and XML) 12 SCHEMA Structures Goals – –General appreciation of XML and Schemas –Sufficient detail of XML and Schemas to understand WSDLs Structure –XML (review & namespaces) –Schema Structure –Schema Bureaucracy –Extensibility

Enabling Grids for E-sciencE PPARC Summer School, May 2005 Schemas (and XML) 13 Type Validation A Schema defines the syntax for an XML language in an XML document Example – Schema language – xs:… or xsd:… also xsi:… Schema is a type, quite like a programming language type declaration –defines a range of possible instances “instance is validated by the schema” – it satisfies the schema definition My terminology – “schema matches the instance” “instance matches the schema” If(a) Instance element name = a schema element name (b) Content matches syntax - recursively Then(c) Instance document matches schema …. Content …. … syntax … Schema Instance Matches (a) (b) (c)

Enabling Grids for E-sciencE PPARC Summer School, May 2005 Schemas (and XML) 14 … …. <xs:element ref="note" minOccurs="0" maxOccurs="3“ /> <xs:element name="entry" type="entryT" maxOccurs="unbounded“ /> Complex Type Structure 10/24/04 Z135-ACE … 7-day … …. … Sequence – order of named children Max/min - repetitions of each (default 1..1) Structure – three ways to define element’s structure

Enabling Grids for E-sciencE PPARC Summer School, May 2005 Schemas (and XML) Anonymous Types <xs:schema …. … …. <xs:element ref="note" minOccurs="0" maxOccurs="3"/> <xs:element name="entry" type="entryT" maxOccurs="unbounded"/> … 10/24/04 Z135-ACE … 7-day … …. …

Enabling Grids for E-sciencE PPARC Summer School, May 2005 Schemas (and XML) Named Type <xs:schema …. … …. <xs:element ref="note" minOccurs="0" maxOccurs="3"/> <xs:element name="entry" type="entryT" maxOccurs="unbounded"/> … 10/24/04 Z135-ACE … 7-day … …. …

Enabling Grids for E-sciencE PPARC Summer School, May 2005 Schemas (and XML) Referenced Element <xs:schema …. … …. <xs:element ref="note" minOccurs="0" maxOccurs="3"/> <xs:element name="entry" type="entryT" maxOccurs="unbounded"/> … 10/24/04 Z135-ACE … 7-day … …. … Matches name & structure

Enabling Grids for E-sciencE PPARC Summer School, May 2005 Schemas (and XML) 18 Global Items Annotations – Documentation (also appinfo) Can also go deeper in to annotate parts of structures … Here is a Schema … Order of global items is not significant Global (named) Types – Simple or complex – Use in giving type of element Global Elements - two roles Can be referenced from elsewhere as another way of giving “type” –  but must use same name The instance document can have an instance of this as its root element –PO or Note – not what’s intended in this case! Other things e.g. attributes, groups

Enabling Grids for E-sciencE PPARC Summer School, May 2005 Schemas (and XML) 19 Features of Complex Elements Nillable – can match element with attribute xsi:nil = “true”, and no content Occurrences – minOccurs, maxOccurs. Default is max can be “unbounded” –This schema item can match N occurrences of the element, Min<=N<=Max Model (feature of type)– –Sequence – each component matched in this order  But each component may actually match no elements or multiple elements  If there are any notes – after customer and before first entry 10/24/04 Z135-ACE …. … … <xs:element name="customer“ nillable=“1”> …. <xs:element ref="note" minOccurs="0" maxOccurs="3"/> <xs:element name="entry" type="entryT" maxOccurs="unbounded"/>

Enabling Grids for E-sciencE PPARC Summer School, May 2005 Schemas (and XML) 20 Complex Types – Models Model – –Sequence – each component matched in this order –Choice – one and only one component is matched  But each component may actually match no elements or multiple elements … 10/24/04 … 24/10/04 …

Enabling Grids for E-sciencE PPARC Summer School, May 2005 Schemas (and XML) 21 Complex Elements – Models Model – –Sequence – each component matched in this order –Choice – one and only one component is matched  But each component may actually match no elements or multiple elements –All – each component matched in any order – use for “Struct”  Each component must match one or zero elements – maxOccurs=“1” … … … … … … … … …

Enabling Grids for E-sciencE PPARC Summer School, May 2005 Schemas (and XML) 22 Simple Elements/Types … optional restrictions …. …. <xs:element name="accNo“ type="accNoT"/> …. <xs:element ref="note" minOccurs="0" maxOccurs="3"/> …. … optional restrictions …. …. Z135-ACE … to collect ….. Simple Type – named or anonymous Element features Occurrences (local element) Default / Fixed values Nillable Type features Derivation as Restriction Base simple type ultimately a primitive type - xs:type Restrictions patterns, enumerations, … Derivation as Union Derivation as List White Space handling

Enabling Grids for E-sciencE PPARC Summer School, May 2005 Schemas (and XML) 23 Attributes Can associate attributes with an element –By naming a globally declared attribute –By in-line definition Attribute has features – –Some simple type –Default/fixed –Use – optional (default), prohibited, required …. <xs:attribute name="collect" type="xs:boolean" use="optional" default="false"/> … ….

Enabling Grids for E-sciencE PPARC Summer School, May 2005 Schemas (and XML) 24 SCHEMA Bureaucracy Goals – –General appreciation of XML and Schemas –Sufficient detail of XML and Schemas to understand WSDLs Structure –XML (review & namespaces) –Schema Structure –Schema Bureaucracy –Extensibility

Enabling Grids for E-sciencE PPARC Summer School, May 2005 Schemas (and XML) 25 Target Namespace The name of the language for which this schema defines the syntax This schema will only match an instance if its namespace matches - <xs:schema … targetNameSpace= “ … … If schema has no targetNameSpace – it can only match un-qualified names

Enabling Grids for E-sciencE PPARC Summer School, May 2005 Schemas (and XML) 26 Include All must be same target namespace Forms one logical schema as the combination of physically distinct schemas I.e. referencing main as the schema allows document to be a PO or an Inv Allows individual document definitions to share type definitions <schema targetNameSpace= “…www. …/forms/ns”> <include schemaLocation= “…www…/Forms/Types.xsd"/> …. …www… /Forms/PO.xsd <schema targetNameSpace= “…www. …/forms/ns”> <simpleType name= “AccNoT“> …. ….other types …. …www… /Forms/Types.xsd <schema targetNameSpace= “…www. …/forms/ns”> <include schemaLocation= “…www…/Forms/Types.xsd"/> …. …www… /Forms/Inv.xsd <schema targetNameSpace= “…www. …/forms/ns”> <include schemaLocation= “…www…/Forms/PO.xsd"/> <include schemaLocation= “…www…/Forms/Inv.xsd"/> …www… /Forms/main.xsd

Enabling Grids for E-sciencE PPARC Summer School, May 2005 Schemas (and XML) 27 Import Include is to distribute the definition of this namespace (language) over multiple Schema definitions Import is to allow use of other namespaces (languages) in the definition for this language. <schema targetNameSpace= “…www. …/Standards/ns” > <simpleType name= “USdateT“> …. ….other types …. …www… /Standards.xsd <schema targetNameSpace= “…www. …/forms/ns” xmlns:st =“…www…/Standards/ns” > <import namespace= “…www…/Standards/ns” schemaLocation= “…www… /Standards.xsd” > …. … …www… /Forms/PO.xsd Must have namespace definition for import’s namespace

Enabling Grids for E-sciencE PPARC Summer School, May 2005 Schemas (and XML) 28 Odd & Ends <xs:schema elementFormDefault="qualified" attributeFormDefault="unqualified" xmlns:xs= “ xmlns:xsi= " … ….. An XML document – Although schema can be e.g. part of a WSDL document Whether a child/attribute needs to repeat the namespace qualification <it:outer it:attr=“it:value xmlsns:it=“…”> …. Can put in XML level comments as well as schema level annotations Standard namespace prefixes xs / xsd – XML Schema Definintion xsi – XML Schema instances

Enabling Grids for E-sciencE PPARC Summer School, May 2005 Schemas (and XML) 29 Extensibility Goals – –General appreciation of XML and Schemas –Sufficient detail of XML and Schemas to understand WSDLs Structure –XML (review & namespaces) –Schema Structure –Schema Bureaucracy –Extensibility

Enabling Grids for E-sciencE PPARC Summer School, May 2005 Schemas (and XML) 30 Don’t Care Content Allow the originator to include their own information –MyRef’s do not need to be understood by this application –Just copied back in the invoice/statement as YourRef This style, using “any” type –Completely unconstrained –Requires a containing element, called MyRef PO date account entry note MyRef Type=“xsi:any” xlmns:me = “….” Xlmns:you=”…” … … …. Complex - sequence Occurs – 1..1 date note Occurs – 0..* entry MyRef Occurs – 0..1 Occurs – 1..* Use XMLSpy notation

Enabling Grids for E-sciencE PPARC Summer School, May 2005 Schemas (and XML) 31 Don’t Care too much Content Use a new kind of component, – instead of … –This is an Extension point – a place where this languages can be extended with an element from some other language This style, using “any” element –Constrained – what can be provided should be defined in the specified namespace PO date account entry note any xlmns:st = “… standards/ns”” Xlmns:you=”…” … … …. namespace= “…www…/Standards/ns” MyRef

Enabling Grids for E-sciencE PPARC Summer School, May 2005 Schemas (and XML) 32 Any Elements Namespace options, “X” = –“##any” –“##local” this namespace –“##other” anything but this namespace –“ wwx.NS1 …” whitespace-separated list of namespace names, Can include “##targetnamespace Processing options, “Y” = –“skip” – no validation –“strict” – must obtain the namespace schema and validate the content –“lax” – validate what you can PO any namespace=“X” processContents=“Y” MyRef … <xs:any namespace=“X” processContents=“Y” minOccurs=“0” maxOcurrs =“ubounded”/> … date Schema

Enabling Grids for E-sciencE PPARC Summer School, May 2005 Schemas (and XML) 33 Evolution The loose-coupling principles of web services means that a schema should allow for change which is –Forward compatible – newer versions of documents can be used by old S/W: new producer, old consumer –Backward Compatible – older versions of documents can be used by newer S/W : old producer, new consumer Evolving may be by –New Versions – the original authors enhancing the language –New Extensions – others enhancing the language An Any element (wildcard) is an explicit extension point that allow compatibility as the language evolves Typically, for every complex element –Make the last component an Any which occurs 0..* times –For versioning, make it ##local –For extensions, make it ##other

Enabling Grids for E-sciencE PPARC Summer School, May 2005 Schemas (and XML) 34 Obtaining Compatibility lax – gives forward compatibility –V1 consumer (coded using V1 schema) –can process document produced by V2 producer Optionality on new item gives backward compatibility –V2 consumer –can process document produced by V1 producer If compatibility is not the reality – –use a new namespace name for the new version entryT prodCode quant Note PO date account entry note any entryT prodCode quant Note any urgency Version V1 SchemaVersion V2 Schema lax matches

Enabling Grids for E-sciencE PPARC Summer School, May 2005 Schemas (and XML) 35 Determinism Requirement When “parsing” the instance, The note in instance could correspond to –The note in schema –The any in schema The Schema standard prohibits this non-determinism –Can’t have an Any within Choice or All –Can’t have an Any before or after a variable occurrence component. If disjoint namespaces then not a problem – – –The namespace will indicate whether something matches the Any entryT prodCode quant note any urgency V2 schema lax …...</ matches V2 instance

Enabling Grids for E-sciencE PPARC Summer School, May 2005 Schemas (and XML) 36 Design for Deterministic Extensibilty I Put variable occurrence structure within a mandatory single-occurrence container PO date account entry note any violation PO date account entry note any entries fix entryT prodCode quant note any urgency violation note urgency entryT prodCode quant any V2options fix

Enabling Grids for E-sciencE PPARC Summer School, May 2005 Schemas (and XML) 37 Design for Deterministic Extensibilty II Problem with V2 - its any for second extension Solutions (?) –Make at least V2el2 mandatory, losing backward compatibility –  V1 document fails against V2 processor –Remove the extension point, losing forward compatibility  New schema has to be new namespace – V2 processor can’t deal with V3 document Solution -V2# - Nest Extensions – yes, but cumbersome entryT prodCode quant any V1options V1 prodCode quant V1options V2ext entryT V2el1 V2el2 V2options any V2# prodCode quant any V1options V2el1 V2el2 entryT V2 violation

Enabling Grids for E-sciencE PPARC Summer School, May 2005 Schemas (and XML) 38 Any Attributes Same concept as Any elements –procesContents – lax / strict / skip –namespace allowed – ##other etc. Can’t constrain how many Don’t have determinism issues –Because no order or repetition …

Enabling Grids for E-sciencE PPARC Summer School, May 2005 Schemas (and XML) 39 Further Aspects Uniqueness and key Constraints Complex Type Derivation Final and Abstract Groups –Attribute –Element

Enabling Grids for E-sciencE PPARC Summer School, May 2005 Schemas (and XML) 40 Peculiarities Compared with usual type definition framework –Element component can be attribute or child –Three ways to define the “type” of a value  Giving the sub-structure directly – anonymous type  Referring to a Type definition  Referring to an Element definition –Mixing of “struct” and “array” –Implicit “choice” of Global elements –Allows extension points –Allows Mixed Content –Quite a complex structure –  Is itself an XML document  Easier to read than to write

Enabling Grids for E-sciencE PPARC Summer School, May 2005 Schemas (and XML) 41 END THE END