Start of change

XML schema repository

The XML schema repository (XSR) is a set of tables containing information about XML schemas.

XML instance documents might contain a reference to a Uniform Resource Identifier (URI) that points to an associated XML schema. This URI is required to process the instance documents. The DB2® database system manages dependencies on such externally referenced XML artifacts with the XSR without requiring changes to the URI location reference.

Without this mechanism to store associated XML schemas, an external resource may not be accessible when needed by the database. The XSR also removes the additional overhead required to locate external documents, along with the possible performance impact.

An XML schema consists of a set of XML schema documents. To add an XML schema to the DB2 XSR, you register XML schema documents to DB2, by calling the following DB2-supplied stored procedures:

SYSPROC.XSR_REGISTER
Begins registration of an XML schema. You call this stored procedure when you add the first XML schema document to an XML schema.
CALL SYSPROC.XSR_REGISTER ('user1', 'POschema',   
                   'http://myPOschema/PO',
                   :content_host_var, NULL)
SYSPROC.XSR_ADDSCHEMADOC
Adds additional XML schema documents to an XML schema that you are in the process of registering. You can call SYSPROC.XSR_ADDSCHEMADOC only for an existing XML schema that is not yet complete.
CALL SYSPROC.XSR_ADDSCHEMADOC ('user1', 'POschema',                
                   'http://myPOschema/address',
                   :content_host_var, NULL)
SYSPROC.XSR_COMPLETE
Completes the registration of an XML schema.
CALL SYSPROC.XSR_COMPLETE ('user1', 'POschema', :schemaproperty_host_var, 0)

During XML schema completion, DB2 resolves references inside XML schema documents to other XML schema documents. An XML schema document is not checked for correctness when registering or adding documents. Document checks are performed only when you complete the XML schema registration.

To remove an XML schema from the DB2 XML schema repository, you can:
  • call the SYSPROC.XSR_REMOVE stored procedure or
  • use the DROP XSROBJECT SQL statement.

Independent ASP considerations for the XML Schema Repository (XSR)

Because an independent auxiliary storage pool (ASP) can be switched between multiple systems, there are some additional considerations for administering XML schemas on an ASP.

Use of an XML schema must be contained on the independent ASP where it was registered. You cannot reference an XML schema that is defined in a different independent ASP group or in the system ASP when the job is connected to the independent ASP.

End of change