REGISTER XSROBJECT command
The REGISTER XSROBJECT command registers an XML object in the database catalogs. Supported objects are DTDs and external entities.
Authorization
One of the following authorities:
- DBADM
- IMPLICIT_SCHEMA database authority if the SQL schema does not exist
- SCHEMAADM authority if the SQL schema exists
- CREATEIN privilege if the SQL schema exists
Required connection
Database
Command syntax
Command parameters
- system-ID
- Specifies the system ID that is specified in the XML object declaration.
- PUBLIC public-ID
- Specifies an optional PUBLIC ID in the XML object declaration.
- FROM content-URI
- Specifies the URI where the content of an XML schema document is located. Only a local file specified by a file scheme URI is supported.
- AS relational-identifier
- Specifies a name that can be used to refer to the XML object being registered. The relational name can be specified as a two-part SQL identifier consisting of the relational schema and name separated by a period, for example "JOHNDOE.EMPLOYEEDTD". If no relational schema is specified, the default relational schema defined in the special register CURRENT SCHEMA is used. If no name is specified, one is generated automatically.
- DTD
- Specifies that the object being registered is a Data Type Definition document (DTD).
- EXTERNAL ENTITY
- Specifies that the object being registered is an external entity.
Examples
- Given this sample XML document which references an external entity:
Before this document can be successfully inserted into an XML column, the external entity needs to be registered. The following command registers an entity where the entity content is stored locally in C:\TEMP:<?xml version="1.0" standalone="no" ?> <!DOCTYPE copyright [ <!ELEMENT copyright (#PCDATA)> ]> <copyright>c</copyright>
REGISTER XSROBJECT 'http://www.xmlwriter.net/copyright.xml' FROM 'c:\temp\copyright.xml' EXTERNAL ENTITY
- Given this XML document fragment which references a DTD:
Before this document can be successfully inserted into an XML column, the DTD needs to be registered. The following command registers a DTD where the DTD definition is stored locally in C:\TEMP and the relational identifier to be associated with the DTD is "TEST.SUBJECTS":<!--inform the XML processor that an external DTD is referenced--> <?xml version="1.0" standalone="no" ?> <!--define the location of the external DTD using a relative URL address--> <!DOCTYPE document SYSTEM "http://www.xmlwriter.net/subjects.dtd"> <document> <title>Subjects available in Mechanical Engineering.</title> <subjectID>2.303</subjectID> <subjectname>Fluid Mechanics</subjectname> ...
REGISTER XSROBJECT 'http://www.xmlwriter.net/subjects.dtd' FROM 'file:///c:/temp/subjects.dtd' AS TEST.SUBJECTS DTD
- Given this sample XML document which references a public external
entity:
Before this document can be successfully inserted into an XML column, the public external entity needs to be registered. The following command registers an entity where the entity content is stored locally in C:\TEMP:<?xml version="1.0" standalone="no" ?> <!DOCTYPE copyright [ <!ELEMENT copyright (#PCDATA)> ]> <copyright>c</copyright>
REGISTER XSROBJECT 'http://www.w3.org/xmlspec/copyright.xml' PUBLIC '-//W3C//TEXT copyright//EN' FROM 'file:///c:/temp/copyright.xml' EXTERNAL ENTITY