XML Schema Patterns for Databinding

50 %
50 %
Information about XML Schema Patterns for Databinding

Published on October 23, 2008

Author: psd

Source: slideshare.net



W3C XML Schema Patterns for Databinding Paul Downey, BT Chair, XML Schema Patterns for Databinding Working Group XML 2006, December 5th 2006

XML Schema ?

Validation XML Schema Post XML Schema Schema Instance Validation Processor Infoset

Description XML Schema XML Sender Instance Receiver

Types xs:string xs:int XML tns:Address foo:PurchaseOrder

Databinding ?

Databinding Abstraction Model XML

Model • Java • Database • Annotated DOM • JSON • PHP serialisation • XML • Whatever

Why Describe ?

Duck Typing XML ?

Force Array <opt> { <name>value</name> name => ‘value’ </opt> } { <opt> name => [ <name>value1</name> ‘value1’, <name>value2</name> ‘value2’ </opt> ] }

Static Typing { int accountNo; long ammount; string name; }

What’s wrong with Databinding ?

“State of the Art” • reject valid XML Schema documents • reject valid XML instance documents • content of valid XML instance documents often unavailable in model

Impedance Mismatch >< OO

Circles, Triangles, Rectangles XML 2003 http://www.idealliance.org/papers/dx_xml03/papers/06-02-01/06-02-01.html

I ! Mixed Content text <O/> text <O> text </O>

Don’t Databind? • XSLT • DOM • LINQ • E4X • XJ • etc

Abstraction Scale Objects Infoset XML Bits Typed DOM Text DOM Templating

They Don’t Like XML!

Abstraction ?

XML Schema is Big .. • Lot’s of ways to describe the concrete • Lot’s of ways to represent the abstract

Partial Implementations “Our tool doesn’t support xs:foo. Change your schema.” * vendor

So begins .. “The Barf Dance”

it’s not so much that schema sucks ...

or that databinding tools suck ...

it’s that all databinding tools suck differently

W3C Working Group ?

WS-I • Basic Profile • XML Schema Work Plan Working Group

W3C Workshop XML Schema 1.0 User Experiences


Don’t Just Change Schema! … 300,000+ developers use XSD … There is tremendous value in XML Schema. Don't just change it… Soumitra Sengupta, Microsoft

Discussion Topics • versioning • profiles and patterns of use • code generation (v) validation • Unique Particle Attribution (UPA) • XML Schema 1.1 • test suite

W3C XML Schema Patterns for Databinding Working Group !

Deliverables • W3C Recommendation for Basic Patterns • W3C Recommendation for Advanced Patterns • Test Suite • Mechanism to Detect patterns

Out of Scope: • Profile of Schema • Language Specific Detail

Patterns !

AnyURIElement .//xs:element/@type[resolve-QName(.,..) = xs:QName('xs:anyURI')] <xs:element name=quot;anyURIElementquot; type=quot;xs:anyURIquot; /> http://www.w3.org/2002/ws/databinding/patterns/6/09/AnyURIElement

ElementMinOccurs0 MaxOccursUnbounded .//xs:element[@minOccurs = '0' and @maxOccurs = 'unbounded']/ (@minOccurs, @maxOccurs) http://www.w3.org/2002/ws/databinding/patterns/6/09/ElementMinOccurs0MaxOccursUnbounded

SequenceSingle RepeatedElement .//xs:sequence[count(xs:element) = 1]/ xs:element[@maxOccurs = 'unbounded']/ (., @maxOccurs) Overlapping! http://www.w3.org/2002/ws/databinding/patterns/6/09/SequenceSingleRepeatedElement

StringEnumerationType .//xs:simpleType/xs:restriction[ @base/resolve-QName(.,..) = xs:QName('xs:string') and xs:enumeration]/ (., @base, xs:enumeration/(., @value)) <xs:simpleType name=quot;Beatlequot;> <xs:restriction base=quot;xs:stringquot;> <xs:enumeration value=quot;Johnquot; /> <xs:enumeration value=quot;Paulquot; /> <xs:enumeration value=quot;Georgequot; /> <xs:enumeration value=quot;Ringoquot; /> </xs:restriction> http://www.w3.org/2002/ws/databinding/patterns/6/09/StringEnumerationType

SOAP Encoded Array ./xs:complexType[@name]/xs:complexContent/ xs:restriction[ @base/resolve-QName(.,..) = xs:QName ('soap11enc:Array')]/ xs:attribute[(@ref/resolve-QName(.,..) = xs:QName('soap11enc:arrayType')) and @wsdl11:arrayType]/ (../.., ../(., @base), ., @ref, @wsdl11:arrayType) http://www.w3.org/2002/ws/databinding/patterns/6/09/SOAPEncodedArray

Palatability ?

Value Judgement • xs:any becomes XMLElement • xs:anyURI becomes String • xs:decimal becomes String

Examples !

ElementMinOccurs0 MaxOccursUnbounded <xs:element name=quot;durationListquot; type=quot;ex:DurationListquot; /> <xs:complexType name=quot;DurationListquot;> <xs:sequence> <xs:element name=quot;durationValuequot; type=quot;xs:shortquot; ! ! ! ! ! minOccurs=quot;0quot; maxOccurs=quot;unboundedquot; /> </xs:sequence> </xs:complexType> http://www.w3.org/2002/ws/databinding/examples/6/09/ElementMinOccurs0MaxOccursUnbounded

Example Descriptions • ComplexTypeSequenceExtension.xsd • echoComplexTypeSequenceExtension.xsd • echoComplexTypeSequenceExtension.wsdl • echoComplexTypeSequenceExtension-wsdl20.wsdl

Example Instances • ElementMinOccurs0MaxOccursUnbounded-01.xml • echoElementMinOccurs0MaxOccursUnbounded-01.xml • echoElementMinOccurs0MaxOccursUnbounded-01-soap11.xml • echoElementMinOccurs0MaxOccursUnbounded-01-soap12.xml

Test Suite Example Description Instance Model Toolkit Output

Test Reports

Patterns Detector !

Patterns Detector XML Patterns Schema Detector (URIs)

Buckets !

Basic Patterns • known to work with “state of the art” implementations • they’re, um, very Basic Publishers of Schemas Take Note!

TargetNamespace .[@targetNamespace]/ (., @targetNamespace) An [XML Schema 1.0] document conforming to this specification MUST define a targetNamespace whose value is an absolute URI. † http://www.w3.org/2002/ws/databinding/patterns/6/09/TargetNamespace

“State of the Art” ?


Value Judgement • new tools arrive • old tools become defunct • some tools are very lame • we can’t test every tool “Bring out your implementations”

Advanced Patterns • exhibited by real schemata • they’re, um, not very interoperable Developers of Implementations Take Note!

Not Advanced ?


Value Judgement • XML Schema is big • Coverage or Possible to Databind? • always another Schema “Bring out your schemata”

Patterns in the Wild

Build Your Own Bucket • List Patterns your schemas use • List Patterns your toolkit supports • Analyse schemas “in the wild”

Other Topics ?

Document Conformance Implementation Conformance

WS-I Basic Profile • Detector works on WSDL 1.1 • Composable with Basic Profile 1.1

Annotations • Tools Generate them • Useful for “round tripping” • No-one is submitting them

Versioning • Concrete patterns exist • They’re all Advanced XML Schema 1.1 is the answer?

Progress ?


Participants • BT • Health Level 7 • National Association of Convenience Stores (NACS) • Origo Services Limited • SAP AG • WSO2 • Invited Expert: Priscilla Walmsley ... and that’s It!

We Need Your Help! www.w3.org/2002/ws/databinding

How You Can Help • Participate in the Working Group • Encourage your vendor of choice to participate • Contribute to the test suite • Contribute your Schemata www.w3.org/2002/ws/databinding

Thank you! Any Questions ? www.w3.org/2002/ws/databinding

Add a comment

Related presentations

Related pages

Basic XML Schema Patterns for Databinding Version 1.0

3.1 Normative References [XML Schema 1.0] Henry S. Thompson, David Beech, Murray Maloney, and Noah Mendelsohn, Editors. World Wide Web Consortium.
Read more

XML Schema Patterns for Databinding Working Group

About Web services · Web Services Activity statement Administrative page · Web Services CG. XML Schema Patterns for Databinding Working Group. Charter · ...
Read more

XML Schema Patterns for Databinding - InfoQ: Software ...

The W3C has published a working draft of the XML Schema Patterns for Databinding specification, aimed at increasing interoperability among XML ...
Read more

W3C XML Schema Patterns for Databinding - Whatfettle

W3C XML Schema Patterns for Databinding Paul Downey, BT Chair, XML Schema Patterns for Databinding Working Group WWW2006, May 25th 2006
Read more

Advanced XML Schema Patterns for Databinding

Description: The Advanced XML Schema Patterns for Databinding specification addresses uneven and inconsistent databinding support of eXtensible Markup ...
Read more

Minutes from XML Schema Patterns for Databinding call 14 ...

Minutes from XML Schema Patterns for Databinding call 14 March 2006. ... aranabah to investigate using XSLT to recognise our schema patterns ...
Read more

XML data binding - Wikipedia, the free encyclopedia

An XML data binder accomplishes this by automatically creating a mapping between elements of the XML schema of the ... One of XML data binding's ...
Read more

W3C Basic XML Schema Patterns for Databinding Last Call Review

Dear XML-DEV, You may be interested to take a look at the work of the W3C XML Schema Patterns for Databinding WG [1] has published a Last Call Working ...
Read more

Minutes: XML Schema Patterns for Databinding Telcon 8 ...

Minutes: XML Schema Patterns for Databinding Telcon 8 ... been working on the production of the basic document from the examples.xml and patterns.xml ...
Read more