Discussion on XSD open issues

Slides:



Advertisements
Similar presentations
CSPP51038 WSDL in depth. Advanced Schema features (required for understanding wsdl)
Advertisements

XML Language Family Detailed Examples Most information contained in these slide comes from: These slides are intended.
1 Web Data Management XML Schema. 2 In this lecture XML Schemas Elements v. Types Regular expressions Expressive power Resources W3C Draft:
1 XML DTD & XML Schema Monica Farrow G30
CSE 636 Data Integration XML Schema. 2 XML Schemas W3C Recommendation: Generalizes DTDs Uses XML syntax Two documents: structure.
A Simple Schema Design. First Schema Design Being a Dog Is a Full-Time Job Charles M. Schulz Snoopy Peppermint Patty extroverted beagle Peppermint.
1 Substitution Groups in XML Schemas Tomer Shiran Winter 2003/4 Semester.
Enabling Grids for E-sciencE ISSGC’05 XML Schemas (XSD) Richard Hopkins, National e-Science Centre, Edinburgh June 2005.
Sunday, June 28, 2015 Abdelali ZAHI : FALL 2003 : XML Schemas XML Schemas Presented By : Abdelali ZAHI Instructor : Dr H.Haddouti.
Group:WG3 (PRO) Source:Peter Niblett, IBM, Date: Agenda:PRO#14 TS-0004 Data Representation Proposal Discussion.
Method of Converting Resource definitions into XSD Group Name: WG3 (PRO) Source: Shingo Fujimoto, FUJITSU, Meeting Date:
OneM2M-MP Data_Model_Repository Establishing Data Model Repository for oneM2M Group Name: Method and Procedure Sub-commitee Source: WG3 chair.
XP New Perspectives on XML Tutorial 4 1 XML Schema Tutorial – Carey ISBN Working with Namespaces and Schemas.
Group:WG3 (PRO) Source:Peter Niblett, IBM, Date: Agenda:PRO#14 TS-0004 Data Representation Proposal Discussion.
XML Schema Vinod Kumar Kayartaya. What is XML Schema?  XML Schema is an XML based alternative to DTD  An XML schema describes the structure of an XML.
Dr. Azeddine Chikh IS446: Internet Software Development.
Announcement Resources ARC Announcement_Issues Group Name: WG2 Source: Barbara Pareglio, NEC Meeting Date: Agenda Item: Input Contribution.
Introduction of PRO WG activities Group Name: TP Source: Shingo Fujimoto, FUJITSU, Meeting Date: Agenda Item:
IVOA Registry videocon 2004/05/13-14 Gerard Lemson1 Model based schema.
Beginning XML 4th Edition. Chapter 5: XML Schemas.
In-Band Access Control Framework Group Name: WG4 SEC Source: Qualcomm Meeting Date: Agenda Item:
XML Schema. Why Schema? To define a class of XML documents Serve same purpose as DTD “Instance document" used for XML document conforming to schema.
Management of CMDH Policies Group Name: WG5-MAS Source: Wolfgang Granzow, Qualcomm, Meeting Date: Agenda Item: Management.
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.
Sheet 1XML Technology in E-Commerce 2001Lecture 2 XML Technology in E-Commerce Lecture 2 Logical and Physical Structure, Validity, DTD, XML Schema.
XSD Presented by Kushan Athukorala. 2 Agenda XML Namespaces XML Schema XSD Indicators XSD Data Types XSD Schema References.
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
1 Tutorial 12 Working with Namespaces Combining XML Vocabularies in a Compound Document.
XML Schema. Why Validate XML? XML documents can generally have any structure XML grammars define specific document structures Validation is the act of.
Customized Resource Types MAS Group Name: MAS + ARC + PRO WGs Source: Wolfgang Granzow, Qualcomm Inc., Meeting Date:
Processing of structured documents Spring 2003, Part 3 Helena Ahonen-Myka.
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.
XSD: XML Schema Language Kanda Runapongsa Dept. of Computer Engineering Khon Kaen University.
Discussion on XSD implementation conventions (document number PRO R01) Group Name: PRO Source: Wolfgang Granzow, Meeting.
Deriving Complex Types In XML Schema By: Roy Navon.
XML Schema Lecture 3. Indicators There are seven indicators: Order indicators: All Choice Sequence Occurrence indicators: maxOccurs minOccurs Group indicators:
E2EKey Resource Group Name: SEC WG Source: Qualcomm Inc., Wolfgang Granzow & Phil Hawkes Meeting Date: SEC#20.3, Agenda Item: End-to-End Security.
PRO/ARC and TST/PRO joint sessions at TP20 Group Name: oneM2M TP20 Source: Peter Niblett, IBM Meeting Date:
Experience with XML Schema Ashok Malhotra Schema Usage  Mapping XML Schema and XML documents controlled by the Schema to object classes and instances.
Protocol Issues related to Plugtest Group Name: TST Source: Wolfgang Granzow, Qualcomm Inc., Meeting Date: Agenda.
CITA 330 Section 4 XML Schema. XML Schema (XSD) An alternative industry standard for defining XML dialects More expressive than DTD Using XML syntax Promoting.
1 SIP Recording Metadata (draft-ietf-siprec-metadata-16) November 2014 IETF 91 meeting Presenter: Paul Kyzivat Authors: Ram Mohan R, R Parthasarathi, Paul.
4 Copyright © 2004, Oracle. All rights reserved. Validating XML by Using XML Schema.
TS-0004 guideline for new resource type definition Group Name: PRO WG Source: SeungMyeong JEONG, LG Electronics Meeting Date: Agenda Item: TS.
Creating Groups of Elements and Attributes in an XML Schema ©NIITeXtensible Markup Language/Lesson 4/Slide 1 of 28 Objectives In this lesson, you will.
oneM2M interop 3 issues and optimizations
XML Schema.
ACG 4401 XML Schemas XML Namespaces XLink.
CSE Retargeting to AE, IPE, and NoDN Hosted Resources
End-to-End Security for Primitives
MIME Type Definition Group Name: PRO WG
2nd Interoperability testing issues
ACG 4401 XML Schemas XML Namespaces XLink.
Proposed design principles for modelling interworked devices
oneM2M Service Layer Protocol Version Handling
MAF&MEF Interface Specification discussion of the next steps
CMP 051 XML Introduction Session IV
TS-0004 Data Representation Proposal Discussion
oneM2M Versioning Next Steps
Data Modeling II XML Schema & JAXB Marc Dumontier May 4, 2004
ISSGC’05 XML Schemas (XSD)
Mapping Data Models to VOTable
CMP 051 XML Introduction Session III
Summary of the MAF and MEF Interface Specification TS-0032
Optimising XML Schema for IODEF Data model
New Applications Modeled
XML Schema Diyar A. Abdulqder
New Perspectives on XML
Presentation transcript:

Discussion on XSD open issues PRO-2016-0353 Discussion on XSD open issues Group Name: PRO WG Source: Qualcomm Inc., Wolfgang Granzow Meeting Date: PRO#24.2, 2016-08-17 Agenda Item: TS-0004 / XSD

Background Contribution PRO-2016-0263 suggested a number of changes required to handle <flexContainer> specializations, which may use namespace prefixes other than “m2m:”: as children of <CSEBase>, <remoteCSE>, <AE> and <container> resources when included into primitiveContent At PRO#24, required corrections to TS-0004 have been agreed However, the decision was postponed how to update the XSD to reflect the TS-0004 changes, simply due to lack of discussion time There are essentially two XML concepts suitable to address the problem: use of substitution groups use of wildcard elements This contribution reviews both concepts and proposes a solution how to change the XSD © 2016 oneM2M Partners PRO-2016-0353

Use of substitution groups A substitution group is a feature of XML schema that allows to specify global elements which can replace another global element in an XML representation The replaceable element is called head element of the substitution group Each element of a substitution group must be derived from the same datatype as the head element The inheritance model used for grouping of common and universal attributes lends itself to the creation of substitution groups © 2016 oneM2M Partners PRO-2016-0353

Definition of substitution groups The following XSD global element declarations define suitable head elements which can be used as placeholders for a corresponding resource type prefix “sg_” is used here to emphasize that each element defines a head element of a substitution group (the name “resource” cannot be reused because it is already defined for another purpose) <xs:element name="sg_resource" type="m2m:resource" abstract="true" /> <xs:element name="sg_regularResource" type="m2m:regularResource" abstract="true" /> <xs:element name="sg_announcedResource" type="m2m:announcedResource" abstract="true" /> <xs:element name="sg_announceableResource" type="m2m:announceableResource" abstract="true"/> <xs:element name="sg_subordinateResource" type="m2m:subordinateResource" abstract="true" /> <xs:element name="sg_announceableSubordinateResource" type="m2m:announceableSubordinateResource" abstract="true" /> <xs:element name="sg_announcedSubordinateResource" type="m2m:announcedSubordinateResource" abstract="true" /> <xs:element name="sg_mgmtResource" type="m2m:mgmtResource" abstract="true" /> <xs:element name="sg_announcedMgmtResoure" type="m2m:announcedMgmtResource" abstract="true" /> <xs:element name="sg_flexContainerResource" type="m2m:flexContainerResource" abstract="true" /> <xs:element name="sg_announcedFlexContainerResource" type="m2m:announcedFlexContainerResource" abstract="true" /> Global elements defined in each resourceType-specific XSD file, need to be assigned to a substitution group (i.e. both normal and announced resource type names: <xs:element name="container" substitutionGroup="m2m:sg_announceableResource"> <xs:complexType> <xs:complexContent> <xs:extension base="m2m:announceableResource"> <xs:sequence> … </xs:sequence> </xs:extension> </xs:complexContent> </xs:complexType> </xs:element> © 2016 oneM2M Partners PRO-2016-0353

Use of substitution groups Allows more compact representation of datatypes which otherwise consist of long lists of references to resource types Example: datatype m2m:resourceWrapper Present definition: <xs:complexType name="resourceWrapper"> <xs:sequence> <xs:choice minOccurs="1" maxOccurs="1"> <xs:element ref="m2m:accessControlPolicy" /> <xs:element ref="m2m:activeCmdhPolicy" /> <xs:element ref="m2m:AE" /> … <xs:element ref="m2m:software" /> <xs:element ref="m2m:statsCollect" /> <xs:element ref="m2m:statsConfig" /> <xs:element ref="m2m:subscription" /> </xs:choice> <xs:element name="URI" type="xs:anyURI" /> </xs:sequence> </xs:complexType> © 2016 oneM2M Partners PRO-2016-0353

Use of substitution groups Redefinition of m2m:resourceWrapper based on substitution groups: <xs:complexType name="resourceWrapper"> <xs:sequence> <xs:choice minOccurs="1" maxOccurs="1"> <xs:element ref="m2m:sg_resource" /> <xs:element ref="m2m:sg_regularResource" /> <xs:element ref="m2m:sg_announceableResource" /> <xs:element ref="m2m:sg_announcedResource" /> <xs:element ref="m2m:sg_subordinateResource" /> <xs:element ref="m2m:sg_announcedSubordinateResource" /> <xs:element ref="m2m:sg_announceableSubordinateResource" /> <xs:element ref="m2m:sg_mgmtResource" /> <xs:element ref="m2m:sg_announcedMgmtResoure" /> <xs:element ref="m2m:sg_flexContainerResource" /> <xs:element ref="m2m:sg_announcedFlexContainerResource" /> </xs:choice> <xs:element name="URI" type="xs:anyURI" /> </xs:sequence> </xs:complexType> © 2016 oneM2M Partners PRO-2016-0353

Use of substitution groups When substituting a head element in an XML representation by some other global element, the XSD of that global element must be known to the schema validation tool There is no way to skip schema validation for undefined elements Elements not found cause schema validation errors This means the schema of all applicable global elements still must be made available to the XML processor for schema validation © 2016 oneM2M Partners PRO-2016-0353

Use of wildcard elements Wildcard elements is a feature of XML schema that allows to include global elements with yet unspecified XSD The current definition of datatype m2m:primitiveContent uses such wildcard element: <xs:complexType name="primitiveContent"> <xs:sequence> <xs:any namespace="http://www.onem2m.org/xml/protocols" processContents="lax" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> processContents attribute set to “lax” means that the XML processor will validate elements and attributes for which it can obtain schema information, but it will not signal errors for those it cannot obtain any schema information © 2016 oneM2M Partners PRO-2016-0353

Use of wildcard elements The present definition of m2m:primitiveContent does not allow to include elements with a namespace prefix other than “m2m:” This can be fixed as follows: <xs:complexType name="primitiveContent"> <xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:any namespace="http://www.onem2m.org/xml/protocols" processContents="lax" /> <xs:any namespace="##other" processContents="lax" /> </xs:choice> </xs:complexType> In a future XSD version, the wildcard used for elements with m2m: prefix should be replaced by explicit references to the permitted global elements as defined in Tables 7.5.2-1 and 7.5.2‑2 of TS-0004. © 2016 oneM2M Partners PRO-2016-0353

Proposal (1) Define substitution groups in CDT-commonTypes as shown on slide 4 Apply substitution groups to redefine m2m:resourceWrapper in CDT-primitiveContent as shown on slide 6 to include flexContainer specializations in CDT-CSEBase, CDT-remoteCSE, CDT-AE and CDT-container by adding child resource references <xs:element ref="m2m:sg_flexContainerResource" /> (for both normal and announced types) <xs:element ref="m2m:sg_announcedFlexContainerResource" /> (for announced types) In each XSD file which defines a resource type, add the assignment of the substitution group to each global element declaration, e.g. in CDT-container: <xs:element name="container" substitutionGroup="m2m:sg_announceableResource"> <xs:element name="containerAnnc“ substitutionGroup="m2m:sg_announcedResource"> © 2016 oneM2M Partners PRO-2016-0353

Proposal (2) NOTE: Addition of substitutionGroup attribute needs to be done also for resource types associated with TS-0023 (Home Appliances) Redefine m2m:primitiveContent in CDT-commonTypes as shown on slide 9 by adding wildcard choice enabling elements with prefix other than “m2m:” © 2016 oneM2M Partners PRO-2016-0353