Copyright 2004 John Cowan 1 Infinite Diversity in Infinite Combinations why one schema language is not enough John Cowan.

Slides:



Advertisements
Similar presentations
W3C SML F2F XML Schema 1.1 Sandy Gao, IBM.
Advertisements

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
W3C XML Schema: what you might not know (and might or might not like!) Noah Mendelsohn Distinguished Engineer IBM Corp. October 10, 2002.
Can schemas help SVG interwork with other markup vocabularies? MURATA Makoto (FAMILY Given) International University of Japan XHTML XForms SVG XML Events.
ISO DSDL ISO – Document Schema Definition Languages (DSDL) Martin Bryan Convenor, JTC1/SC18 WG1.
XML Schema techniques: issues and recommendations SAML F2F #4 Eve Maler 28 August 2001.
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.
Document Type Definitions
13-Jun-15 RELAX NG. 2 Caveat I did not have a RELAX NG validator when I wrote these slides. Therefore, if an example appears to be wrong, it probably.
15-Jun-15 RELAX NG. 2 What is RELAX NG? RELAX NG is a schema language for XML It is an alternative to DTDs and XML Schemas It is based on earlier schema.
Lecture 14 XML Validation. a simple element containing text attribute; attributes provide additional information about an element and consist of a name.
RELAX NG. Caveat I did not have a RELAX NG validator when I wrote these slides. Therefore, if an example appears to be wrong, it probably is.
Sunday, June 28, 2015 Abdelali ZAHI : FALL 2003 : XML Schemas XML Schemas Presented By : Abdelali ZAHI Instructor : Dr H.Haddouti.
XML Introduction What is XML –XML is the eXtensible Markup Language –Became a W3C Recommendation in 1998 –Tag-based syntax, like HTML –You get to make.
Document Type Definitions. XML and DTDs A DTD (Document Type Definition) describes the structure of one or more XML documents. Specifically, a DTD describes:
Manohar – Why XML is Required Problem: We want to save the data and retrieve it further or to transfer over the network. This.
 ACORD ACORD’s Experiences using W3C Schemas Dan Vint Senior Architect
XP New Perspectives on XML Tutorial 4 1 XML Schema Tutorial – Carey ISBN Working with Namespaces and Schemas.
Lecture 15 XML Validation. a simple element containing text attribute; attributes provide additional information about an element and consist of a name.
ULI101 – XHTML Basics (Part II) What is Markup Language? XHTML vs. HTML General XHTML Rules Block Level XHTML Tags XHTML Validation.
SDPL 2002Notes 2: Document Instances and Grammars1 2.5 XML Schemas n A quick introduction to XML Schema –W3C Recommendation, May 2, 2001: »XML Schema Part.
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.
Scientific Markup Languages Birds of a Feather A 10-Minute Introduction to XML Timothy W. Cole Mathematics Librarian & Professor of.
CREATED BY ChanoknanChinnanon PanissaraUsanachote
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.
XSLT for Data Manipulation By: April Fleming. What We Will Cover The What, Why, When, and How of XSLT What tools you will need to get started A sample.
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.
WORKING WITH XSLT AND XPATH
An Introduction to XML Presented by Scott Nemec at the UniForum Chicago meeting on 7/25/2006.
Session IV Chapter 9 – XML Schemas
Processing of structured documents Spring 2002, Part 2 Helena Ahonen-Myka.
Lecture 22 XML querying. 2 Example 31.5 – XQuery FLWOR Expressions ‘=’ operator is a general comparison operator. XQuery also defines value comparison.
Avoid using attributes? Some of the problems using attributes: Attributes cannot contain multiple values (child elements can) Attributes are not easily.
XML A web enabled data description language 4/22/2001 By Mark Lawson & Edward Ryan L’Herault.
SDPL 2005Notes 2.5: XML Schemas1 2.5 XML Schemas n Short introduction to XML Schema –W3C Recommendation, 1 st Ed. May, 2001; 2 nd Ed. Oct, 2004: »XML Schema.
New Perspectives on XML, 2nd Edition
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.
An Introduction to XML Sandeep Bhattaram
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
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.
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.
COMP9321 Web Application Engineering Semester 2, 2015 Dr. Amin Beheshti Service Oriented Computing Group, CSE, UNSW Australia Week 4 1COMP9321, 15s2, Week.
Web Technologies Lecture 4 XML and XHTML. XML Extensible Markup Language Set of rules for encoding a document in a format readable – By humans, and –
When we create.rtf document apart from saving the actual info the tool saves additional info like start of a paragraph, bold, size of the font.. Etc. This.
XML CSC1310 Fall HTML (TIM BERNERS-LEE) HyperText Markup Language  HTML (HyperText Markup Language): December  Markup  Markup is a symbol.
XML Validation II Advanced DTDs + Schemas Robin Burke ECT 360.
XML Validation. a simple element containing text attribute; attributes provide additional information about an element and consist of a name value pair;
Lecture 23 XQuery 1.0 and XPath 2.0 Data Model. 2 Example 31.7 – User-Defined Function Function to return staff at a given branch. DEFINE FUNCTION staffAtBranch($bNo)
Using DSDL plus annotations for Netconf (+) data modeling Rohan Mahy draft-mahy-canmod-dsdl-01.
OWL Web Ontology Language Summary IHan HSIAO (Sharon)
CIS 228 The Internet 9/20/11 XHTML 1.0. “Quirks” Mode Today, all browsers support standards Compliant pages are displayed similarly There are multiple.
 XML derives its strength from a variety of supporting technologies.  Structure and data types: When using XML to exchange data among clients, partners,
SDPL : XML Schemas1 2.5 XML Schemas n Short introduction to XML Schema –W3C Recommendation, 1 st Ed. May, 2001; 2 nd Ed. Oct, 2004: »XML Schema.
XML Schemas Dr. Awad Khalil Computer Science Department AUC.
Product Training Program
CIS 228 The Internet 9/20/11 XHTML 1.0.
Infinite Diversity in Infinite Combinations
Java XML IS
XML QUESTIONS AND ANSWERS
XML in Web Technologies
Data Modeling II XML Schema & JAXB Marc Dumontier May 4, 2004
Presentation transcript:

Copyright 2004 John Cowan 1 Infinite Diversity in Infinite Combinations why one schema language is not enough John Cowan

Copyright 2004 John Cowan 2 Copyright ● Copyright 2004 John Cowan ● Licensed under the GNU General Public License ● Black and white for readability ● ABSOLUTELY NO WARRANTIES; USE AT YOUR OWN RISK ● The Gentium font is available at

Copyright 2004 John Cowan 3 The status quo ● W3C's XML Schema (WXS) is everywhere:  Many document types are defined by it  SOAP encoding uses its datatypes  WSDL descriptions specify message formats with it  XPath 2.0 and XQuery 1.0 have it embedded into them

Copyright 2004 John Cowan 4 But... ● WXS is difficult ● WXS is incomplete ● WXS is not formally specified ● WXS is not extensible ● There are many useful concepts that WXS can't specify completely or at all

Copyright 2004 John Cowan 5 RELAX NG ● An evolution/generalization of DTDs ● Shares the same basic paradigm ● Based on experience with SGML, XML ● Adds and subtracts features from DTDs ● DTDs can be automatically converted

Copyright 2004 John Cowan 6 Reusable Knowledge ● Experts in designing other kinds of schemas will find their skills transfer easily to RELAX NG ● Design patterns commonly used in XML DTDs, as well as in WXS, can be reused in RELAX NG ● RELAX NG is much more mature than if based on a completely new and different paradigm ● A much higher degree of confidence in its design is possible

Copyright 2004 John Cowan 7 Simplicity ● RELAX NG is designed for simplicity  Read it in a few minutes, write it in a few hours  Arbitrary restrictions are very few  Constructs mean what you would guess they mean ● WXS is full of surprises and corner cases  Child elements and attributes not treated uniformly  Simple declarations and wildcards are different

Copyright 2004 John Cowan 8 Clarity ● The descriptions of RELAX NG are clear  The formal definition is complete and normative, with a solid basis in mathematical theory  The informal (but normative) prose and the non- normative tutorials are simple and cover the whole language

Copyright 2004 John Cowan 9 Clarity ● The WXS normative definition is extremely hard to follow  You have to understand it to be sure you fully understand a particular WXS schema  Most people only understand certain stereotyped ways of using WXS  Independent implementations aren't always consistent in their interpretation of the definition

Copyright 2004 John Cowan 10 Co-occurrence constraints ● It's common to want to constrain the attributes and child elements of an element jointly:  two attributes (or an attribute and a child element) may be mutually exclusive  the content model may depend on the particular value of an attribute (like HTML's input element)

Copyright 2004 John Cowan 11 Co-occurrence constraints ● WXS doesn't do co-occurrence constraints, even though they come up all the time in real-world documents ● One exception: WXS can specify that an element is nil by using a reserved attribute, xsi:nil. ● RELAX NG can handle this and other cases without any special machinery.

Copyright 2004 John Cowan 12 Unordered content ● DTDs only support totally unstructured unordered content ● WXS adds the ability to say “all of these children in any order” but only at the top level of an element ● RELAX NG allows unordered content at any level ● RELAX NG allows interleaved content streams

Copyright 2004 John Cowan 13 Unordered content ● So this schema... element head { element meta { empty }* & element title { text } } ● … matches a head element that has any number of meta child elements (including zero) and a required title child element mixed in anywhere.

Copyright 2004 John Cowan 14 Datatypes ● DTDs have only trivial datatypes for attribute values, none for character content ● WXS has a huge list of badly designed datatypes ● RELAX NG can support the WXS datatypes or any other set (generic or application specific) that can be devised ● An interface standard for pluggable datatype libraries has been defined

Copyright 2004 John Cowan 15 WXS Datatype Issues ● Too many primitive types, some duplicative ● Not enough useful primitive types ● No support for localized types ● No structured types except dates and URIs ● No way to validate against an external list ● No way to change anything for yourself

Copyright 2004 John Cowan 16 Vocabularies vs. Documents ● WXS specifies a vocabulary of elements and attributes that may appear in documents ● RELAX NG specifies the structure of particular document types ● Namespace Routing Language (not yet standardized) lets you validate composite documents using multiple schemas (including WXS, RNG, and even Schematron)

Copyright 2004 John Cowan 17 Finding Schemas ● WXS provides a schemaLocation attribute so that a document can point to its schema, but it's just a hint ● RELAX NG allows any document to be validated against any schema  There is no One True Way to find the schema  A document can be formatted against different schemas for different purposes

Copyright 2004 John Cowan 18 Defaults ● DTDs allow attribute defaulting ● WXS extends this to element content defaulting ● Both mechanisms change the basic content of a document based on whether it's been validated or not ● RELAX NG leaves such transformations up to transformation programs like XSLT, improving modularity

Copyright 2004 John Cowan 19 Standards ● WXS is a W3C Recommendation ● RELAX NG is an OASIS Committee Specification and a Draft International Standard ● De facto, WXS has more tools supporting it ● RELAX NG is beginning to spread to those tools, and has some tools of its own ● Even some W3C documents use RELAX NG to specify document types

Copyright 2004 John Cowan 20 RELAX NG advantages ● Organized around patterns ● Patterns are composable without restrictions (very nearly) ● Unrestricted support for mixed content ● Unrestricted support for unordered content ● A compact syntax for authoring, an XML syntax for processing

Copyright 2004 John Cowan 21 RELAX NG doesn't do... ● Identity constraints other than ID/IDREF/IDREFS  but in WXS they are specified by a specialized sublanguage ● Infoset augmentation ● Inheritance of complex types ● PSVI  most WXS validators don't expose it anyway

Copyright 2004 John Cowan 22 RELAX NG Tools ● Validators in Java, VB6, C# ● Translators to and from other schema languages, including WXS  You can author in RELAX NG and deliver in WXS ● Data binding tools generate object trees corresponding to particular schemas ● Guided editing with XML tools or Emacs

Copyright 2004 John Cowan 23 And now, to relax!

Copyright 2004 John Cowan 24

Copyright 2004 John Cowan 25 MORE INFORMATION odp,.pdf}