External Schema Import problem

Hi
I created 2 schemas, both in the same Collection. (I am new to this) Then I loaded the external schema via the Tools, Get external schema and selected the Schema from the Database. Then after that I notice the arrow next to the Import icon that shows that the schema has been imported. But when validating the schema I get a message:
src-resolve: Cannot resolve the name ‘pro:ProductType’ to a(n) ‘type definition’ component.

Here follows my Schema that I import:
=====================================
<?xml version = "1.0" encoding = "UTF-8"?>
<xsd:schema targetNamespace = “http://www.product.org” xmlns = “http://www.product.org” xmlns:tsd = “http://namespaces.softwareag.com/tamino/TaminoSchemaDefinition” xmlns:xsd = “XML Schema”>
xsd:annotation
xsd:appinfo
<tsd:schemaInfo name = “Dwa”>
<tsd:collection name = “ImportFinal”></tsd:collection>
<tsd:doctype name = “Dwa”>
tsd:logical
tsd:contentclosed</tsd:content>
</tsd:logical>
</tsd:doctype>
</tsd:schemaInfo>
</xsd:appinfo>
</xsd:annotation>
<xsd:element name = “Dwa”>
xsd:complexType</xsd:complexType>
</xsd:element>
<xsd:complexType name = “ProductType”>
xsd:sequence
<xsd:element name = “Type” type = “xsd:string”></xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>

and here is the Schema that imports the above:
==============================================
<?xml version = "1.0" encoding = "UTF-8"?>
<xsd:schema targetNamespace = “http://www.company.org” xmlns = “http://www.company.org” xmlns:pro = “http://www.product.org” xmlns:tsd = “http://namespaces.softwareag.com/tamino/TaminoSchemaDefinition” xmlns:xsd = “XML Schema”>
xsd:annotation
xsd:appinfo
<tsd:schemaInfo name = “Eden”>
<tsd:collection name = “ImportFinal”></tsd:collection>
<tsd:doctype name = “Company”>
tsd:logical
tsd:contentclosed</tsd:content>
</tsd:logical>
</tsd:doctype>
tsd:adminInfo
tsd:server4.2.1.1</tsd:server>
tsd:modified2004-08-15T14:44:58.153-08:00</tsd:modified>
tsd:created2004-08-15T13:30:53.167-08:00</tsd:created>
tsd:versionTSD4.2</tsd:version>
</tsd:adminInfo>
</tsd:schemaInfo>
</xsd:appinfo>
</xsd:annotation>
<xsd:import namespace = “http://www.product.org” schemaLocation = “Dwa”></xsd:import>
<xsd:element name = “Company”>
xsd:complexType
xsd:sequence
<xsd:element name = “Product” type = “pro:ProductType” maxOccurs = “unbounded”></xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>

Hi zabka,
I am not quite clear about the scenario you used. I took your two schemas and put them into my test database using the Tamino Schema Editor. After that I said File->New and then I loaded the Eden Schema back from the database into the Schema Editor. I then pressed Database->Validate TSD schema and got no error. What did I do differently than you?
Regards,
Gerald


Gerald Ristow
Tamino R&D

Hi zabka,

In schema Editor there are 2 types of validations.
1. Local validation : Done by parser
2. Validation with Tamino : Done inside Tamino

In your case you need to validate it against Tamino, as the imported schema is in tamino. To make Tamino understand from where to validate it it requires root of the collection. So while specifying Schema Location for Dwa, you need to give the path as ./Dwa

In case of local validation, as I mentioned previously it uses parser and parser understands file protocol only. So for that you need to specify the path as file:///c:/Dwa.tsd if the imported schema is on c:. While doing local validation care needs to be taken that the schema location does not contain any space.

Regards,
Vipin Makode

Hi Gerald

I should have mentioned this:
When I click on Database->Validate TSD schema I also don’t get an error, but as soon as I click on the little tick mark (Validate XML Schema) I get the error: src-resolve: Cannot resolve the name ‘pro:ProductType’ to a(n) ‘type definition’ component.

Thanks
Zabka



Hi Gerald;

I am also confused here, I did exactly what you said, and I can get the schemas into Tamino, but as soon as I try validating the schema (The Eden schema), it gives me the error “src:resolve:Cannot resolve the name ‘pro:ProductType’ to a(n) ‘type definition’ component. ”

This is most puzzling, as I assumed that when defining a schema with imports in Tamino, it established the validity of imports at that time, I know that if the imports are not valid Tamino complains.

Is it perhaps the definition of the type in the 'Dwa" schema?

Stuart



Hello Stuart,

I understood what zabka trying to do and why it fails for him . BUt i am not clear about which type of validate results to the error you mentioned?

As vipin explained Schema editor supports 2 type of Validation.
1. Local validation
2. Tamino Validation

Local validation is Xerces validation and it understands URL. For local validation, keep your imported file on your file server and specify the import path as file:///…

If the imported file is in Tamino Database, then the import path should be a relative path from collection. And you will have to run Tamino Validation. If you run local validation, it will ofcourse fail, as Xerces don’t understand the relative path in Tamino. SO it fails to import the file from database.

Thanks,
Prashant Jedhe

Hi

Does anyone have a very basic example of a schema importing another one, that will work in Tamino?
The examples I have found doesn’t work in Tamino and I think I’m missing something very small.

Thanks
Zabka

Hello Zabka,

could I please ask for an update on the problem that you are actually receiving?

The reason that I ask for this is that I took your two schemas (Eden and Dwa from your August 15th posting) and loaded them both into Tamino 4.2 with the 4.2 Schema Editor. Both loaded successfully, with no manual changes from me.
I then used XMLSpy to generate a sample document, which I successfully loaded into the “Company” doctype (as defined in the Eden schema).

It seems that there is a lot of discussion in this thread about validating the schemas against Tamino, and validating them as XSDs… The comments are all correct (in summary: the XSD validation does not look into Tamino, so does not find the type definition there), but I wonder if the discussion is really relevant - your schemas appear to work fine with Tamino!

I’m appending the schemas and document that I loaded, just for reference.

Best regards,
Trevor.

The document:

   <?xml version="1.0" encoding="UTF-8"?>
   <n:Company xmlns:n="http://www.company.org" xmlns:pro="http://www.product.org" xmlns:tsd="http://namespaces.softwareag.com/tamino/TaminoSchemaDefinition">
      <Product>
         <Type>String</Type>
      </Product>
      <Product>
         <Type>String</Type>
      </Product>
   </n:Company></pre><BR>Eden schema:<BR><pre class="ip-ubbcode-code-pre">   <?xml version="1.0" encoding="UTF-8"?>
   <xsd:schema targetNamespace="http://www.company.org" xmlns="http://www.company.org" xmlns:pro="http://www.product.org" xmlns:tsd="http://namespaces.softwareag.com/tamino/TaminoSchemaDefinition" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
      <xsd:annotation>
         <xsd:appinfo>
            <tsd:schemaInfo name="Eden">
               <tsd:collection name="ImportFinal"></tsd:collection>
               <tsd:doctype name="Company">
                  <tsd:logical>
                     <tsd:content>closed</tsd:content>
                  </tsd:logical>
               </tsd:doctype>
               <tsd:adminInfo>
                  <tsd:server>4.2.1.1</tsd:server>
                  <tsd:modified>2004-08-26T03:20:35.029-08:00</tsd:modified>
                  <tsd:created>2004-08-26T03:20:35.029-08:00</tsd:created>
                  <tsd:version>TSD4.2</tsd:version>
               </tsd:adminInfo>
            </tsd:schemaInfo>
         </xsd:appinfo>
      </xsd:annotation>
      <xsd:import namespace="http://www.product.org" schemaLocation="Dwa"/>
      <xsd:element name="Company">
         <xsd:complexType>
            <xsd:sequence>
               <xsd:element name="Product" type="pro:ProductType" maxOccurs="unbounded"/>
            </xsd:sequence>
         </xsd:complexType>
      </xsd:element>
   </xsd:schema></pre><BR>Dwa Schema:<BR><pre class="ip-ubbcode-code-pre">   <?xml version="1.0" encoding="UTF-8"?>
   <xsd:schema targetNamespace="http://www.product.org" xmlns="http://www.product.org" xmlns:tsd="http://namespaces.softwareag.com/tamino/TaminoSchemaDefinition" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
      <xsd:annotation>
         <xsd:appinfo>
            <tsd:schemaInfo name="Dwa">
               <tsd:collection name="ImportFinal"></tsd:collection>
               <tsd:doctype name="Dwa">
                  <tsd:logical>
                     <tsd:content>closed</tsd:content>
                  </tsd:logical>
               </tsd:doctype>
               <tsd:adminInfo>
                  <tsd:server>4.2.1.1</tsd:server>
                  <tsd:modified>2004-08-26T03:20:16.983-08:00</tsd:modified>
                  <tsd:created>2004-08-26T03:20:16.983-08:00</tsd:created>
                  <tsd:version>TSD4.2</tsd:version>
               </tsd:adminInfo>
            </tsd:schemaInfo>
         </xsd:appinfo>
      </xsd:annotation>
      <xsd:element name="Dwa">
         <xsd:complexType></xsd:complexType>
      </xsd:element>
      <xsd:complexType name="ProductType">
         <xsd:sequence>
            <xsd:element name="Type" type="xsd:string"></xsd:element>
         </xsd:sequence>
      </xsd:complexType>
   </xsd:schema>

Hi Trevor

My import still doesn’t work. Stuart mailed me and said that he changed the xsd to xs and it worked then on his side?
I will have to try it out.
The topic can be closed - if I still dont get it right I will pop u a mail, but I’m sure I’ll get it working.


Thanks!
Zabka