Re: Conditional typing

Hi,

Piccand Régis wrote:


> - Is this possible to do that in the actual version of xmlschema ?


It is impossible if you want to use a "type" attribute from your own 
namespace, but (almost) exactly what xsi:type has been designed for!

See for instance http://www.w3.org/TR/xmlschema-0/#UseDerivInInstDocs

The problem which you will have is that since xs:base64Binary and 
xs:string are both 2 primary types, you will have to use a generic UR 
type for the definition of your element and will not be able to control 
that other types are not used in addition of those two.


> - If not, is it planned to allow this kind of functionality ?
> - Is it recommended to use "non-standard" schema languages (schematron ??) ?


If you don't want (ot can't) use "xsi:type" instead of your "type" 

attribute, yes you can use schematron but it won't be that easy to test 

if it's a valid base 64 content with Schematron. 


What you can also do is to embed a schematron rule in a W3C XML schema 
with xsi:type to check that one of the two allowed datatypes is used.

Another option is to use RELAX NG instead of W3C XML Schema.

Hope this helps.

Eric

-- 
Rendez-vous a Paris pour mes formations XML/XSLT.
                                           http://dyomedea.com/formation/
------------------------------------------------------------------------
Eric van der Vlist       http://xmlfr.org            http://dyomedea.com
http://xsltunit.org      http://4xt.org           http://examplotron.org
------------------------------------------------------------------------

Received on Monday, 11 February 2002 04:54:48 UTC