Need help converting a W3C Schema

Hi,
I need some help converting a W3C Schema to a TSD4. I’ve tried using converter tool but it had some problems. This W3C schema unfortunately has
1) imports
2) attribute groups
3) facets (simpleTypes)

Please take a look. I think we should come up with a Schema Repository to store popular XML standards as TSD4s for all to use. If there is, please let me know where I can find it.

Thanks, Sean Koh
cpp-cpa-2_0.xsd (24.2 KB)

Hi,

Unfortunately you did not provide any information about Tamino Server version.
I have attached a fixed schema file, that should work with Tamino 4.1.1.

What I did is replacing the attributeGroup references with their content.

Tamino Schema Editor provides some rudimentary help for converting XSD schema, those functionality is resided beneath menu entry Tools->Transformation.

A more sophisticated (one-click) transformation help is planned with an upcoming community release of Tamino Schema Editor.

Hope this helps,

Best regards,
Peter
cpp-cpa-2_0_TSD4_1_1_fixed.tsd (29.8 KB)

Thanks for your help. I’m using Tamino4. I thought mentioning TSD4 would have said it.
I tried defining the schema and it would not go in. Got an error as below:

An error occurred while processing a schema document; (src-import.2) Invalid import element. Schema reference could not be resolved. <INOXDE7931,INOXDE7536>
An error occurred while processing a schema document; (src-import.2) Invalid import element. Schema reference could not be resolved. <INOXDE7931,INOXDE7536>

I guess this is due to the imports. How do I take care of these. Also, this schema has named simpletypes and complexTypes. Does TSD4 understand these or do I have to convert them manually? Sean.

Tamino 4.1.1 supports named simple and complex types. If you use the schema editor and switch to the TSD4 view (almost) all problems will be listed. Global types are not listed with your schema.
The imported schemas have to be present in Tamino. Thus you have to define them first and change the schema location on them (see documentation).
The schema for the xml namespace is already available in Tamino. Schema location is: …/ino:collection/xml_lang_space.
Please post if you are successful or not. Otherwise post a zip file with your entire schema family. I will convert it tomorrow afternoon.

Yes. I would like to try it out. I had some trouble trying to define the additional xsd. DO I have to load them in as nonXML? The digital signature xsd is in this posting. I will poast xlink in the next one.
Thank you so much, Sean.
xmldsig-core-schema.xsd (10.1 KB)

XLINK
xlink.xsd (1.5 KB)

The imported schemas have to be present in Tamino. Thus you have to define them first and change the schema location on them (see documentation).

where is exactly?

The schema for the xml namespace is already available in Tamino. Schema location is: …/ino:collection/xml_lang_space.
I try to add this to my schema (attached) but i get the error:
<?xml version="1.0" encoding="ISO-8859-1" ?>
- <ino:response xmlns:ino=“http://namespaces.softwareag.com/tamino/response2” xmlns:xql=“XQL FAQ (XML Query Language - Frequently Asked Questions)”>
- <ino:message ino:returnvalue=“7931”>
<ino:messagetext ino:code=“INOXDE7931”>An error occurred while processing a schema document</ino:messagetext>
ino:messagelineINOXDE7533: (mp-valid-appinfo.1.3) Below Schema there needs to be exactly one appinfo node which defines Tamino mappings</ino:messageline>
</ino:message>
</ino:response>
Any help?
@nto
presence.xsd (2.82 KB)

Sean,

Here are the converted schemas.
xlink: was fine.
xmldsig: the schema editor did not liked the doctype declaration somehow, after removing it worked.
ccp-cpa: the attribute groups were converted. The usage of non-empty-string replaced by xs:string.

[For your schema editor version I did clear the schema version property, too.]
ccp-converted.zip (5.31 KB)

nto,

you have to tell Tamino what the schema name and the collection name is to be. Thus currently there is no appinfo for Tamino yet, thats what the error message says.

You both have to declare the doctypes, too. Otherwise you cannot load documents for your schemas.

Best is to use the Tamino Schema Editor.

I have added the collection,the schema name and the doctype too, so the file become .tsd.
But when i insert it i get:
INOXDE7931">An error occurred while processing a schema document</ino:messagetext>
ino:messagelineINOXDE7917: Line 7, Column 8: (mp-valid-doctype-name.3) For each doctype name where the doctype is not of type nonXML there must be a matching global element with a matching qualified name.

But the doctype match with the global element!!!
Best,
@nto
presence.tsd (3.55 KB)

The doctype is a reference on a global element thus it has to be prefixed like other element references: add the target namespace prefix tns to the doctype name.

thanks :slight_smile:

i didn’t know that thing.
@nto

Thank you all who have helped in this!
I did not want to remove the doctype declaration from the digsig xsd. But I guess there is no choice.
Sean.

Sean,

you may have doctypes whereever you want. Each schema may have its own doctypes and documents, regardless if a schema is used from another schema, too.

Yes. This is true. In the zipped file, I’ve modified the CPA to declare 2 doctypes. One is
CollaborationProtocolProfile and another is
CollaborationProtocolAgreement. I’ve since managed to define the schemas without any trouble. But I’m now unable to load the data. Have a look at test.xml in the zipped attachment. Get a message which says Schema Not Found. Sean.

Please forget about the previous posting. It is working now. Had the wrong document given to me by customer. Sean.

Trying to insert my schema i get:
=“7703”>
<ino:messagetext ino:code=“INOXDE7703”>validation has detected an error in document</ino:messagetext>
ino:messagelineINOXDE7763: Line 71, Column 44: datatype validation for attribute “name” of type xs:NCName failed: (cvc-datatype-valid) An invalid value has been found during validation</ino:messageline>
</ino:message>
why?
@nto
presencenew.tsd (6.21 KB)

An element name has to be an NCName. No : is allowed there. Remove the prefix from the name. Whether the name of this local element has to be prefixed in the instance or not, depends on the form property or on the general elmentFormDefault property of the schema.

Line 71 points to the subscriber element…also removing the mapns prefix at line 54 for that element…i don’t resolve the problem.
Which element should i modify?

@nto

Best is to use the schema editor. If you get an error message, klick on the message and the respective tree node is selected.

Please read the error messages carefully. After changing the element NAME mapns:contactaddress to contactadress, you get this error:
An error occurred while processing a schema document; (src-resolve.1.1) Global type reference could not be resolved <INOXDE7931,INOXDE7529>

Thus the base type of contactadress is mapns:contactaddreass [note the type error]. But no type named contactaddreas or contactaddress is defined in your schema!
So what?