[Home] [By Thread] [By Date] [Recent Entries]
David Carver writes: > Personally, I HATE xsi:type. In most B2B scenarios I've been involved > with it causes more interoperability issues then it solves. > I'd much rather get rid of XML type, and force people to validate > against the schema as is Schema types (which I'm guessing is what you mean by XML type) and xsi:type aren't at all the same thing. If you get rid of Schema types, then you can't say "this element must contain an Integer". Is that the complication you're trying to avoid? If so, yes, you should argue against Schema types. If you're arguing against xsi:type, I can certainly understand that. It's the wrong thing in >90% of use cases (probably way more, but I'm just guessing and trying to be conservative), and it makes a mess of instance documents. It was introduced because some members of the Schema WG were very anxious to handle serialization of object graphs, I.e. to do what Java Object Serialization (used by RMI) does. SOAP Encoding is an example of such XML-based object serialization, and it uses xsi:type. Indeed, because of dynamic subtyping, it's generally the case that the serialization formats for such systems must carry for each item both its name and its type. Go read through the format spec. for Java Object Serialization and you'll see that's the core of it. In XML with schema, you can use the tag for the name, and xsi:type for the type. Personally, I'm not convinced that supporting that scenario should have made an 80/20 cut for schema, but as happens on a big committee, some people argued very strongly for it. You can, of course, turn it off by using suitable "block" attributes at the right points in your schema. While that pretty much ensures that your instances are clean (I think xsi:type is still allowed for better or worse, but it can't then designate a type other than the one your element would have had anyway, as I recall), but it's a nuissance in the schema. Noah -------------------------------------- Noah Mendelsohn IBM Corporation One Rogers Street Cambridge, MA 02142 1-617-693-4036 --------------------------------------
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] |

Cart



