Hi,
I have the following schema with imports:
<xs:schema targetNamespace=“http://www.mf.co.za/QuoteDoc” xmlns:xs=“XML Schema” xmlns:tsd=“http://namespaces.softwareag.com/tamino/TaminoSchemaDefinition” xmlns:i=“http://www.mf.co.za/Excess” xmlns:con=“http://www.mf.co.za/Contact” xmlns:com=“http://www.mf.co.za/Comment” xmlns=“http://www.mf.co.za/QuoteDoc” elementFormDefault=“qualified” attributeFormDefault=“unqualified” ino:docname=“MandFSchemas/PolicyDoc” ino:id=“27”>
xs:annotation
xs:appinfo
<tsd:schemaInfo name=“PolicyDoc”>
<tsd:collection name=“MandFSchemas”/>
<tsd:doctype name=“PolicyDoc”>
tsd:logical
tsd:contentclosed</tsd:content>
</tsd:logical>
</tsd:doctype>
tsd:adminInfo
tsd:versionTSD4</tsd:version>
tsd:created2003-09-22T09:29:46.843+02:00</tsd:created>
tsd:modified2003-09-22T09:29:46.843+02:00</tsd:modified>
</tsd:adminInfo>
</tsd:schemaInfo>
</xs:appinfo>
</xs:annotation>
<xs:import namespace=“http://www.mf.co.za/Excess” schemaLocation=“Excess”/>
<xs:import namespace=“http://www.mf.co.za/Comment” schemaLocation=“Comment”/>
<xs:import namespace=“http://www.mf.co.za/Contact” schemaLocation=“ContactDetails”/>
<xs:element name=“PolicyDoc”>
<xs:complexType mixed=“false”>
xs:sequence
<xs:element name=“Excesses” minOccurs=“0” maxOccurs=“unbounded”>
<xs:complexType mixed=“false”>
xs:sequence
<xs:element ref=“i:Excess”/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name=“Comments” minOccurs=“0” maxOccurs=“unbounded”>
<xs:complexType mixed=“false”>
xs:sequence
<xs:element ref=“com:Comment”/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name=“ContactDetails” minOccurs=“0” maxOccurs=“unbounded”>
<xs:complexType mixed=“false”>
xs:sequence
<xs:element ref=“con:ContactDetails”/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
The following schema is the imported schema “Excess” Note that there are no problems with the importing, the problem is in putting an XML instance into the database.
<xs:schema targetNamespace=“http://www.mf.co.za/Excess” xmlns:xs=“XML Schema” xmlns:tsd=“http://namespaces.softwareag.com/tamino/TaminoSchemaDefinition” xmlns=“http://www.mf.co.za/Excess” elementFormDefault=“unqualified” attributeFormDefault=“unqualified” ino:docname=“MandFSchemas/Excess” ino:id=“24”>
xs:annotation
xs:appinfo
<tsd:schemaInfo name=“Excess”>
<tsd:collection name=“MandFSchemas”/>
<tsd:doctype name=“Excess”>
tsd:logical
tsd:contentclosed</tsd:content>
</tsd:logical>
</tsd:doctype>
tsd:adminInfo
tsd:versionTSD4</tsd:version>
tsd:created2003-09-22T09:29:29.234+02:00</tsd:created>
tsd:modified2003-09-22T09:29:29.234+02:00</tsd:modified>
</tsd:adminInfo>
</tsd:schemaInfo>
</xs:appinfo>
</xs:annotation>
<xs:element name=“Excess”>
<xs:complexType mixed=“false”>
xs:sequence
<xs:element name=“FixedAmount” type=“xs:string” minOccurs=“0”/>
<xs:element name=“PercentageWithMinimum” minOccurs=“0”>
<xs:complexType mixed=“false”>
xs:sequence
<xs:element name=“PercentOfClaim” type=“xs:string”/>
<xs:element name=“ExcessMinimum” type=“xs:string”/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
What I have done is generated an XML instance with XMl Spy, this is it:
<?xml version="1.0" encoding="UTF-8"?>
" TARGET=_blank>http://www.xmlspy.com)–>
<i:Excess>
<i:FixedAmount>String</i:FixedAmount>
<i:PercentageWithMinimum>
<i:PercentOfClaim>String</i:PercentOfClaim>
<i:ExcessMinimum>String</i:ExcessMinimum>
</i:PercentageWithMinimum>
</i:Excess>
com:Comment
com:CommentTypeString</com:CommentType>
com:DateAndTime2001-12-17T09:30:47-05:00</com:DateAndTime>
com:CommentDetailsString</com:CommentDetails>
</com:Comment>
con:ContactDetails
con:TelecomNumbers
con:TelecomTypeString</con:TelecomType>
con:TelecomDialCodeString</con:TelecomDialCode>
con:TelecomNumber2147483647</con:TelecomNumber>
</con:TelecomNumbers>
con:ElectronicContactString</con:ElectronicContact>
</con:ContactDetails>
When I try to use a PutDocument statement to get the XMl instance into Tamino, I get the following message:
HAAXJE8400 HTTP Error 400, Bad Request, Processing failed (xcmdisp.cpp,3012), Line 4, Column 19: [element “i:FixedAmount” in element “i:Excess”],
I use this program to put other XML docs into Tamino with no problems, so the issue seems to revolve around the use of imports.
Do you have any idea what I am doing wrong? I have no doubt that I am missing something, but I do not know what.
Hello Stuart,
I suspect that the problem here is being caused by the setting of elementFormDefault=“unqualified” in the Excess schema.
This setting means that the corresponding element names in documents must be unqualified.
However, in your example document the FixedAmount element is qualified - i:FixedAmount.
There are three ways to address this error:
1. Change elementFormDefault to “qualified” in the Excess schema
2. Set the form attribute to “qualified” for individual elements.
3. Change the document.
I suspect that number #1 is the best approach for you.
Greetings,
Trevor.
Trevor,
Thanks a lot, that was the problem. But (There always seems to be a but), this is the situation:
I have an application that puts XML documents into Tamino. It works perfectly for XML instances of every other schema that I have tested it against, but these are all schemas that have no imports. The schemas with imports do not give any errors, and in fact the responseheaders are exactly the same as for other schemas:
Here is an example of an XML instance that works:
2003090301
0
2001-12-17T09:30:47-05:00
String
String
String
String
String
String
String
String
String
2147483647
String
String
String
String
String
String
String
String
String
String
String
String
String
String
String
String
1967-08-13
1967-08-13
1967-08-13
String
String
String
String
0
String
String
0
0
0
0
String
String
String
String
String
String
String
String
String
0
String
String
0
0
0
0
String
And the response headers:
Date: Fri, 26 Sep 2003 06:37:10 GMT
Server: Apache/1.3.24 (Win32) mod_jk/1.1.0
X-INO-id: 23
X-INO-Version: 4.1.1.2
Keep-Alive: timeout=15, max=100
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: text/plain
But, If I go into the Tamino X-Plorer I can see the instance of the first XML document, but not of the second!
I am puzzled.
Does anyone know what I can do?
And here is the XML instance of the imported document:
<?xml version="1.0" encoding="UTF-8"?>
" TARGET=_blank>http://www.xmlspy.com)–>
<i:Excess>
<i:FixedAmount>String</i:FixedAmount>
<i:PercentageWithMinimum>
<i:PercentOfClaim>String</i:PercentOfClaim>
<i:ExcessMinimum>String</i:ExcessMinimum>
</i:PercentageWithMinimum>
</i:Excess>
com:Comment
com:CommentTypeString</com:CommentType>
com:DateAndTime2001-12-17T09:30:47-05:00</com:DateAndTime>
com:CommentDetailsString</com:CommentDetails>
</com:Comment>
con:ContactDetails
con:TelecomNumbers
con:TelecomTypeString</con:TelecomType>
con:TelecomDialCodeString</con:TelecomDialCode>
con:TelecomNumber2147483647</con:TelecomNumber>
</con:TelecomNumbers>
con:ElectronicContactString</con:ElectronicContact>
</con:ContactDetails>
And the response headers:
Date: Fri, 26 Sep 2003 06:39:23 GMT
Server: Apache/1.3.24 (Win32) mod_jk/1.1.0
X-INO-id: 4
X-INO-Version: 4.1.1.2
Keep-Alive: timeout=15, max=100
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: text/plain
The plot thickens:
Here is the schema as copied from the Tamino Schema Editor:
<?xml version = "1.0" encoding = "UTF-8"?>
<xs:schema targetNamespace = “http://www.mf.co.za/QuoteDoc” elementFormDefault = “qualified” xmlns = “http://www.mf.co.za/QuoteDoc” xmlns:com = “http://www.mf.co.za/Comment” xmlns:con = “http://www.mf.co.za/Contact” xmlns:i = “http://www.mf.co.za/Excess” xmlns:tsd = “http://namespaces.softwareag.com/tamino/TaminoSchemaDefinition” xmlns:xs = “XML Schema”>
xs:annotation
xs:appinfo
<tsd:schemaInfo name = “PolicyDoc”>
<tsd:collection name = “MandFSchemas”></tsd:collection>
<tsd:doctype name = “PolicyDoc”>
tsd:logical
tsd:contentclosed</tsd:content>
</tsd:logical>
</tsd:doctype>
tsd:adminInfo
tsd:created2003-09-26T07:12:38.718+02:00</tsd:created>
tsd:modified2003-09-26T07:12:38.718+02:00</tsd:modified>
tsd:versionTSD4</tsd:version>
tsd:server4.1.1.1</tsd:server>
</tsd:adminInfo>
</tsd:schemaInfo>
</xs:appinfo>
</xs:annotation>
<xs:import namespace = “http://www.mf.co.za/Excess” schemaLocation = “Excess”></xs:import>
<xs:import namespace = “http://www.mf.co.za/Comment” schemaLocation = “Comment”></xs:import>
<xs:import namespace = “http://www.mf.co.za/Contact” schemaLocation = “ContactDetails”></xs:import>
<xs:element name = “PolicyDoc”>
xs:complexType
xs:sequence
<xs:element name = “Excesses” minOccurs = “0” maxOccurs = “unbounded”>
xs:complexType
xs:sequence
<xs:element ref = “i:Excess”></xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name = “Comments” minOccurs = “0” maxOccurs = “unbounded”>
xs:complexType
xs:sequence
<xs:element ref = “com:Comment”></xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name = “ContactDetails” minOccurs = “0” maxOccurs = “unbounded”>
xs:complexType
xs:sequence
<xs:element ref = “con:ContactDetails”></xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
Here is the error message that I tracked down at last:
<?xml version="1.0" encoding="utf-8" ?>
<ino:response xmlns:ino=“http://namespaces.softwareag.com/tamino/response2” xmlns:xql=“XQL FAQ (XML Query Language - Frequently Asked Questions)”>
ino:message
ino:messagelineTamino Data Loader v4.1.1.1 - Copyright (c) Software AG</ino:messageline>
ino:messagelineLoading from C:\Program Files\Altova\XMLSPY\MF Xml Schemas\STP Data exchange\Works\PolicyDoc.xml to Tamino database Quote</ino:messageline>
ino:messagelineStart: Fri Sep 26 10:39:05 2003</ino:messageline>
</ino:message>
<ino:message ino:returnvalue=“8814”><ino:messagetext ino:code=“INOXRE8814”>Element/attribute name not found</ino:messagetext>ino:messagelineDoctype name = PolicyDoc</ino:messageline></ino:message>
</ino:response>
Here is the detail (I use the word detail in its most lenient sense!) of the message from the documentation:
Explanation
The specified element or attribute is unknown.
Action
Correct the element or attribute name and repeat the request.
But: This does not seem to make sense. There is a DocType of “PolicyDoc” and there is a global elment of “PolicyDoc”, so what is the problem.
Again, I suppose that I am doing something wrong, but it is a bit puzzling. What is also puzzling is why I did not get any errors shown to me when I did the PutDocument.
Please can anyone help out here?
Hello Stuart,
could you please put all of your schema files (.tsd), your XML documents and your loader application into a ZIP file and post it here?
(You can also e-mail it to me directly if you don’t want to post it on a public website. You’ll find my e-mail address in my profile.)
It isn’t possible to explain why the document fails to load at the moment, because we do not know the details of the Comment or Contact schema definitions.
Could you please also explain what you are doing to load the documents? I am currently a little perplexed as to whether you are using your own application to load the documents, or are loading them with the Tamino Data Loader!
Thanks,
Trevor.