Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's difference between strict and transitional schema definition (XSDs) in XML

Tags:

xml

xsd

A lot of XML schemas specify strict and transitional schema definition in their specs. Eg: http://docs.oasis-open.org/xliff/v1.2/os/xliff-core.html#AppDTD or Microsoft's OOXML XSD (http://en.wikipedia.org/wiki/Office_Open_XML). Not sure whats the actual difference and why two XSDs are needed in first place, any thoughts?

like image 279
Chinmay Avatar asked Nov 25 '25 03:11

Chinmay


1 Answers

First, I would challenge your opening assertion that "a lot of XML schemas specify strict and transitional schema definition in their specs." Most XSD do not come in strict-transitional pairs.

But to explain those that do...

The difference is the result of tension between how things are and how things ought to be. To support legacy systems and data that may be less than ideally disciplined in their markup, lax/transitional schemas are created. To guide future development toward increased discipline and more accurate data descriptions in markup, strict schemas are created.

Some techniques employed in lax/transitional schemas:

  • xs:any
  • minOccurs="0" and use="optional"
  • xs:string for all basic types

Some techniques employed in strict schemas:

  • specific element content models
  • minOccurs="1" and use="required"
  • specific data typing rather than xs:string
like image 134
kjhughes Avatar answered Nov 27 '25 22:11

kjhughes



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!