Listing XML schemas registered with the XSR

The following examples show how XML schemas that have been fully registered with the XML schema repository can be queried for through SQL statements. Registration must have been completed before an XML schema is fully registered.

Example 1: List all registered XML schemas

This example returns the SQL schema and the SQL identifier of all XML schemas registered with the XSR.

SELECT OBJECTNAME, OBJECTSCHEMA  
   FROM SYSCAT.XSROBJECTS 
   WHERE OBJECTTYPE='S' AND STATUS='C'

Example 2: Return the target namespace and the schema location

This example returns the uniform resource identifiers (URIs) of the target namespaces and schema locations for all registered XML schemas (targetNamespace and schemaLocation).

SELECT TARGETNAMESPACE, SCHEMALOCATION 
   FROM SYSCAT.XSROBJECTS 
   WHERE OBJECTTYPE='S' AND STATUS='C'

Example 3: Return the object information document

This example returns the object information document for all registered schemas (schemaInfo). This XML document is generated during schema registration and describes each XML schema document that is part of an XML schema registered with the XSR.

SELECT OBJECTINFO 
   FROM SYSCAT.XSROBJECTS 
   WHERE OBJECTTYPE='S' AND STATUS='C'