Duplicate Elements in Doctypes

X-Application Version : 3.1.1
Tamino Version : 3.1.1.1
Platform : NT
WebContainer : Tomcat 4.0
JDK Version : 1.3.1_01

Question:
I have a Tamino collection containing two doctypes. Element “custname” appears in both doctypes in the schema. If I try to generate an X-Application for either doctype, I get the following exception. Can this by bypassed in any way?

Exception:

code:

D:\xapplication_311\examples\generator>generateresreq
X-Application Generator generate
[ConfigContainer] reading D:\jakarta-tomcat-4.0.1\webapps\resreqgen\config.xml
[ConfigContainer] done reading D:\jakarta-tomcat-4.0.1\webapps\resreqgen\config.xml
[ConfigContainer] reading D:\jakarta-tomcat-4.0.1\webapps\resreqgen\WEB-INF\web.xml
[ConfigContainer] done reading D:\jakarta-tomcat-4.0.1\webapps\resreqgen\WEB-INF\web.xml
[ConfigContainer] …TAMINO_URL found!
[ConfigContainer] …TAMINO_COLLECTION1 found!
[Generator] Initializing Generator!
[Generator] Reading Schema!
Exception in thread “main” InvalidSchemaException: duplicate element decl: custname
com.softwareag.xtools.xapplication.businessdocument.InvalidSchemaException
duplicate element decl: custname
at com.softwareag.xtools.xapplication.businessdocument.Schema.addElementDecls(Schema.java:373)
at com.softwareag.xtools.xapplication.businessdocument.Schema.addElementDecls(Schema.java:379)
at com.softwareag.xtools.xapplication.businessdocument.Schema.addElementDecls(Schema.java:379)
at com.softwareag.xtools.xapplication.businessdocument.Schema.addElementDecls(Schema.java:379)
at com.softwareag.xtools.xapplication.businessdocument.Schema.addElementDecls(Schema.java:379)
at com.softwareag.xtools.xapplication.businessdocument.Schema.addElementDecls(Schema.java:379)
at com.softwareag.xtools.xapplication.businessdocument.Schema.addElementDecls(Schema.java:379)
at com.softwareag.xtools.xapplication.businessdocument.Schema.addElementDecls(Schema.java:379)
at com.softwareag.xtools.xapplication.businessdocument.Schema.(Schema.java:358)
at com.softwareag.xtools.xapplication.businessdocument.Schema.read(Schema.java:156)
at com.softwareag.xtools.xapplication.generator.Generator.readSchema(Generator.java:604)
at com.softwareag.xtools.xapplication.generator.Generator.(Generator.java:267)
at com.softwareag.xtools.xapplication.generator.Generate.process(Generate.java:95)
at com.softwareag.xtools.xapplication.generator.Generate.main(Generate.java:62)

Hello Bill,

currently X-Application does not support schema documents which contain two element declarations with the same name. A possible workaround for this problem could be:

  • A to use a reference if the two schema use the same element ?custname? :
    for example:
















  • B to split the schema document if the two schemas contain an element ?custname?, but the element is different .
    For example for your ?customer? schema it is a complex type and for ?resource? schema it is a simple string:



















    When the schemas are stored within two different documents, X-Application will also create two different objects for the schema information and the conflict for ?custname? does not longer appear.

I hope (A) or (B) will be an acceptable workaround for your problem.

Good bye,
Christian.