Extension points
Making schemas both backwards and forwards compatible is a well-understood design task, best expressed by the Must Ignore pattern of extensibility. The Must Ignore pattern recommends that schemas incorporate extensibility points, which allow extension elements to be added to types and additional attributes to each element. The pattern also recommends that XML languages define a processing model that specifies how consumers process extensions. The simplest model requires consumers to ignore elements that they do not recognise – hence the name of the pattern. The model may also require consumers to process elements that have a “Must Understand” flag, or abort if they cannot understand them.
This is the schema on which we originally based our search results documents:
<?xml version=”1.0” encoding=”utf-8”?>
<xs:schema xmlns=”urn:example.com:productsearch:products”
xmlns:xs=”http://www.w3.org/2001/XMLSchema”
elementFormDefault=”qualified”
targetNamespace=”urn:example.com:productsearch:products”
id=”Products”>
<xs:element name=”Products” type=”Products” />
<xs:complexType name=”Products”>
<xs:sequence>
<xs:element minOccurs=”0” maxOccurs=”unbounded” name=”Product” type=”Product” />
</xs:sequence>
</xs:complexType>
<xs:complexType name=”Product”>
<xs:sequence>
<xs:element name=”CatalogueID” type=”xs:int” />
<xs:element name=”Name” type=”xs:string” />
<xs:element name=”Price” type=”xs:double” />
<xs:element name=”Manufacturer” type=”xs:string” />
<xs:element name=”InStock” type=”xs:string” />
</xs:sequence>
</xs:complexType>
</xs:schema>