W3C XML Schema: what you might not know (and might or might not like!) Noah Mendelsohn Distinguished Engineer IBM Corp. October 10, 2002.

Slides:



Advertisements
Similar presentations
On and use=document|rpc, style=literal|encoded A personal opinion Sanjiva Weerawarana IBM Research September 9-11, 2002.
Advertisements

OASIS OData Technical Committee. AGENDA Introduction OASIS OData Technical Committee OData Overview Work of the Technical Committee Q&A.
XML Schema Heewon Lee. Contents 1. Introduction 2. Concepts 3. Example 4. Conclusion.
CSPP51038 WSDL in depth. Advanced Schema features (required for understanding wsdl)
What is XML? a meta language that allows you to create and format your own document markups a method for putting structured data into a text file; these.
XML: Extensible Markup Language
CIS 375—Web App Dev II SOAP.
SDPL 2003Notes 2: Document Instances and Grammars1 2.5 XML Schemas n A quick introduction to XML Schema –W3C Recommendation, May 2, 2001: »XML Schema Part.
Arthur Fink Page 1 Thinking about User Interface Design for OpenEdge GUI for.NET (or any other environment) by Arthur Fink
XML A brief introduction ---by Yongzhu Li. XML --- a brief introduction 2 CSI668 Topics in System Architecture SUNY Albany Computer Science Department.
Document Type Definitions. XML and DTDs A DTD (Document Type Definition) describes the structure of one or more XML documents. Specifically, a DTD describes:
Introduction to XML This material is based heavily on the tutorial by the same name at
 ACORD ACORD’s Experiences using W3C Schemas Dan Vint Senior Architect
Health Level Seven Experience Report Paul V. Biron Kaiser Permanente W3C XML Schema User Experience Workshop, Jun 21-22, 2005.
XML, distributed databases, and OLAP/warehousing The semantic web and a lot more.
Creating a Basic Web Page
XML introduction to Ahmed I. Deeb Dr. Anwar Mousa  presenter  instructor University Of Palestine-2009.
XML Developers 99—FpML: Initial Design Tradeoffs © 1999 Fragment Art & Research, Inc.—New York 1 Axel Fragment Art & Research, Inc.
XML Anisha K J Jerrin Thomas. Outline  Introduction  Structure of an XML Page  Well-formed & Valid XML Documents  DTD – Elements, Attributes, Entities.
Introduction to XML cs3505. References –I got most of this presentation from this site –O’reilly tutorials.
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.
XML and XSL Institutional Web Management 2001: Organising Chaos.
T Network Application Frameworks and XML Web Services and WSDL Sasu Tarkoma Based on slides by Pekka Nikander.
Scientific Markup Languages Birds of a Feather A 10-Minute Introduction to XML Timothy W. Cole Mathematics Librarian & Professor of.
CREATED BY ChanoknanChinnanon PanissaraUsanachote
1 XML Schemas. 2 Useful Links Schema tutorial links:
Neminath Simmachandran
What is XML?  XML stands for EXtensible Markup Language  XML is a markup language much like HTML  XML was designed to carry data, not to display data.
Intro. to XML & XML DB Bun Yue Professor, CS/CIS UHCL.
Session IV Chapter 9 – XML Schemas
Processing of structured documents Spring 2002, Part 2 Helena Ahonen-Myka.
XML A web enabled data description language 4/22/2001 By Mark Lawson & Edward Ryan L’Herault.
XP Tutorial 9 1 Working with XHTML. XP SGML 2 Standard Generalized Markup Language (SGML) A standard for specifying markup languages. Large, complex standard.
XML – An Introduction Structured Data Mark-up James McCartney CSCE 590, Cluster and Grid Computing.
Web Services Standards. Introduction A web service is a type of component that is available on the web and can be incorporated in applications or used.
HTML: Hyptertext Markup Language Doman’s Sections.
1 Introduction  Extensible Markup Language (XML) –Uses tags to describe the structure of a document –Simplifies the process of sharing information –Extensible.
An OO schema language for XML SOX W3C Note 30 July 1999.
Auto-generation of Repeated Elements Part 2 of a series of XForms auto generation Date: 1/25/2008 Dan McCreary President Dan McCreary & Associates
“This presentation is for informational purposes only and may not be incorporated into a contract or agreement.”
1 Construction Chapter Key Concepts Be familiar with the system construction process. Understand different types of tests and when to use Understand.
1 Credits Prepared by: Rajendra P. Srivastava Ernst & Young Professor University of Kansas Sponsored by: Ernst & Young, LLP (August 2005) XBRL Module Part.
C++ Programming Basic Learning Prepared By The Smartpath Information systems
Sheet 1XML Technology in E-Commerce 2001Lecture 2 XML Technology in E-Commerce Lecture 2 Logical and Physical Structure, Validity, DTD, XML Schema.
1 Class Diagrams. 2 Overview Class diagrams are the most commonly used diagrams in UML. Class diagrams are for visualizing, specifying and documenting.
XML eXtensible Markup Language. XML A method of defining a format for exchanging documents and data. –Allows one to define a dialect of XML –A library.
1 “Universal Data-Speak”: The eXtensible Markup Language Zack Ives CSE 590DB, Winter 2000 University of Washington 3 January 2000.
COMP9321 Web Application Engineering Semester 2, 2015 Dr. Amin Beheshti Service Oriented Computing Group, CSE, UNSW Australia Week 4 1COMP9321, 15s2, Week.
Issues in Ontology-based Information integration By Zhan Cui, Dean Jones and Paul O’Brien.
David Orchard W3C Lead BEA Systems Web service and XML Extensibility and Versioning.
XML Schemas Experiences Rogue Wave Software Allen Brookes.
Copyright 2004 John Cowan 1 Infinite Diversity in Infinite Combinations why one schema language is not enough John Cowan.
Technical Steering Committee La Jolla, January 2003 Paul Kiel, HR-XML.
XML Validation II Advanced DTDs + Schemas Robin Burke ECT 360.
14 October 2002GGF6 / CGS-WG1 Working with CIM Ellen Stokes
Using DSDL plus annotations for Netconf (+) data modeling Rohan Mahy draft-mahy-canmod-dsdl-01.
 XML derives its strength from a variety of supporting technologies.  Structure and data types: When using XML to exchange data among clients, partners,
SEMI-STRUCTURED DATA (XML) 1. SEMI-STRUCTURED DATA ER, Relational, ODL data models are all based on schema Structure of data is rigid and known is advance.
YANG Background and Discussion: Why we need a new language for NETCONF configuration modeling The YANG Gang IETF 70 Vancouver, Canada.
XML Extensible Markup Language
I Copyright © 2004, Oracle. All rights reserved. Introduction.
XML Schemas Dr. Awad Khalil Computer Science Department AUC.
Training for developers of X-Road interfaces
Product Training Program
Training for developers of X-Road interfaces
Implementing the Surface Transportation Domain
XML QUESTIONS AND ANSWERS
Eugenia Fernandez IUPUI
Data Modeling II XML Schema & JAXB Marc Dumontier May 4, 2004
CSE591: Data Mining by H. Liu
Presentation transcript:

W3C XML Schema: what you might not know (and might or might not like!) Noah Mendelsohn Distinguished Engineer IBM Corp. October 10, 2002

Topics Quick review of XML concepts Why XML Schema? What is XML Schema? Where do schemas come from? A few validation tricks Wrapup

Warning! To save screen space, some examples are simplified. Namespace decls. are omitted, only the key parts of schema declarations are shown, etc.

Quick review of XML concepts

This is an XML document

Infoset: the XML data model Element information item: [localname] = “e3” [children] = Attribute info item for a1 Attribute information item: [localname] = “a1” [children] = “1”, “2”, “3”

More on XML infosets XML 1.0 describes only documents with angle bracket syntax “ ” Infosets also describe DOM, SAX, and other representations XML Schema validates infosets…applies to all of the representations XML Schema can validate from any element information item (e.g. e1 or e2)

Why XML Schema?

What are schemas for? Contracts: agreeing on formats Tool building: know what the data will be before the first instance shows up Database integration User interface tools Programming language bindings Validation: make sure we got what we expected

What is XML Schema?

This is an XML document <myns:e1 xmlns:myns=“ xmlns:yourns=“

<xsd:schema targetNamespace=“ xmlns:xsd=" ommitted to protect innocent..”> </xsd:element This is an XML schema Wrong! This is not an XML Schema, it’s an XML schema document!

<xsd:schema targetNamespace=“ xmlns:xsd=" ommitted to protect innocent..”> </xsd:element This is an XML schema document

This is an XML document xmlns:myns=“ xmlns:yourns=“ To validate this, we need >1 schema document

Import brings in declarations for other namespaces <xsd:schema targetNamespace=“ xmlns:xsd=" ommitted to protect innocent..”> <import namespace=“ schemaLocation=“ </xsd:element

Terminology

Cool tricks with components In memory schemas Handy tools for working with schemas Build the components for you Resolve subtyping across namepaces, etc. Examples: Henry Thompson’s XSV Conformance testing

How to read the spec. 3.3 Element Declarations The Element Declaration Schema Component XML Representation of Element Declaration Schema Components Constraints on XML Representations of Element Declarations Element Declaration Validation Rules Element Declaration Information Set Contributions Constraints on Element Declaration Schema Components Warning: the spec. never gives any rule twice!

Post-schema validation infoset (PSVI) Fearsome title, simple concept Infoset: the data model for an XML document…tells you what you can know (that matters) after a parse. PSVI: tells you what you can know after a validation What parts of doc are valid? Per which types? Default values Etc.

Self-describing vs. schema- described docs You can use xsi:type in your documents: 123 Use xsi:type with built ins (and no attributes) Your document is nearly self-describing SOAP encoding supports this xsi:type with your own types Partially self-describing You know the type names – need schema to know what types are SOAP 1.2 Encoding supports this too!

Where do schemas come from?

How are schema components found? In short, wherever you want! Hint from schema: Hint from instance: Processor command line or config Compiled into application (validating HTML editor)

Why all this flexibility? > 1 schema / namespace (versions, bug fixes, experiments, etc.) Who gets control? “Docheads” want to name schema in instance eCommerce: do you trust the schema named in a purchaseOrder? Ultimately the application chooses Synthetic: DB builds it dynamically

Streaming Most validation can be done 1 pass Id/idref, key/keyref require limited lookaside Problem: …10Mbytes of data here… …lots more data… Answer: Assemble schema incrementally or in advance Result must be same – can’t tell which from the outside!

Our language vs. your language – why ? <xsd:schema targetNamespace=“ xmlns:ns1=“ xmlns:xsd=" … … A fragment of a schema document…

Our language vs. your language – why ? <xsd:schema targetNamespace=“ xmlns:ns1=“ xmlns:ns2=“ xmlns:xsd=" … … Add a reference to an external element…

Our language vs. your language – why ? <xsd:schema targetNamespace=“ xmlns:ns1=“ xmlns:ns2=“ xmlns:xsd=" xmlns:xsd2=" Enhance the schema language! Imported namespaces enhance your language. Unimported namespaces enhance the schema language

A few validation tricks: Modeling content

How to validate this? …your message here… What is the content model for ? Can you validate the contents?

<soap:Envelope xmlns:soap=“ … <soap:Envelope xmlns:soap=“ … Inside/out vocabularies (some specific SOAP examples) How do we write schemas For these two cases?

Schemas for envelopes Putting “skip” here says: don’t validate the content of the body

Schemas for envelopes Putting “strict” here says: you must have declarations and must successfully validate the contents of body.

Schemas for envelopes Putting “lax” here says: validate only if your schema has declarations for the contents

Versioning vocabularies & schemas It’s hard! Use namespaces? Do 50 bug fixes give you 50 namespaces? How much interop? Does old schema accept new version? What about Xpath? For better or worse: schemas has no organized model for versioning

Inheritance: why have it? Allow reuse of definitions Model real-world inheritance and polymorphism Substitutability Mappings to programming systems w/inheritance Schemas provides mechanisms offering parial solutions to these problems

Refinement vs. Extension Data inheritance is different from method inheritance No active code: receiver “sees” everything – order matters, e.g. for multiple inheritance Innovation(?) in schema: Restriction: subtype is a subset (supports substitutability) Extension: subtype builds on base (supports modular development, some mappings to real world and programming languages.) No multiple inheritance (for now)

Wrapup

Some things I learned No such thing as a “simple” feature Big committee -> big language Documents & data together are cool But neither community gets a simple schema language Make realistic schedules – we didn’t make time to pull features

Thank you!