I was wondering if anyone has an answer to this. I searched the NS and found no answers nowehere to this.
Perhaps I’m doing osmething wrong or I am not understanding things properly, but if one defines an attribute in a schema, gives it a type from the combobox (not using facets, which override the type), then the schema should enforce that type upon insertaion of doc instances.
However, when I use the xs:language type, and I insert instances where the attrib has values such as “en=ca”, “en ca”, “whatever even” it inserts the doc instance.
but if one defines an attribute in a schema, gives it a type from the combobox (not using facets, which override the type), then the schema should enforce that type upon insertaion of doc instances.
Yes, in principle you are right. But, for xs:language, things are not that easy. XML Schema (Errata merged in) says:
[Definition:] language represents natural language identifiers as defined by [RFC 3066]. The
this topic has been discussed extensively in the past:
(1) the set of valid values for xs:lang is a moving target
(2) the errata for the XML schema spec give a regular expression which is not very restrictive
and contains a syntactical error
For these reasons, we have not (yet) built these restrictions for xs:lang into Tamino.
It is treated like xs:string.
Thank you everyone for consice and helpful information.
I have read W3C’s info on the topic, but it is often very hard to red and understand, unless you like that kind of technical stuff. However, reading W3C’s info didn’t quite tell me how Tamino was dealing with the issue.
I still find it a bit misleading that Tamino even offers xs:language as a type when it really behaves like xs:string. What is the rationale behind it? Is it so that the schemas will be portable in future, when xs:language is finalized ?
Also, I am sure this topic have been discussed in the past, but I searched the NS and didn’t find anything at all. And such searches are simple (xs:language).
Even before posting this I thought of using a facet with an expression. You have confirmed that this is the best way to go for now.
I appreciate your time for responding to my question.
I’m a Zen Garden Maintenance Engineer
thank you. You wonder why “Tamino even offers xs:language as a type when it really behaves like xs:string”.
As you guess, this is for compatibility reasons. We are striving for 100% XML Schema compliance, so we have to support all types. As Uli wrote, the only thing that can be done at all is to add a pattern to restrict the type a little bit more. We will do so in the future.