Retrive DTD or Schema

Hello
Can somebody tell my, if there is a possibility to retrieve the DTD or the Schema of a XML object stored in Tamino?

Thanx
Daniel

Yes it possible to get the schema (not DTD) but this depends on the version of Tamino.

Assume database is MYDB, collection name is COLNAME and document type for which you wish to get the schema is DOCTYPE, then:

for v2.3 (and v3.1 if you upgraded from v2.3 with schemas already defined) :

<A HREF=“http://localhost/tamino/MYDB/ino:collection?_xql=ino:collection[@ino:name=“COLNAME”]/ino:doctype[@ino:name=“DOCTYPE”]” TARGET=_blank>http://localhost/tamino/MYDB/ino:collection?_xql=ino:collection[@ino:name=“COLNAME”]/ino:doctype[@ino:name=“DOCTYPE”]

for v3.1 (which uses XML schemas):

<A HREF=“http://localhost/tamino/MYDB/ino:collection?_xql=xs:schema[//tsd:collection/@name=“COLNAME”” TARGET=_blank>http://localhost/tamino/MYDB/ino:collection?_xql=xs:schema[//tsd:collection/@name=“COLNAME” and //tsd:doctype/@name=“DOCTYPE”]

Also the API’s contain methods to get, define and undefine schemas.

hope this helps.

The URL of a TSD3 schema for COLLECTION and DOCTYPE in database MYDB

http://localhost/tamino/MYDB/ino:collection/xs:schema/COLLECTION/DOCTYPE

Useful if you want to include the schema in a schema hint

Thanx for your reply

Can you also tell me, if the format of the schema I get from the Database, is written as W3C-Standard or as the proprietary Tamino Schema.

Thanx for your help
Daniel

Hi Daniel,

with Tamino 3.1, both Stuart’s second query and Nigel’s query will return you an instance of xs:schema, which is the W3C Schema.
(The Tamino specific information is stored in annotations to the schema.)

code:

<?xml version="1.0" encoding="iso-8859-1" ?>
<xs:schema xmlns:xs=“http://www.w3.org/2001/XMLSchema” xmlns:tsd=“http://namespaces.softwareag.com/tamino/TaminoSchemaDefinition”>
xs:annotation
xs:appinfo
<tsd:schemaInfo name=“cd”>
<tsd:collection name=“xapp” />
<tsd:doctype name=“cd”>
tsd:logical
tsd:contentclosed</tsd:content>
</tsd:logical>
</tsd:doctype>
tsd:adminInfo
tsd:versionTSD3</tsd:version>
tsd:created2002-02-11T17:47:09.029-08:00</tsd:created>
tsd:modified2002-02-26T09:08:10.815-08:00</tsd:modified>
</tsd:adminInfo>
</tsd:schemaInfo>
</xs:appinfo>
</xs:annotation>
<xs:element name=“cd”>
xs:complexType
xs:sequence
<xs:element ref=“id” />
<xs:element ref=“title” />
<xs:element ref=“desc” />
<xs:element ref=“category” />
<xs:element ref=“comments” minOccurs=“0” />
<xs:element ref=“price” />
<xs:element ref=“availableDate” />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name=“id” type=“xs:string” />
<xs:element name=“title” type=“xs:string” />
<xs:element name=“desc” type=“xs:string” />
<xs:element name=“category” type=“xs:string” />
<xs:element name=“comments” type=“xs:string” />
<xs:element name=“price” type=“xs:string” />
<xs:element name=“availableDate” type=“xs:string” />
</xs:schema>

HTH,
Trevor.