Infinite Diversity in Infinite Combinations

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.
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.
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.
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.
Manohar – Why XML is Required Problem: We want to save the data and retrieve it further or to transfer over the network. This.
4/20/2017.
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
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.
WORKING WITH XSLT AND XPATH
An Introduction to XML Presented by Scott Nemec at the UniForum Chicago meeting on 7/25/2006.
1 © Netskills Quality Internet Training, University of Newcastle Introducing XML © Netskills, Quality Internet Training University.
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.
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
Schematron Tim Bornholtz. Schema languages Many people turn to schema languages when they want to be sure that an XML instance follows certain rules –DTD.
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.
Copyright 2004 John Cowan 1 Infinite Diversity in Infinite Combinations why one schema language is not enough John Cowan.
XML CSC1310 Fall HTML (TIM BERNERS-LEE) HyperText Markup Language  HTML (HyperText Markup Language): December  Markup  Markup is a symbol.
Martin Kruliš by Martin Kruliš (v1.1)1.
XML Validation II Advanced DTDs + Schemas Robin Burke ECT 360.
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.
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,
XML Notes taken from w3schools. What is XML? XML stands for EXtensible Markup Language. XML was designed to store and transport data. XML was designed.
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.
XML BASICS and more…. What is XML? In common:  XML is a standard, simple, self-describing way of encoding both text and data so that content can be processed.
Product Training Program
Unit 4 Representing Web Data: XML
CIS 228 The Internet 9/20/11 XHTML 1.0.
Java XML IS
XML QUESTIONS AND ANSWERS
XML in Web Technologies
Data Modeling II XML Schema & JAXB Marc Dumontier May 4, 2004
Database Processing with XML
Session III Chapter 6 – Creating DTDs
CSCE 315 – Programming Studio Spring 2013
Chapter 7 Representing Web Data: XML
New Perspectives on XML
Session II Chapter 6 – Creating DTDs
Document Type Definition (DTD)
New Perspectives on XML
Presentation transcript:

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

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 http://www.sil.org/~gaultney/gentium

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

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

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

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

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

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

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

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)

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.

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

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.

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

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

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)

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

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

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

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

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

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

And now, to relax!

http://www.ccil.org/~cowan/idic{.ppt,. odp,.pdf} MORE INFORMATION http://www.relaxng.org http://www.ccil.org/~cowan/idic{.ppt,. odp,.pdf}