Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Should I be using XSD 1.1 to build an open standard?

We have been asked to put together a set of schemas for an open XML standard.

XSD 1.0 would cope with most of the rules, but it would be a bit messy in places (especially to allow for extensibility) it would also rely on implementers reading free text descriptions of some rules in the form of annotations.

Pretty much all of the rules could be implemented using XSD 1.1, however we are not sure if this would limit implementers unduly.

So my question, is XSD 1.1 mature enough to be used in the wild?

like image 549
Sprotty Avatar asked Dec 14 '16 16:12

Sprotty


People also ask

Is XSD necessary?

XSDs constrain the vocabulary and structure of XML documents. Without an XSD, an XML document need only follow the rules for being well-formed as given in the W3C XML Recommendation.

What is the purpose of XSD document?

An XML schema definition (XSD), is a framework document that defines the rules and constraints for XML documents. An XSD formally describes the elements in an XML document and can be used to validate the contents of the XML document to make sure that it adheres to the rules of the XSD.

What is difference between XML and XSD?

XSD is based and written on XML. XSD defines elements and structures that can appear in the document, while XML does not. XSD ensures that the data is properly interpreted, while XML does not. An XSD document is validated as XML, but the opposite may not always be true.

What is the difference between WSDL and XSD?

XSD is to validate the document, and contains metadata about the XML whereas WSDL is to describe the webservice location and operations.


1 Answers

Reasons to use XSD 1.0

  • Least restrictive requirement argument: Maximize interoperability between systems and teams by requiring the lowest common denominator standard, XSD 1.0.
  • Broader tool and library support: JAXB and xsd.exe (.NET), for example, still do not support XSD 1.1.

Reasons to use XSD 1.1

  • Assertions (xs:assert) are wonderfully powerful. Leverages XPath to provide flexible mechanism to express constraints beyond core content and type modeling.
  • Conditional Type Assignment can be useful when type should vary per attribute value.
  • Many other improvements. See W3C XML Schema Definition Language (XSD) 1.1 Part 1: Structures, Appendix G Changes since version 1.0 (non-normative)

Recommendation

If all parties involved with building and interacting your system are prepared to move to XSD 1.1 and have no dependencies on tools or libraries that only support XSD 1.0, then move to XSD 1.1. Otherwise, stick with XSD 1.0.

like image 58
kjhughes Avatar answered Oct 03 '22 17:10

kjhughes