Defining schemas of "old" DTD's

Hi,
I’m running Tamino V3.1.1.1 and I tried to define a simple schema with the new schema editor. The loaded DTD is well-formed, valid and looks pretty simple. Schema definition worked fine in Tamino 2.3.1.4 but in V3.1.1 I get the following error
which seems to be the same one that rene foehn had.

The error message is:
“validation has detected an error in document; datatype validation for attribute “name” of type xs:NCName failed: An invalid value has been found during validation. ”

Can anybody help me ?

I’ll try to attach the DTD…

Regards,

Claus

event.xml (1.86 KB)

This is a Tamino TSD2 schema. not a DTD.

Is this what you generated from the new Schema Editor in Tamino 3.1

the DTD is attached.

Regards

Claus

event.dtd (475 Bytes)

The reason for the error is that the generated schema will contain element with namespace prefixes such as:
<xs:element name=“meta:event”…

and this isn’t allowed in the XSD specification. What needs to happen here is to model all the DTD elements and attributes without the meta: prefix and ensure Tamino will validate the document with the correct namespace (i.e. “http://www.MobileLogic.com/meta”), so that an instance such as

<?xml version="1.0"?>
<meta:event xmlns:meta = “http://www.MobileLogic.com/meta” meta:event-id=“x”>
<meta:action meta:calltype=“x”>
meta:servicex</meta:service>
meta:methodex</meta:methode>
meta:URLx</meta:URL>
meta:parameterx</meta:parameter>
</meta:action>
</meta:event>

will be accepted.

Maybe Nigel has some ideas on how to do that - I’ve drawn a blank I’m afraid.

Thanks Stuart :slight_smile: - I’ve done something horrible to my system and I can’t run the Schema Editor any more.
What you do though, is as you said edit the DTD
1)remove the declaration of the attribute xmls:meta

2) remove “meta:” everywhere

3)Convert it to a Tamino Schema.
4)Now the bit I can’t check with the Schema Editor
-you have to change the schema to specify to use the prefix meta: and the namespace http://www.in4motion.com/meta.
I just can’t remember how to do that with the Schema tool
but if you can’t work it out it is pretty easy to do with an normal editor

The magic is physically
1) change the xs:schema element start tag to look like this
from
<xs:schema xmlns:xs=“XML Schema” xmlns:tsd=“http://namespaces.softwareag.com/tamino/TaminoSchemaDefinition”>

to
<xs:schema xmlns:meta=“in4motion.com” xmlns:xs=“XML Schema” xmlns:tsd=“http://namespaces.softwareag.com/tamino/TaminoSchemaDefinition” targetNamespace=“in4motion.com”>

2)Edit the tsd:doctype element to look like this

- <tsd:doctype name=“meta:event”>

And I think you are done.

Give it a shot

Ok - I fixed my machine

In the schema editor, after importing the “meta:” less DTD, set the logical properties

targetMamespace to http://www.in4motion.com/meta
targetMamespacePrefix to meta
collection to whatever

Then select verify and you get queried for the document root - for the doctypename

so you select “event”

The doctype name is becomes “meta:event”

and you get a plausible result which defines in my system without error

event.tsd (1.72 KB)

Hi Nigel,

Thanks for that! I’ve already been down that road but then have troubles storing a document that conforms to the schema, and to be honest I’m not sure if I am doing something or Tamino is not processing the instance correctly. So below is the TSD3 schema that I created and an instance document. Can you see whats wrong? When I store the document I get a error complaining about the event-id attribute not being found [ in the schema ].

The instance document is:
<?xml version="1.0"?>
<meta:event xmlns:meta = “http://www.MobileLogic.com/meta” meta:event-id=“x”>
<meta:action meta:calltype=“x”>
meta:servicex</meta:service>
meta:methodex</meta:methode>
meta:URLx</meta:URL>
meta:parameterx</meta:parameter>
</meta:action>
</meta:event>

Kind regards,
Stuart

event1.tsd (3.68 KB)

I’ve made some progress

If the attributes are to be named as meta:whatever
then you have to set the attributeFormDefault to be “qualified”. This is because they are declared locally in the schema (within their elements)
The cahnge is like this
like this
<xs:schema xmlns:xs = “XML Schema
xmlns:tsd = “http://namespaces.softwareag.com/tamino/TaminoSchemaDefinition
targetNamespace = “in4motion.com
xmlns:meta = “in4motion.com
attributeFormDefault=“qualified”>

You can do this with the schema editor logical properties. - the default is “unqualified”

However I am getting a content error with your instance - maybe I’m too dumb to spot it.

quote:
Originally posted by Nigel Hutchison:
Thanks Stuart :-) - I've done something horrible to my system and I can't run the Schema Editor any more.
What you do though, is as you said edit the DTD
1)remove the declaration of the attribute xmls:meta

2) remove "meta:" everywhere


Do only remove "meta:" in the name="meta:...".
Do not remove anything in ref="meta:..."!
If you remove "meta:" for an attribute (or an local element, which is currently never generated by the DTDtoTSD3 converter) you must as you said in an additional mail add
form="qualified".
Unfortenately there is an instance validation bug
for this in the V3.1 version.
Fix is currently only realised for York.

Best regards
Walter

3)Convert it to a Tamino Schema.
4)Now the bit I can't check with the Schema Editor
-you have to change the schema to specify to use the prefix meta: and the namespace http://www.in4motion.com/meta.
I just can't remember how to do that with the Schema tool
but if you can't work it out it is pretty easy to do with an normal editor

The magic is physically
1) change the xs:schema element start tag to look like this
from

to

2)Edit the tsd:doctype element to look like this

-

And I think you are done.

Give it a shot


How did that get through QA?:slight_smile:

If I set the schema content model to “open” I can load the document but this implies it is not getiing a full schema check

tsd:logical
tsd:contentopen</tsd:content>
</tsd:logical>

I can’t see how to do this with the schema editor

Walter explained how to do “physically magic”. This would have to be done in the schema source.
But you can do the same thing with the Schema Editor by setting the schema nodes “targetNamespace” property to “in4motion.com” and by setting the “targetNamespace prefix” property to “meta”.