Eric van der Vlist wrote: > On Fri, 2004-07-23 at 10:47, Hussein Shafie wrote: > >>Eric van der Vlist wrote: >> >>>There is another workaround which is 100% W3C XML Schema which is to use >>>a "xsi:type" attribute instead of your unqualified "type" attribute: >>>"xsi:type" is a WXS feature that lets you specify the type (either >>>complex or simple) of an XML element in the instance document. >>> >>>I don't know to which extend it is supported by XXE, though. >> >>It should be well supported by XXE (I haven't retested this >>interactively since a long time) because XXE uses a very dynamic validator. >> >>But IMHO this feature is unusable interactively in any XML editor >>because it requires you to manually add the proper "xsi:type", which is >>error prone and easy to forget. > > > That is, unless your editor has a feature to define in which elements > users can add xsi:type attributes and is able to find out which > datatypes are acceptable derivations of the element's type and propose a > list of values for this xsi:type. > > I don't know if any editor does that nor if there is a business need to > justify this development but it can certainly be done :) ...
You are right. It can be done. But with a lot of efforts to make this feature *really usable* interactively. For example, the editor could automatically suggest to insert/replace/convert elements with all the different content models: shipTo(Address), shipTo(USAddress), shipTo(UKAddress), etc... Currently XXE will not help you at all and you need to explicitly type the right type name for attribute "xsi:type". Of course, it is always possible to define named element templates by hand, each one with the right "xsi:type" and each one with a skeleton matching this "xsi:type".

