SlideShare a Scribd company logo
1 of 5
Download to read offline
XML Schema Versioning


Issue
What is the Best Practice for versioning XML schemas?

Introduction
It is clear that XML schemas will evolve over time and it is important to capture the
schema’s version. This write-up summarizes two cases for schema changes and some
options for schema versioning. It then provides some ‘best practice’ guidelines for XML
schema versioning.

Schema Changes – Two Cases
Consider two cases for changes to XML schemas:

   Case 1.     The new schema changes the interpretation of some element.
               For example, a construct that was valid and meaningful for the previous
               schema does not validate against the new schema.

   Case 2.     The new schema extends the namespace (e.g., by adding new elements),
               but does not invalidate previously valid documents.

Versioning Approaches
Some options for identifying a new a schema version are to:
1. Change the (internal) schema version attribute.
2. Create a schemaVersion attribute on the root element.
3. Change the schema's targetNamespace.
4. Change the name/location of the schema.


Option 1: Change the (internal) schema version attribute.
In this approach one would simply change the number in the optional version attribute at
the start of the XML schema. For example, in the code below one could change
version=”1.0” to version=”1.1”

       <xs:schema xmlns:xs=quot;http://www.w3.org/2001/XMLSchemaquot;
               elementFormDefault=quot;qualifiedquot;
               attributeFormDefault=quot;unqualifiedquot;
               version=quot;1.0quot;>

    Advantages:
     - Easy. Part of the schema specification.
     - Instance documents would not have to change if they remain valid with the new
        version of the schema (case 2 above).
     - The schema contains information that informs applications that it has changed.
        An application could interrogate the version attribute, recognize that this is a
        new version of the schema, and take appropriate action.


                                               1
Disadvantages:
      - The validator ignores the version attribute. Therefore, it is not an enforceable
         constraint.

Option 2: Create a schemaVersion attribute on the root element.
With this approach an attribute is included on the element that introduces the namespace.
In the examples below, this attribute is named ‘schemaVersion’. This option could be
used in two ways.

Usage A: First, like option 1, this attribute could be used to capture the schema version.
In this case, one could make the attribute required and the value fixed. Then each
instance that used this schema would have to set the value of the attribute to the value
used in the schema. This makes schemaVersion a constraint that is enforceable by the
validator. With the example schema below, the instance would have to include a
schemaVersion attribute with a value of 1.0 for the instance to validate.
       <xs:schema xmlns=quot;http://www.exampleSchemaquot;
                targetNamespace=quot;http://www.exampleSchemaquot;
                xmlns:xs=quot;http://www.w3.org/2001/XMLSchemaquot;
                elementFormDefault=quot;qualifiedquot; attributeFormDefault=quot;unqualifiedquot;>
               <xs:element name=quot;Examplequot;>
                     <xs:complexType>
                             ….
                         <xs:attribute name=quot;schemaVersionquot; type=quot;xs:decimalquot; use=quot;requiredquot; fixed=quot;1.0quot;/>
                     </xs:complexType>
                 </xs:element>


     Advantages:
      - The schemaVersion attribute is an enforceable constraint. Instances would not
         validate without the same version number.

     Disadvantages:
      - The schemaVersion number in the instance must match exactly. This does not
         allow an instance to indicate that it is valid using multiple versions of a schema.

Usage B: The second approach uses the schemaVersion attribute in an entirely different
way. It no longer captures the version of the schema within the schema (i.e., it is not a
fixed value). Rather, it is used in the instance to declare the version (or versions) of the
schema with which the instance is compatible. This approach would have to be done in
conjunction with option 1 (or an alternative indicator in the schema file to identify its
version).

The schemaVersion attribute’s value could be a list or a convention could be used to
define how this attribute is used. For example, if the convention was that the
schemaVersion attribute declares the latest schema version with which the instance is
compatible, then the example instance below states that the instance should be valid with
schema version 1.2 or earlier.

With this approach, an application could compare the schema version (captured in the
schema file) with the version to which the instance reports that it is compatible.



                                                    2
Sample Schema (declares it’s version as 1.3)
       <xs:schema xmlns=quot;http://www.exampleSchemaquot;
                targetNamespace=quot;http://www.exampleSchemaquot;
                xmlns:xs=quot;http://www.w3.org/2001/XMLSchemaquot;
                elementFormDefault=quot;qualifiedquot; attributeFormDefault=quot;unqualifiedquot;
                version=quot;1.3quot;>
               <xs:element name=quot;Examplequot;>
                     <xs:complexType>
                             ….
                         <xs:attribute name=quot;schemaVersionquot; type=quot;xs:decimalquot; use=quot;requiredquot;/>
                     </xs:complexType>
                 </xs:element>


       Sample Instance (declares it is compatible with version 1.2
              (or 1.2 and other versions depending upon the convention used))
       <Example schemaVersion=quot;1.2quot;
               xmlns=quot;http://www.examplequot;
               xmlns:xsi=quot;http://www.w3.org/2001/XMLSchema-instancequot;
               xsi:schemaLocation=quot;http://www.example MyLocationExample.xsdquot;>


    Advantages:
     - Instance documents may not have to change if they remain valid with the new
        schema version (case 2).
     - Like option 1, an application would receive an indication that the schema has
        changed.
     - Could provide an alternative to schemaLocation as a means to point to the
        correct schema version. This could be desirable where the business practice
        requires the use of a schema in a controlled repository, rather than an arbitrary
        location.

    Disadvantages:
     - Requires extra processing by an application. For example, an application
        would have to pre-parse the instance to determine what schema version with
        which it is compatible, and compare this value to the version number stored in
        the schema file.

Option 3: Change the schema's targetNamespace.
In this approach, the schema’s ‘targetNamespace’ could be changed to designate that a
new version of the schema exists. One way to do this is to include a schema version
number in the designation of the target namespace as shown in the example below.

       <xs:schema xmlns=quot;http://www.exampleSchemaV1.0quot;
               targetNamespace=quot;http://www.exampleSchemaV1.0quot;
               xmlns:xs=quot;http://www.w3.org/2001/XMLSchemaquot;
               elementFormDefault=quot;qualifiedquot; attributeFormDefault=quot;unqualifiedquot;>

    Advantages:
     - Applications are notified of a change to the schema (i.e., an application would
        not recognize the new namespace).
     - Requires action to assure that there are no compatibility problems with the new
        schema. At a minimum, the instance documents that use the schema, and
        schemas that include the relevant schema, must change to reference the new
        targetNamespace. This both an advantage and a disadvantage.


                                                   3
Disadvantages:
     - With this approach, instance documents will not validate until they are changed
        to designate the new targetNamepsace. However, one does not want to force
        all instance documents to change, even if the change to the schema is really
        minor and would not impact an instance.
     - Any schemas that ‘include’ this schema would have to change because the
        target namespace of the included components must be the same as the target
        namespace of the including schema.

Option 4: Change the name/location of the schema.
This approach changes the file name or location of the schema. This mimics the
convention that many people use for naming their files so that they know which version
is the most current (e.g., append version number or date to end of file name).

       Advantages:

       Disadvantages:
        - As with option 3, this approach forces all instance documents to change,
           even if the change to the schema would not impact that instance.
        - Any schemas that import the modified schema would have to change since
           the import statement provides the name and location of the imported schema.
        - Unlike the previous options, with this approach an application receives no
           hint that the meaning of various element/attribute names has changed.
        - The schemaLocation attribute in the instance document is optional and is not
           authoritative even if it is present. It is a hint to help the processor to locate
           the schema. Therefore, relying on this attribute is not a good practice (with
           the current reading of the specification).


XML Schema Versioning Best Practices

[1] Capture the schema version somewhere in the XML schema.

[2] Identify in the instance document, what version/versions of the schema with which
    the instance is compatible.

[3] Make previous versions of an XML schema available.

   This allows applications to use previous versions. It also allows users to migrate to
   new versions of the schema as compatibility is assured.

   One way to do this is to have applications pre-parse the instance and choose the
   appropriate schema based on the version number. For example, one could have the
   schemaLocation URI point to a document that includes a list of the locations of the
   available versions of the schema. A tool could then be used to obtain the correct
   version of the schema. The disadvantage of this approach is that this pre-parsing
   requires two passes at the XML instance (one to get the correct version of the schema
   and one to validate).

                                             4
[4] When an XML schema is only extended, (e.g., new elements, attributes, extensions to
    an enumerated list, etc.) one should strive to not invalidate existing instance
    documents.

   For example, if one is adding new elements or attributes, one could consider making
   them optional where this makes sense.

   Also, one could come up with a convention for schema versioning to indicate whether
   the schema changed significantly (case 1) or was only extended (case 2). For
   example, for case 1 a version could increment by one (e.g., v1.0 to v2.0) whereas for
   case 2 a version could increment by less than one (e.g., v1.2 to v1.3).

   In this case, a possible approach would be to do the following with respect to the
   schema:
       a. Change the schema version number within the schema (e.g., option 1).
       b. Record the changes in the schema in a change history.
       c. Make the new and previous versions of the schema available (therefore, one
           would want to change the file name/location as well).

[5] Where the new schema changes the interpretation of some element (e.g., a construct
    that was valid and meaningful for the previous schema does not validate against the
    new schema), one should change the target namespace.

   In this case, the changes with respect to the schema are the same as with [4], with one
   addition:
       d. Change the target namespace.

   In this case there are also required changes with respect to the instances that use this
   schema.
       e. Update the instances to reflect the new target namespace.
       f. Confirm that there are no compatibility problems with the new schema.
       g. Change the attribute that identifies the version/versions of the schema with
           which the instance is valid.
       h. Update the schema name/location if appropriate.




                                             5

More Related Content

What's hot

Data weave documentation
Data weave documentationData weave documentation
Data weave documentationSindhu VL
 
Postgresql stored procedure
Postgresql stored procedurePostgresql stored procedure
Postgresql stored procedureJong Woo Rhee
 
Oracle PL/SQL online training | PL/SQL online Training
Oracle PL/SQL online training | PL/SQL online TrainingOracle PL/SQL online training | PL/SQL online Training
Oracle PL/SQL online training | PL/SQL online Trainingsuresh
 
Intro to tsql unit 11
Intro to tsql   unit 11Intro to tsql   unit 11
Intro to tsql unit 11Syed Asrarali
 
Lecture 4. MS SQL. DML Triggers
Lecture 4. MS SQL. DML TriggersLecture 4. MS SQL. DML Triggers
Lecture 4. MS SQL. DML TriggersAlexey Furmanov
 
Mule data weave_3
Mule data weave_3Mule data weave_3
Mule data weave_3kunal vishe
 
Intro to tsql unit 15
Intro to tsql   unit 15Intro to tsql   unit 15
Intro to tsql unit 15Syed Asrarali
 
Setting And Changing The Column Collation.Doc
Setting And Changing The Column Collation.DocSetting And Changing The Column Collation.Doc
Setting And Changing The Column Collation.Docwalsh010
 
Intro to tsql unit 6
Intro to tsql   unit 6Intro to tsql   unit 6
Intro to tsql unit 6Syed Asrarali
 
Oracle SQL, PL/SQL Performance tuning
Oracle SQL, PL/SQL Performance tuningOracle SQL, PL/SQL Performance tuning
Oracle SQL, PL/SQL Performance tuningSmitha Padmanabhan
 
Twp Upgrading 10g To 11g What To Expect From Optimizer
Twp Upgrading 10g To 11g What To Expect From OptimizerTwp Upgrading 10g To 11g What To Expect From Optimizer
Twp Upgrading 10g To 11g What To Expect From Optimizerqiw
 

What's hot (20)

Review of SQL
Review of SQLReview of SQL
Review of SQL
 
DML, DDL, DCL ,DRL/DQL and TCL Statements in SQL with Examples
DML, DDL, DCL ,DRL/DQL and TCL Statements in SQL with ExamplesDML, DDL, DCL ,DRL/DQL and TCL Statements in SQL with Examples
DML, DDL, DCL ,DRL/DQL and TCL Statements in SQL with Examples
 
SQL Programming
SQL ProgrammingSQL Programming
SQL Programming
 
Data weave documentation
Data weave documentationData weave documentation
Data weave documentation
 
Postgresql stored procedure
Postgresql stored procedurePostgresql stored procedure
Postgresql stored procedure
 
Oracle PL/SQL online training | PL/SQL online Training
Oracle PL/SQL online training | PL/SQL online TrainingOracle PL/SQL online training | PL/SQL online Training
Oracle PL/SQL online training | PL/SQL online Training
 
Intro to tsql unit 11
Intro to tsql   unit 11Intro to tsql   unit 11
Intro to tsql unit 11
 
Lecture 4. MS SQL. DML Triggers
Lecture 4. MS SQL. DML TriggersLecture 4. MS SQL. DML Triggers
Lecture 4. MS SQL. DML Triggers
 
Mule data weave_3
Mule data weave_3Mule data weave_3
Mule data weave_3
 
Pl sql-ch1
Pl sql-ch1Pl sql-ch1
Pl sql-ch1
 
Chapter 3 stored procedures
Chapter 3 stored proceduresChapter 3 stored procedures
Chapter 3 stored procedures
 
Intro to tsql unit 15
Intro to tsql   unit 15Intro to tsql   unit 15
Intro to tsql unit 15
 
CIS 282 Final Review
CIS 282 Final ReviewCIS 282 Final Review
CIS 282 Final Review
 
Setting And Changing The Column Collation.Doc
Setting And Changing The Column Collation.DocSetting And Changing The Column Collation.Doc
Setting And Changing The Column Collation.Doc
 
Intro to tsql unit 6
Intro to tsql   unit 6Intro to tsql   unit 6
Intro to tsql unit 6
 
Sql DML
Sql DMLSql DML
Sql DML
 
Oracle SQL, PL/SQL Performance tuning
Oracle SQL, PL/SQL Performance tuningOracle SQL, PL/SQL Performance tuning
Oracle SQL, PL/SQL Performance tuning
 
Intro to tsql
Intro to tsqlIntro to tsql
Intro to tsql
 
Working with designers
Working with designersWorking with designers
Working with designers
 
Twp Upgrading 10g To 11g What To Expect From Optimizer
Twp Upgrading 10g To 11g What To Expect From OptimizerTwp Upgrading 10g To 11g What To Expect From Optimizer
Twp Upgrading 10g To 11g What To Expect From Optimizer
 

Viewers also liked

Power point herramientas
Power point herramientasPower point herramientas
Power point herramientasannaciscar
 
Beautiful Swim Spa Waterfall with Shimmering lights TM
Beautiful Swim Spa Waterfall with Shimmering lights TMBeautiful Swim Spa Waterfall with Shimmering lights TM
Beautiful Swim Spa Waterfall with Shimmering lights TMSpa Manufacturers, Inc
 
Determinants of health ss1
Determinants of health ss1Determinants of health ss1
Determinants of health ss1GrayK122
 
Capitulo i diapositivas liderazgo
Capitulo i  diapositivas liderazgoCapitulo i  diapositivas liderazgo
Capitulo i diapositivas liderazgoRkceres10
 
U.d. 1. organización y planificación del trabajo 1
U.d. 1. organización y planificación del trabajo 1U.d. 1. organización y planificación del trabajo 1
U.d. 1. organización y planificación del trabajo 1usc
 
History of music
History of musicHistory of music
History of musicawat850
 

Viewers also liked (15)

Power point herramientas
Power point herramientasPower point herramientas
Power point herramientas
 
Beautiful Swim Spa Waterfall with Shimmering lights TM
Beautiful Swim Spa Waterfall with Shimmering lights TMBeautiful Swim Spa Waterfall with Shimmering lights TM
Beautiful Swim Spa Waterfall with Shimmering lights TM
 
Case de Sucesso Symnetics: Brasil Telecom
Case de Sucesso Symnetics: Brasil TelecomCase de Sucesso Symnetics: Brasil Telecom
Case de Sucesso Symnetics: Brasil Telecom
 
InterDyn BMI Overview
InterDyn BMI OverviewInterDyn BMI Overview
InterDyn BMI Overview
 
Page 1
Page 1Page 1
Page 1
 
Novalandjsc
NovalandjscNovalandjsc
Novalandjsc
 
APTRA Promote
APTRA PromoteAPTRA Promote
APTRA Promote
 
Flash Laboral Argentina Enero 09
Flash Laboral Argentina Enero  09Flash Laboral Argentina Enero  09
Flash Laboral Argentina Enero 09
 
Determinants of health ss1
Determinants of health ss1Determinants of health ss1
Determinants of health ss1
 
Teleunicom Company
Teleunicom CompanyTeleunicom Company
Teleunicom Company
 
FLASH LABORAL ARGENTINA - Enero 2017
FLASH LABORAL ARGENTINA - Enero 2017FLASH LABORAL ARGENTINA - Enero 2017
FLASH LABORAL ARGENTINA - Enero 2017
 
Capitulo i diapositivas liderazgo
Capitulo i  diapositivas liderazgoCapitulo i  diapositivas liderazgo
Capitulo i diapositivas liderazgo
 
U.d. 1. organización y planificación del trabajo 1
U.d. 1. organización y planificación del trabajo 1U.d. 1. organización y planificación del trabajo 1
U.d. 1. organización y planificación del trabajo 1
 
Priroda- živa i neživa
Priroda-  živa i neživaPriroda-  živa i neživa
Priroda- živa i neživa
 
History of music
History of musicHistory of music
History of music
 

Similar to Versioning

Extending Schemas
Extending SchemasExtending Schemas
Extending SchemasLiquidHub
 
Using SP Metal for faster share point development
Using SP Metal for faster share point developmentUsing SP Metal for faster share point development
Using SP Metal for faster share point developmentPranav Sharma
 
Max Dynamic Capability
Max Dynamic CapabilityMax Dynamic Capability
Max Dynamic CapabilityLiquidHub
 
Intro to UML - Use Case diagrams
Intro to UML - Use Case diagramsIntro to UML - Use Case diagrams
Intro to UML - Use Case diagramsjsm1979
 
SoftTest Ireland: Model Based Testing - January 27th 2011
SoftTest Ireland: Model Based Testing - January 27th 2011SoftTest Ireland: Model Based Testing - January 27th 2011
SoftTest Ireland: Model Based Testing - January 27th 2011David O'Dowd
 
HT2010 Paper Presentation
HT2010 Paper PresentationHT2010 Paper Presentation
HT2010 Paper Presentationinakipaz
 
Validation in Jakarta Struts 1.3
Validation in Jakarta Struts 1.3Validation in Jakarta Struts 1.3
Validation in Jakarta Struts 1.3Ilio Catallo
 
Using SPMetal for faster SharePoint development
Using SPMetal for faster SharePoint developmentUsing SPMetal for faster SharePoint development
Using SPMetal for faster SharePoint developmentPranav Sharma
 
Mazda Use of Third Generation Xml Tools
Mazda Use of Third Generation Xml ToolsMazda Use of Third Generation Xml Tools
Mazda Use of Third Generation Xml ToolsCardinaleWay Mazda
 
Sedna XML Database: Query Parser & Optimizing Rewriter
Sedna XML Database: Query Parser & Optimizing RewriterSedna XML Database: Query Parser & Optimizing Rewriter
Sedna XML Database: Query Parser & Optimizing RewriterIvan Shcheklein
 
Krazykoder struts2 interceptors
Krazykoder struts2 interceptorsKrazykoder struts2 interceptors
Krazykoder struts2 interceptorsKrazy Koder
 
Form personalization 395117_r12_updated1212
Form personalization 395117_r12_updated1212Form personalization 395117_r12_updated1212
Form personalization 395117_r12_updated1212flower705
 
SCWCD : Servlet web applications : CHAP 3
SCWCD : Servlet web applications : CHAP 3SCWCD : Servlet web applications : CHAP 3
SCWCD : Servlet web applications : CHAP 3Ben Abdallah Helmi
 
Android Development - Tutorial
Android Development - TutorialAndroid Development - Tutorial
Android Development - Tutorialcatone95
 

Similar to Versioning (20)

Jazz
JazzJazz
Jazz
 
Extending Schemas
Extending SchemasExtending Schemas
Extending Schemas
 
Using SP Metal for faster share point development
Using SP Metal for faster share point developmentUsing SP Metal for faster share point development
Using SP Metal for faster share point development
 
Max Dynamic Capability
Max Dynamic CapabilityMax Dynamic Capability
Max Dynamic Capability
 
Intro to UML - Use Case diagrams
Intro to UML - Use Case diagramsIntro to UML - Use Case diagrams
Intro to UML - Use Case diagrams
 
Design Patterns
Design PatternsDesign Patterns
Design Patterns
 
SoftTest Ireland: Model Based Testing - January 27th 2011
SoftTest Ireland: Model Based Testing - January 27th 2011SoftTest Ireland: Model Based Testing - January 27th 2011
SoftTest Ireland: Model Based Testing - January 27th 2011
 
Spring annotation
Spring annotationSpring annotation
Spring annotation
 
HT2010 Paper Presentation
HT2010 Paper PresentationHT2010 Paper Presentation
HT2010 Paper Presentation
 
Validation in Jakarta Struts 1.3
Validation in Jakarta Struts 1.3Validation in Jakarta Struts 1.3
Validation in Jakarta Struts 1.3
 
Using SPMetal for faster SharePoint development
Using SPMetal for faster SharePoint developmentUsing SPMetal for faster SharePoint development
Using SPMetal for faster SharePoint development
 
7 stack and vector
7 stack and vector7 stack and vector
7 stack and vector
 
Mazda Use of Third Generation Xml Tools
Mazda Use of Third Generation Xml ToolsMazda Use of Third Generation Xml Tools
Mazda Use of Third Generation Xml Tools
 
Sedna XML Database: Query Parser & Optimizing Rewriter
Sedna XML Database: Query Parser & Optimizing RewriterSedna XML Database: Query Parser & Optimizing Rewriter
Sedna XML Database: Query Parser & Optimizing Rewriter
 
Krazykoder struts2 interceptors
Krazykoder struts2 interceptorsKrazykoder struts2 interceptors
Krazykoder struts2 interceptors
 
Form personalization 395117_r12_updated1212
Form personalization 395117_r12_updated1212Form personalization 395117_r12_updated1212
Form personalization 395117_r12_updated1212
 
SCWCD : Servlet web applications : CHAP 3
SCWCD : Servlet web applications : CHAP 3SCWCD : Servlet web applications : CHAP 3
SCWCD : Servlet web applications : CHAP 3
 
Android Development - Tutorial
Android Development - TutorialAndroid Development - Tutorial
Android Development - Tutorial
 
MyBatis
MyBatisMyBatis
MyBatis
 
Hybrid framework
Hybrid frameworkHybrid framework
Hybrid framework
 

More from LiquidHub

Share point 2013 coding standards and best practices 1.0
Share point 2013 coding standards and best practices 1.0Share point 2013 coding standards and best practices 1.0
Share point 2013 coding standards and best practices 1.0LiquidHub
 
Sharepoint 2013 upgrade process
Sharepoint 2013 upgrade processSharepoint 2013 upgrade process
Sharepoint 2013 upgrade processLiquidHub
 
Share point 2013
Share point 2013Share point 2013
Share point 2013LiquidHub
 
Share point 2010-uiimprovements
Share point 2010-uiimprovementsShare point 2010-uiimprovements
Share point 2010-uiimprovementsLiquidHub
 
Microsoft office-sharepoint-server-2007-presentation-120211522467022-2
Microsoft office-sharepoint-server-2007-presentation-120211522467022-2Microsoft office-sharepoint-server-2007-presentation-120211522467022-2
Microsoft office-sharepoint-server-2007-presentation-120211522467022-2LiquidHub
 
Managing metadata in_share_point_2010
Managing metadata in_share_point_2010Managing metadata in_share_point_2010
Managing metadata in_share_point_2010LiquidHub
 
Fast search for share point
Fast search for share pointFast search for share point
Fast search for share pointLiquidHub
 
Simple Farm Server Deployment
Simple Farm Server DeploymentSimple Farm Server Deployment
Simple Farm Server DeploymentLiquidHub
 
Pre Install Databases
Pre Install DatabasesPre Install Databases
Pre Install DatabasesLiquidHub
 
Moss 2007 Deployment Detail
Moss 2007 Deployment DetailMoss 2007 Deployment Detail
Moss 2007 Deployment DetailLiquidHub
 
Moss 2007 Backup Strategies
Moss 2007 Backup StrategiesMoss 2007 Backup Strategies
Moss 2007 Backup StrategiesLiquidHub
 
How To Configure Email Enabled Lists In Moss2007 Rtm Using Exchange 2003
How To Configure Email Enabled Lists In Moss2007 Rtm Using Exchange 2003How To Configure Email Enabled Lists In Moss2007 Rtm Using Exchange 2003
How To Configure Email Enabled Lists In Moss2007 Rtm Using Exchange 2003LiquidHub
 
5060 A 01 Demonstration Steps
5060 A 01 Demonstration Steps5060 A 01 Demonstration Steps
5060 A 01 Demonstration StepsLiquidHub
 
Working With Infopath 2007
Working With Infopath 2007Working With Infopath 2007
Working With Infopath 2007LiquidHub
 
Whats New In Microsoft Windows Share Point Services Feature Walkthrough
Whats New In Microsoft Windows Share Point Services Feature WalkthroughWhats New In Microsoft Windows Share Point Services Feature Walkthrough
Whats New In Microsoft Windows Share Point Services Feature WalkthroughLiquidHub
 
Overviewofthe2007 Microsoft Office System Components Refresh
Overviewofthe2007 Microsoft Office System Components RefreshOverviewofthe2007 Microsoft Office System Components Refresh
Overviewofthe2007 Microsoft Office System Components RefreshLiquidHub
 
Organizingand Finding Resourceswith Office Share Point Server2007 Refresh
Organizingand Finding Resourceswith Office Share Point Server2007 RefreshOrganizingand Finding Resourceswith Office Share Point Server2007 Refresh
Organizingand Finding Resourceswith Office Share Point Server2007 RefreshLiquidHub
 

More from LiquidHub (20)

Share point 2013 coding standards and best practices 1.0
Share point 2013 coding standards and best practices 1.0Share point 2013 coding standards and best practices 1.0
Share point 2013 coding standards and best practices 1.0
 
Sharepoint 2013 upgrade process
Sharepoint 2013 upgrade processSharepoint 2013 upgrade process
Sharepoint 2013 upgrade process
 
Share point 2013
Share point 2013Share point 2013
Share point 2013
 
Share point 2010-uiimprovements
Share point 2010-uiimprovementsShare point 2010-uiimprovements
Share point 2010-uiimprovements
 
Microsoft office-sharepoint-server-2007-presentation-120211522467022-2
Microsoft office-sharepoint-server-2007-presentation-120211522467022-2Microsoft office-sharepoint-server-2007-presentation-120211522467022-2
Microsoft office-sharepoint-server-2007-presentation-120211522467022-2
 
Managing metadata in_share_point_2010
Managing metadata in_share_point_2010Managing metadata in_share_point_2010
Managing metadata in_share_point_2010
 
Fast search for share point
Fast search for share pointFast search for share point
Fast search for share point
 
Simple Farm Server Deployment
Simple Farm Server DeploymentSimple Farm Server Deployment
Simple Farm Server Deployment
 
Pre Install Databases
Pre Install DatabasesPre Install Databases
Pre Install Databases
 
Moss 2007 Deployment Detail
Moss 2007 Deployment DetailMoss 2007 Deployment Detail
Moss 2007 Deployment Detail
 
Moss 2007 Backup Strategies
Moss 2007 Backup StrategiesMoss 2007 Backup Strategies
Moss 2007 Backup Strategies
 
How To Configure Email Enabled Lists In Moss2007 Rtm Using Exchange 2003
How To Configure Email Enabled Lists In Moss2007 Rtm Using Exchange 2003How To Configure Email Enabled Lists In Moss2007 Rtm Using Exchange 2003
How To Configure Email Enabled Lists In Moss2007 Rtm Using Exchange 2003
 
Bdc Screens
Bdc ScreensBdc Screens
Bdc Screens
 
Bdc Screens
Bdc ScreensBdc Screens
Bdc Screens
 
5060 A 01 Demonstration Steps
5060 A 01 Demonstration Steps5060 A 01 Demonstration Steps
5060 A 01 Demonstration Steps
 
5060 A 01
5060 A 015060 A 01
5060 A 01
 
Working With Infopath 2007
Working With Infopath 2007Working With Infopath 2007
Working With Infopath 2007
 
Whats New In Microsoft Windows Share Point Services Feature Walkthrough
Whats New In Microsoft Windows Share Point Services Feature WalkthroughWhats New In Microsoft Windows Share Point Services Feature Walkthrough
Whats New In Microsoft Windows Share Point Services Feature Walkthrough
 
Overviewofthe2007 Microsoft Office System Components Refresh
Overviewofthe2007 Microsoft Office System Components RefreshOverviewofthe2007 Microsoft Office System Components Refresh
Overviewofthe2007 Microsoft Office System Components Refresh
 
Organizingand Finding Resourceswith Office Share Point Server2007 Refresh
Organizingand Finding Resourceswith Office Share Point Server2007 RefreshOrganizingand Finding Resourceswith Office Share Point Server2007 Refresh
Organizingand Finding Resourceswith Office Share Point Server2007 Refresh
 

Recently uploaded

Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsHyundai Motor Group
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxnull - The Open Security Community
 

Recently uploaded (20)

Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
 

Versioning

  • 1. XML Schema Versioning Issue What is the Best Practice for versioning XML schemas? Introduction It is clear that XML schemas will evolve over time and it is important to capture the schema’s version. This write-up summarizes two cases for schema changes and some options for schema versioning. It then provides some ‘best practice’ guidelines for XML schema versioning. Schema Changes – Two Cases Consider two cases for changes to XML schemas: Case 1. The new schema changes the interpretation of some element. For example, a construct that was valid and meaningful for the previous schema does not validate against the new schema. Case 2. The new schema extends the namespace (e.g., by adding new elements), but does not invalidate previously valid documents. Versioning Approaches Some options for identifying a new a schema version are to: 1. Change the (internal) schema version attribute. 2. Create a schemaVersion attribute on the root element. 3. Change the schema's targetNamespace. 4. Change the name/location of the schema. Option 1: Change the (internal) schema version attribute. In this approach one would simply change the number in the optional version attribute at the start of the XML schema. For example, in the code below one could change version=”1.0” to version=”1.1” <xs:schema xmlns:xs=quot;http://www.w3.org/2001/XMLSchemaquot; elementFormDefault=quot;qualifiedquot; attributeFormDefault=quot;unqualifiedquot; version=quot;1.0quot;> Advantages: - Easy. Part of the schema specification. - Instance documents would not have to change if they remain valid with the new version of the schema (case 2 above). - The schema contains information that informs applications that it has changed. An application could interrogate the version attribute, recognize that this is a new version of the schema, and take appropriate action. 1
  • 2. Disadvantages: - The validator ignores the version attribute. Therefore, it is not an enforceable constraint. Option 2: Create a schemaVersion attribute on the root element. With this approach an attribute is included on the element that introduces the namespace. In the examples below, this attribute is named ‘schemaVersion’. This option could be used in two ways. Usage A: First, like option 1, this attribute could be used to capture the schema version. In this case, one could make the attribute required and the value fixed. Then each instance that used this schema would have to set the value of the attribute to the value used in the schema. This makes schemaVersion a constraint that is enforceable by the validator. With the example schema below, the instance would have to include a schemaVersion attribute with a value of 1.0 for the instance to validate. <xs:schema xmlns=quot;http://www.exampleSchemaquot; targetNamespace=quot;http://www.exampleSchemaquot; xmlns:xs=quot;http://www.w3.org/2001/XMLSchemaquot; elementFormDefault=quot;qualifiedquot; attributeFormDefault=quot;unqualifiedquot;> <xs:element name=quot;Examplequot;> <xs:complexType> …. <xs:attribute name=quot;schemaVersionquot; type=quot;xs:decimalquot; use=quot;requiredquot; fixed=quot;1.0quot;/> </xs:complexType> </xs:element> Advantages: - The schemaVersion attribute is an enforceable constraint. Instances would not validate without the same version number. Disadvantages: - The schemaVersion number in the instance must match exactly. This does not allow an instance to indicate that it is valid using multiple versions of a schema. Usage B: The second approach uses the schemaVersion attribute in an entirely different way. It no longer captures the version of the schema within the schema (i.e., it is not a fixed value). Rather, it is used in the instance to declare the version (or versions) of the schema with which the instance is compatible. This approach would have to be done in conjunction with option 1 (or an alternative indicator in the schema file to identify its version). The schemaVersion attribute’s value could be a list or a convention could be used to define how this attribute is used. For example, if the convention was that the schemaVersion attribute declares the latest schema version with which the instance is compatible, then the example instance below states that the instance should be valid with schema version 1.2 or earlier. With this approach, an application could compare the schema version (captured in the schema file) with the version to which the instance reports that it is compatible. 2
  • 3. Sample Schema (declares it’s version as 1.3) <xs:schema xmlns=quot;http://www.exampleSchemaquot; targetNamespace=quot;http://www.exampleSchemaquot; xmlns:xs=quot;http://www.w3.org/2001/XMLSchemaquot; elementFormDefault=quot;qualifiedquot; attributeFormDefault=quot;unqualifiedquot; version=quot;1.3quot;> <xs:element name=quot;Examplequot;> <xs:complexType> …. <xs:attribute name=quot;schemaVersionquot; type=quot;xs:decimalquot; use=quot;requiredquot;/> </xs:complexType> </xs:element> Sample Instance (declares it is compatible with version 1.2 (or 1.2 and other versions depending upon the convention used)) <Example schemaVersion=quot;1.2quot; xmlns=quot;http://www.examplequot; xmlns:xsi=quot;http://www.w3.org/2001/XMLSchema-instancequot; xsi:schemaLocation=quot;http://www.example MyLocationExample.xsdquot;> Advantages: - Instance documents may not have to change if they remain valid with the new schema version (case 2). - Like option 1, an application would receive an indication that the schema has changed. - Could provide an alternative to schemaLocation as a means to point to the correct schema version. This could be desirable where the business practice requires the use of a schema in a controlled repository, rather than an arbitrary location. Disadvantages: - Requires extra processing by an application. For example, an application would have to pre-parse the instance to determine what schema version with which it is compatible, and compare this value to the version number stored in the schema file. Option 3: Change the schema's targetNamespace. In this approach, the schema’s ‘targetNamespace’ could be changed to designate that a new version of the schema exists. One way to do this is to include a schema version number in the designation of the target namespace as shown in the example below. <xs:schema xmlns=quot;http://www.exampleSchemaV1.0quot; targetNamespace=quot;http://www.exampleSchemaV1.0quot; xmlns:xs=quot;http://www.w3.org/2001/XMLSchemaquot; elementFormDefault=quot;qualifiedquot; attributeFormDefault=quot;unqualifiedquot;> Advantages: - Applications are notified of a change to the schema (i.e., an application would not recognize the new namespace). - Requires action to assure that there are no compatibility problems with the new schema. At a minimum, the instance documents that use the schema, and schemas that include the relevant schema, must change to reference the new targetNamespace. This both an advantage and a disadvantage. 3
  • 4. Disadvantages: - With this approach, instance documents will not validate until they are changed to designate the new targetNamepsace. However, one does not want to force all instance documents to change, even if the change to the schema is really minor and would not impact an instance. - Any schemas that ‘include’ this schema would have to change because the target namespace of the included components must be the same as the target namespace of the including schema. Option 4: Change the name/location of the schema. This approach changes the file name or location of the schema. This mimics the convention that many people use for naming their files so that they know which version is the most current (e.g., append version number or date to end of file name). Advantages: Disadvantages: - As with option 3, this approach forces all instance documents to change, even if the change to the schema would not impact that instance. - Any schemas that import the modified schema would have to change since the import statement provides the name and location of the imported schema. - Unlike the previous options, with this approach an application receives no hint that the meaning of various element/attribute names has changed. - The schemaLocation attribute in the instance document is optional and is not authoritative even if it is present. It is a hint to help the processor to locate the schema. Therefore, relying on this attribute is not a good practice (with the current reading of the specification). XML Schema Versioning Best Practices [1] Capture the schema version somewhere in the XML schema. [2] Identify in the instance document, what version/versions of the schema with which the instance is compatible. [3] Make previous versions of an XML schema available. This allows applications to use previous versions. It also allows users to migrate to new versions of the schema as compatibility is assured. One way to do this is to have applications pre-parse the instance and choose the appropriate schema based on the version number. For example, one could have the schemaLocation URI point to a document that includes a list of the locations of the available versions of the schema. A tool could then be used to obtain the correct version of the schema. The disadvantage of this approach is that this pre-parsing requires two passes at the XML instance (one to get the correct version of the schema and one to validate). 4
  • 5. [4] When an XML schema is only extended, (e.g., new elements, attributes, extensions to an enumerated list, etc.) one should strive to not invalidate existing instance documents. For example, if one is adding new elements or attributes, one could consider making them optional where this makes sense. Also, one could come up with a convention for schema versioning to indicate whether the schema changed significantly (case 1) or was only extended (case 2). For example, for case 1 a version could increment by one (e.g., v1.0 to v2.0) whereas for case 2 a version could increment by less than one (e.g., v1.2 to v1.3). In this case, a possible approach would be to do the following with respect to the schema: a. Change the schema version number within the schema (e.g., option 1). b. Record the changes in the schema in a change history. c. Make the new and previous versions of the schema available (therefore, one would want to change the file name/location as well). [5] Where the new schema changes the interpretation of some element (e.g., a construct that was valid and meaningful for the previous schema does not validate against the new schema), one should change the target namespace. In this case, the changes with respect to the schema are the same as with [4], with one addition: d. Change the target namespace. In this case there are also required changes with respect to the instances that use this schema. e. Update the instances to reflect the new target namespace. f. Confirm that there are no compatibility problems with the new schema. g. Change the attribute that identifies the version/versions of the schema with which the instance is valid. h. Update the schema name/location if appropriate. 5