xml schema 1.1 for managers
DESCRIPTION
XML Schema 1.1 for Managers. Roger L. Costello http://www.xfront.com 3 December, 2012. Purpose. The purpose of this tutorial is to give an overview of the new features of XML Schema 1.1 without getting into its syntax. It is targeted to managers. - PowerPoint PPT PresentationTRANSCRIPT
1
Copyright © [2010]. Roger L. Costello. All Rights Reserved.
XML Schema 1.1 for Managers
Roger L. Costellohttp://www.xfront.com
3 December, 2012
2
Copyright © [2010]. Roger L. Costello. All Rights Reserved.
Purpose
• The purpose of this tutorial is to give an overview of the new features of XML Schema 1.1 without getting into its syntax.
• It is targeted to managers.• I show how these new technical features can
benefit your business.
3
Copyright © [2010]. Roger L. Costello. All Rights Reserved.
Your 1.0 Schemas will still work
An XML document conforming to a 1.0 schema can be validated using a 1.1 validator, but an XML document conforming to a 1.1 schema might not validate using a 1.0 validator.
XML Schema 1.0
XML Schema 1.1
XML Schema 1.1 is a superset of XML Schema 1.0
4
Copyright © [2010]. Roger L. Costello. All Rights Reserved.
XML Schema 1.1 Validators
• The schema-aware version of SAXON (version 9.3 or later) supports the full XML Schema 1.1 specification: http://www.saxonica.com/
• Apache XERCES supports XML Schema 1.1: http://xerces.apache.org/xerces2-j/
• You can create XML Schema 1.1 schemas today!
5
Copyright © [2010]. Roger L. Costello. All Rights Reserved.
Status
• XML Schema 1.1 became a standard on April 5, 2012 (the W3C calls it a “recommendation” not a standard, but they are the same)
6
Copyright © [2010]. Roger L. Costello. All Rights Reserved.
Technology Stack
XML
Namespaces
XPath
XML Schema 1.0
XML Schema 1.1
Each technology assumes you know the technologies beneath it.
7
Copyright © [2010]. Roger L. Costello. All Rights Reserved.
Review:Purpose of
XML Schemas
8
Copyright © [2010]. Roger L. Costello. All Rights Reserved.
Two uses of XML
XML as a temporary transport vehicle:– As soon a the XML gets to its
destination the data is extracted and put into a permanent storage mechanism (such as a database).
– Applications operate on the data in the permanent storage.
XML as permanent storage:– Applications operate
directly on the XML.
XML
app
app
appXML XML
"shred"
app
app
appship the XML
9
Copyright © [2010]. Roger L. Costello. All Rights Reserved.
XML as a temporary transport vehicle
XML XML
"shred"
app
app
appship the XML
An XML Schema can be used as a contract between the sender and the receiver: "Here's the information we agree to exchange, and the format of the information."
10
Copyright © [2010]. Roger L. Costello. All Rights Reserved.
XML as permanent storage
XML
app
app
app
XML
Rob Sally Pete Jill Anthony
Often occurring in the form of a workflow:
11
Copyright © [2010]. Roger L. Costello. All Rights Reserved.
XML as permanent storage(cont.)
XML
app1 app2 app3 app4
Each application does a "unit of work." It is desirable, after each unit of work, to assess the system. XML Schemas can be used to check each application's output.
12
Copyright © [2010]. Roger L. Costello. All Rights Reserved.
Check the information–validate that no rules are being broken.
Do some work.
Then validate that no rules have been broken (as a result of the work), i.e., check that you’re still on track.
Then do another unit of work.
Then validate again.
Then do another unit of work.
Then validate again.
And so forth.
I envision systems working like this:
13
Copyright © [2010]. Roger L. Costello. All Rights Reserved.
Rules
• We live in a world of rules:– Driving: we follow the rules of the road– Queues: we form lines at banks and in the checkout
lanes at the supermarket– Taxes: accountants spend lots of time each year
learning the new tax rules– Laws: our legal system enforces societies' laws
• Rules guide our actions.• Rules let us know if we are on or off track.
14
Copyright © [2010]. Roger L. Costello. All Rights Reserved.
Rules are Important
All enterprise work as it grows toward perfection becomes rule-based
Roger Costello and Bob Wilson
15
Copyright © [2010]. Roger L. Costello. All Rights Reserved.
XML Schema = Rules
• XML Schemas is all about expressing rules:– rules about what data is allowed– rules about how the data must be organized– rules about the relationships between data
16
Copyright © [2010]. Roger L. Costello. All Rights Reserved.
Example: My Vacation
<Vacation> <Trip segment="1" mode="air"> <Transportation>airplane</Transportation> </Trip> <Trip segment="2" mode="water"> <Transportation>boat</Transportation> </Trip> <Trip segment="3" mode="ground"> <Transportation>car</Transportation> </Trip></Vacation>
17
Copyright © [2010]. Roger L. Costello. All Rights Reserved.
Validate<Vacation> <Segment id="1" mode="air"> <Transportation>airplane</Transportation> </Segment> <Segment id="2" mode="water"> <Transportation>boat</Transportation> </Segment> <Segment id="3" mode="ground"> <Transportation>car</Transportation> </Segment></Vacation>
Rule 1: A vacation has segments.Rule 2: Each segment is uniquely identified.Rule 3: There are three modes of transportation: air, water, ground.Rule 4: Each segment has a mode of transportation.Rule 5: Each segment must identify the specific mode used.
XML Schema
Validate the XMLdocument againstthe XML Schema
18
Copyright © [2010]. Roger L. Costello. All Rights Reserved.
Desirable Rules
mode Transportation
air airplane,hot-air balloon
water boat,hovercraft
ground car,bicycle
Rule: if mode = air thentransportation must be either airplane or hot-airballoon.Similar rules for water and ground.
19
Copyright © [2010]. Roger L. Costello. All Rights Reserved.
XML Schema 1.0 cannot detect this error
<Segment id="1" mode="air"> <Transportation>boat</Transportation></Segment>
These are inconsistent.Error!
Why can’t the error be detected using XML Schema 1.0?Answer: Because the rule on the preceding slide cannot be expressed.
20
Copyright © [2010]. Roger L. Costello. All Rights Reserved.
XML Schema 1.1
• Much more powerful than 1.0• Can express many more rules (The rule on the
preceding slide can be expressed!)• Let's see the new features that 1.1 provides …
21
Copyright © [2010]. Roger L. Costello. All Rights Reserved.
New Feature:Express Business Policies
and Rulesusing Assertions
22
Copyright © [2010]. Roger L. Costello. All Rights Reserved.
Example Policy
Level 1 managers may sign off on purchase requests that do not exceed $10K. Level 1 managers may sign off on purchase requests that do not exceed $10K.
23
Copyright © [2010]. Roger L. Costello. All Rights Reserved.
This doesn't conform to company policy
<purchase-request> <item>Widget</item> <cost>15000</cost> <signatureAuthority>Level 1</signatureAuthority></purchase-request>
24
Copyright © [2010]. Roger L. Costello. All Rights Reserved.
Validate
XML Schema
XML SchemaValidator
invalid!
<purchase-request> <item>Widget</item> <cost>15000</cost> <signatureAuthority> Level 1 </signatureAuthority></purchase-request>
Level 1 managers may sign off on purchase requests that do not exceed $10K.
25
Copyright © [2010]. Roger L. Costello. All Rights Reserved.
XML Schema 1.0
• With XML Schema 1.0 business policies and rules could not be expressed. – The policy rule on the previous slides could not be
expressed.• Consequence: developers buried policies and
rules in procedural code.
Javaprogram
Level 1 managers may sign off on purchase requests that do not exceed $10K.
26
Copyright © [2010]. Roger L. Costello. All Rights Reserved.
Disadvantage #1 of Buried Policies and Rules
Javaprogram
Policy, expressed in Java code Business
Person
I don't understand Java. I can't
change the policy. Argh!
27
Copyright © [2010]. Roger L. Costello. All Rights Reserved.
Disadvantage #1 of Buried Policies and Rules
Difficult to change policies and rules.
28
Copyright © [2010]. Roger L. Costello. All Rights Reserved.
Disadvantage #2 of Buried Policies and Rules
Javaprogram
Policy, expressed in Java code
Manager
How much can I sign
off on?
29
Copyright © [2010]. Roger L. Costello. All Rights Reserved.
Disadvantage #2 of Buried Policies and Rules
The policies and rules are expressed in code instructions and are less visible – perhaps only the programmer knows the rules.
30
Copyright © [2010]. Roger L. Costello. All Rights Reserved.
XML Schema 1.1
• In XML Schema 1.1 policies and rules can be expressed.
• Policies and rules are declaratively expressed.• Consequence:
- Policies and rules can be easily changed- Policies and rules are transparent
31
Copyright © [2010]. Roger L. Costello. All Rights Reserved.
Example Business Rule
Level 1 managers may sign off on purchase requests that do not exceed $10K.
No paragraph may have a security classification higher than the document's classification.
32
Copyright © [2010]. Roger L. Costello. All Rights Reserved.
top-secret is higher than secret is higher than confidential is higher than unclassified
33
Copyright © [2010]. Roger L. Costello. All Rights Reserved.
Example Document
<Document classification="secret"> <Para classification="unclassified"> ... </Para> <Para classification="secret"> ... </Para> <Para classification="unclassified"> ... </Para> <Para classification="secret"> ... </Para></Document>
Ensure that no <Para> element has a classification higher than the <Document> element's classification
34
Copyright © [2010]. Roger L. Costello. All Rights Reserved.
XML Schema 1.0 versusXML Schema 1.1
• In XML Schema 1.0 you cannot express the rule on the previous slide.
• In XML Schema 1.1 you can express it.
35
Copyright © [2010]. Roger L. Costello. All Rights Reserved.
Grammar checks
Business rule checks
XML Schema 1.0
XML Schema 1.1
36
Copyright © [2010]. Roger L. Costello. All Rights Reserved.
XML Schema 1.0 versusXML Schema 1.1
• With XML Schema 1.0 you can express grammar (syntax) constraints, e.g., this markup should occur in this order, that data should be a date, and so forth.
• With XML Schema 1.1 you can still express grammar constraints but you can also express data relationships (business rules), e.g., the classification value here must be less than the classification value there.
37
Copyright © [2010]. Roger L. Costello. All Rights Reserved.
New Feature
assertion
38
Copyright © [2010]. Roger L. Costello. All Rights Reserved.
Express Policies and Rules using Assertions
Policies and rules are expressed in XML Schema 1.1 using assertions, e.g.,
Assertion: Level 1 managers may sign off on purchase requests that do not exceed $10K.
Assertion: No paragraph may have a security classification higher than the document's classification.
39
Copyright © [2010]. Roger L. Costello. All Rights Reserved.
Review
• We've examined the first new feature in XML Schema 1.1, the ability to express policies and rules using assertions.
• This feature is a big benefit to businesses: now businesses can declaratively express their policies and rules in XML Schemas rather than burying them in procedural code.
40
Copyright © [2010]. Roger L. Costello. All Rights Reserved.
New Feature:Creating Department-Specific
Data using Conditional Type Alternatives
41
Copyright © [2010]. Roger L. Costello. All Rights Reserved.
Example of Conditional Content
Level 1 managers may sign off on purchase requests that do not exceed $10K.
For each employee store this data: name, date of hire, employee number, and emergency contact telephone number.
Human Resources (HR) Department:
Level 1 managers may sign off on purchase requests that do not exceed $10K. For each employee store this data: name, areas of expertise, and current project.
Information Technology (IT) Department:
42
Copyright © [2010]. Roger L. Costello. All Rights Reserved.
Content varies, depending on dept.
<Employee dept="HR">
</Employee>
<Name>John Doe</Name><Hire-Date>2000-01-01</Hire-Date> <Employee-Num>123</Employee-Num> <Emergency-Contact>617-123-4567</Emergency-Contact>
<Employee dept="IT">
</Employee>
<Name>John Doe</Name><Expertise>XML, XML Schema</Expertise><Project>upgrade xyz interface</Project>
43
Copyright © [2010]. Roger L. Costello. All Rights Reserved.
<Employee dept="_________">
</Employee>
If it's HR then the content mustbe an HR type. If it's IT then the content must be an IT type.
44
Copyright © [2010]. Roger L. Costello. All Rights Reserved.
Conditional Content
The content of Employee is conditional to the value of dept.
45
Copyright © [2010]. Roger L. Costello. All Rights Reserved.
Example #2
<Publication kind="book">
</Publication>
<Title>Origin of Wealth</Title><Author>Eric D. Beinhocker</Author> <Date>2006</Date> <ISBN>1-57851-777-X</ISBN> <Publisher>Harvard Business School Press</Publisher>
<Publication kind="magazine">
</Publication>
<Genre>Scientific</Genre><Circulation>733,000</Circulation><Founded>1845-08-28</Founded>
The content of Publication depends on the kind of publication.
46
Copyright © [2010]. Roger L. Costello. All Rights Reserved.
<Publication kind="_________">
</Publication>
If it's magazine then the content mustbe a Magazine type. If it's book then the content must be a Book type.
47
Copyright © [2010]. Roger L. Costello. All Rights Reserved.
Conditional Content
The content of Publication is conditional to the value of kind.
48
Copyright © [2010]. Roger L. Costello. All Rights Reserved.
New Feature
alternative
49
Copyright © [2010]. Roger L. Costello. All Rights Reserved.
Express Conditional Content using Alternative
Conditional content is expressed in XML Schema 1.1 using alternatives, e.g.,
Alternative: if kind="magazine" then the content is a Magazine type.
Alternative: if kind="book" then the content is a Book type.
50
Copyright © [2010]. Roger L. Costello. All Rights Reserved.
Review
• We've examined two new features in XML Schema 1.1:– the ability to express policies and rules using
assertions– the ability to express conditional content using
alternatives
51
Copyright © [2010]. Roger L. Costello. All Rights Reserved.
New Feature:Expressing Business-wide
Attributes using Schema-wide Attributes
52
Copyright © [2010]. Roger L. Costello. All Rights Reserved.
A nice feature of HTML
These attributes can be used with any HTML element
53
Copyright © [2010]. Roger L. Costello. All Rights Reserved.
HTML has a set of attributes that can be used throughout the document. That's nice.
54
Copyright © [2010]. Roger L. Costello. All Rights Reserved.
Schema-wide Attributes
• In XML Schema 1.1 you can create a set of attributes and identify them as schema-wide, which means that they apply to every element in the schema document.
55
Copyright © [2010]. Roger L. Costello. All Rights Reserved.
In XML Schema 1.0 if every element is to have, say, a "title" attribute then a title attribute declaration must be repeated on every element. That's not nice (and it's error prone).
56
Copyright © [2010]. Roger L. Costello. All Rights Reserved.
New Feature
defaultAttributes
57
Copyright © [2010]. Roger L. Costello. All Rights Reserved.
Express Schema-wide Attributes using defaultAttributes
Schema-wide attributes are expressed in XML Schema 1.1 using defaultAttributes, e.g.,
defaultAttributes: these attributes apply throughout the schema document: class, id, title.
58
Copyright © [2010]. Roger L. Costello. All Rights Reserved.
Review
• We've examined three new features in XML Schema 1.1:– the ability to express policies and rules using
assertions– the ability to express conditional content using
alternatives– the ability to define schema-wide attributes
59
Copyright © [2010]. Roger L. Costello. All Rights Reserved.
New Feature: Enable Business Change
usingOpen Content
60
Copyright © [2010]. Roger L. Costello. All Rights Reserved.
U.S. Constitution
• Within the U.S. Constitution it describes how it can be changed.
• Our forefathers recognized that the world changes, and if the constitution doesn't adapt then it will ossify and be useless.
• So they built into the Constitution mechanisms for how it can be changed.
See section 3.1 of the following paper for a fascinating description of how the U.S. Constitution has mechanisms for changing itself:http://www.microfinance.com/English/Papers/Meta-rules.pdf
61
Copyright © [2010]. Roger L. Costello. All Rights Reserved.
Open Content
• XML Schemas that can't adapt to a changing world will ossify and be useless.
• Open content is a mechanism for enabling schemas to change.
62
Copyright © [2010]. Roger L. Costello. All Rights Reserved.
Book Seller Example
• You've coordinated with your clients and agreed to provide them with this information about each book:
Title, Author, Date, ISBN, Publisher
You create an XML Schema to express this.
63
Copyright © [2010]. Roger L. Costello. All Rights Reserved.
Example (cont.)
• Time passes … some clients request this additional information: - number of pages - binding (hardcover or softcover)And they want this information NOW!
• Your schema working group meets quarterly. Updates to support this new information are months away.
64
Copyright © [2010]. Roger L. Costello. All Rights Reserved.
Example (cont.)
• By designing your schemas with open content you will be able to add the requested new information to XML instance documents without waiting for the next quarterly schema meeting.
65
Copyright © [2010]. Roger L. Costello. All Rights Reserved.
Example (cont.)
<Book> <Title>The Origin of Wealth</Title> <Author>Eric D. Beinhocker</Author> <NumPages>527</NumPages> <Date>2006</Date> <ISBN>1-57851-777-X</ISBN> <Publisher>Harvard Business School Press</Publisher> <Binding>Hardcover</Binding></Book>
Book Schemawith
Open Content
create XML instance
527
Hardcoveraddnewinfo
deliver toclients
66
Copyright © [2010]. Roger L. Costello. All Rights Reserved.
Example (concluded)
• The new data is delivered to the clients in a timely fashion.
• At the next quarterly meeting the XML Schema is updated: the information provided for each book is title, author, date, ISBN, publisher and numPages, binding.
67
Copyright © [2010]. Roger L. Costello. All Rights Reserved.
New Feature
openContent
68
Copyright © [2010]. Roger L. Costello. All Rights Reserved.
Express Schema-wide Attributes using openContent
Change is enabled in XML Schema 1.1 using openContent, e.g.,
openContent: permit new (client-requested) data to be interleaved among the standardized data.
69
Copyright © [2010]. Roger L. Costello. All Rights Reserved.
Review
• We've examined four new features in XML Schema 1.1:– the ability to express policies and rules using
assertions– the ability to express conditional content using
alternatives– the ability to define schema-wide attributes– the ability to facilitate change using open content
70
Copyright © [2010]. Roger L. Costello. All Rights Reserved.
New Feature:Enabling Departments to Customize Corporate Data
using override and error
71
Copyright © [2010]. Roger L. Costello. All Rights Reserved.
Wish I could customize …
• Oftentimes I've used a tool and thought, "Boy, if only I could open up this tool and make a few tweaks, then it would be perfect for my needs."
• Regrettably the tool is not modifiable and so I'm stuck using something that's not quite what I need.
• That said, using the tool is a lot better than creating a custom tool from scratch.
72
Copyright © [2010]. Roger L. Costello. All Rights Reserved.
Unchangeable schemas can be customized!
• XML Schema 1.1 provides two mechanisms for customizing another schema without modifying it:– override– error
73
Copyright © [2010]. Roger L. Costello. All Rights Reserved.
Override
meeting- start time- end time- room number
override meetingwith this content:- track id- speaker- room capacity
reuse
This schema reuses the corporate schema, but customizes "meeting" with the data that is particular to conference meetings.
Office Meeting
Conference Meeting
Corporate schema, can't be changed.
74
Copyright © [2010]. Roger L. Costello. All Rights Reserved.
How to change an unchangeable schema
Schema 1(read-only)
Schema 2
reuse
Schema 2 overrides items in Schema 1
75
Copyright © [2010]. Roger L. Costello. All Rights Reserved.
<Employee dept="_________">
</Employee>
If it's HR then the content mustbe an HR type. If it's IT then the content must be an IT type.
Corporate schema specifies this
Recall this earlier example
76
Copyright © [2010]. Roger L. Costello. All Rights Reserved.
HR Department
The HR department wants to reuse the corporate schema, but prohibit IT content:
CorporateSchema
HRSchema
reuse <Employee dept="_________">
</Employee>
If dept="IT" then error
Generate anerror if deptis accidentallyassigned IT.
77
Copyright © [2010]. Roger L. Costello. All Rights Reserved.
New Feature
override
78
Copyright © [2010]. Roger L. Costello. All Rights Reserved.
New Feature
error
79
Copyright © [2010]. Roger L. Costello. All Rights Reserved.
Enable Customization usingoverride and error
Enabling customization is expressed in XML Schema 1.1 using override and error, e.g.,
override: replace items in the corporate schema with your own data (and without changing the corporate schema).
error: disallow the use of certain items in the corporate schema.
80
Copyright © [2010]. Roger L. Costello. All Rights Reserved.
Review
• We've examined five new features in XML Schema 1.1:– the ability to express policies and rules using
assertions– the ability to express conditional content using
alternatives– the ability to define schema-wide attributes– the ability to facilitate change using open content– the ability to customize schemas that ordinarily are
unchangeable, using override and error
81
Copyright © [2010]. Roger L. Costello. All Rights Reserved.
New Feature:Enabling Dissemination of
New Announcementsusing
inherited attributes
82
Copyright © [2010]. Roger L. Costello. All Rights Reserved.
<Merchandise discount="10%">
</Merchandise>
Want this discount information to be visible (disseminated) throughout the document
<Coats> …</Coats><Shirts> …</Shirts<Pants> …</Pants
83
Copyright © [2010]. Roger L. Costello. All Rights Reserved.
i.e., want this discount attribute to be "inherited"
<Merchandise discount="10%">
</Merchandise>
<Coats> …</Coats><Shirts> …</Shirts><Pants> …</Pants>
84
Copyright © [2010]. Roger L. Costello. All Rights Reserved.
<Contract language="FR">
</Contract>
Want this language information to be visible (disseminated) throughout the document
<Foreign-Release> …</Foreign-Release><State-Department> …</State-Department><Legal> …</Legal>
85
Copyright © [2010]. Roger L. Costello. All Rights Reserved.
<Contract language="FR">
</Contract>
i.e., want this language attribute to be "inherited"
<Foreign-Release> …</Foreign-Release><State-Department> …</State-Department><Legal> …</Legal>
86
Copyright © [2010]. Roger L. Costello. All Rights Reserved.
New Feature
inheritable
87
Copyright © [2010]. Roger L. Costello. All Rights Reserved.
Enable Information Dissemination using inheritable attributes
Enabling the dissemination of information is expressed in XML Schema 1.1 using inheritable attributes, e.g.,
inheritable: this attribute can be viewed and used from here on in.
88
Copyright © [2010]. Roger L. Costello. All Rights Reserved.
Review
• We've examined six new features in XML Schema 1.1:– the ability to express policies and rules using assertions– the ability to express conditional content using alternatives– the ability to define schema-wide attributes– the ability to facilitate change using open content– the ability to customize schemas that ordinarily are
unchangeable, using override and error– the ability to disseminate information within a document
using inheritable attributes
89
Copyright © [2010]. Roger L. Costello. All Rights Reserved.
New Feature:Enabling User-Friendly
Arrangement of Informationusing "all"
90
Copyright © [2010]. Roger L. Costello. All Rights Reserved.
Camera Lens
The camera comes with a 37-155mm zoom lens
that has an f-stop of 4.8-11.7
The camera comes with a lens that has an f-stop
of 4.8-11.7 and is a 37-155mm zoom
91
Copyright © [2010]. Roger L. Costello. All Rights Reserved.
Does Order Really Matter?
<Camera-Lens> <f-stop>4.8-11.7</f-stop> <focal-length>37-155mm zoom</focal-length></Camera-Lens>
<Camera-Lens> <focal-length>37-155mm zoom</focal-length> <f-stop>4.8-11.7</f-stop></Camera-Lens>
-- versus --
92
Copyright © [2010]. Roger L. Costello. All Rights Reserved.
Does Order Really Matter?
Probably not. To be user-friendly, allow both orders.
93
Copyright © [2010]. Roger L. Costello. All Rights Reserved.
Any Order
• XML Schema 1.0 was pretty controlling in terms of the order of data.
• XML Schema 1.1 is much less controlling; schemas can be designed to allow the data to be arranged in any order.
94
Copyright © [2010]. Roger L. Costello. All Rights Reserved.
New Feature
allNote: "all" is found in XML Schema 1.0, but it did not permit elements with maxOccurs of 2 or more. XML Schema 1.1 does not have this restriction.
95
Copyright © [2010]. Roger L. Costello. All Rights Reserved.
Enable a user-friendly arrangement of information
using "all"
Enabling information to be expressed in any order is accomplished in XML Schema 1.1 using the "all" element, e.g.,
all: provide the f-stop and the focal-length of the camera lens in an order that is useful to you.
96
Copyright © [2010]. Roger L. Costello. All Rights Reserved.
Review
• We've examined seven new features in XML Schema 1.1:– the ability to express policies and rules using assertions– the ability to express conditional content using alternatives– the ability to define schema-wide attributes– the ability to facilitate change using open content– the ability to customize schemas that ordinarily are unchangeable,
using override and error– the ability to disseminate information within a document using
inheritable attributes– the ability to present the information in a user-friendly order, using the
"all" element
97
Copyright © [2010]. Roger L. Costello. All Rights Reserved.
Other New Features
98
Copyright © [2010]. Roger L. Costello. All Rights Reserved.
The many names of "subway"
• There are different ways of saying "I took the subway into town"– In Boston we say "I took the T into town"– In D.C. they say "I took the metro into town"– In London they say "I took the tube into town"– In Chicago they say "I took the L into town"
99
Copyright © [2010]. Roger L. Costello. All Rights Reserved.
Substitution
• XML Schema 1.1 enables you to express "T can be substituted for either metro or tube or L"
T
metro tube
substitutable for substitutable for
L
substitutable for
100
Copyright © [2010]. Roger L. Costello. All Rights Reserved.
Multiple Identifiers
My SSN is …My employee # is…
My driver's license # is …
101
Copyright © [2010]. Roger L. Costello. All Rights Reserved.
Multiple ID values
• XML Schema 1.1 enables you to associate multiple ID values to an element.
Stereo model-number="…" serial-number="…"
102
Copyright © [2010]. Roger L. Costello. All Rights Reserved.
Symbol for the decimal point in U.S.A. versus France
15.7 (USA)
15,7 (France)
103
Copyright © [2010]. Roger L. Costello. All Rights Reserved.
What's the symbol for the decimal point in XML Schema 1.1?
15.7
104
Copyright © [2010]. Roger L. Costello. All Rights Reserved.
What's the symbol for the decimal point in XML Schema 1.1?
Isn't that unfair to the folks in France?
15.7
105
Copyright © [2010]. Roger L. Costello. All Rights Reserved.
Vendor-unique Extensions
• XML Schema 1.1 allows vendors to extend the language.
• Thus a vendor may create a new decimal datatype (French:decimal) with "," as the decimal point.
106
Copyright © [2010]. Roger L. Costello. All Rights Reserved.
Other new datatypes
• anyAtomicType: the anyAtomicType is the union of the values of all the primitive types (string + integer + boolean + …)
• dateTimeStamp: a dateTimeStamp value is a date plus time plus timezone
• yearMonthDuration: a yearMonthDuration value is a duration consisting of years and months
• dayTimeDuration: a dayTimeDuration value is a duration consisting of days and time
107
Copyright © [2010]. Roger L. Costello. All Rights Reserved.
Summary
• XML Schema 1.1 has lots of powerful new features.
• I hope this tutorial has convinced you that these new features can benefit your business.
• I recommend switching to XML Schema 1.1 as soon as possible.