Abstract Superclass and association in XML
let's say we have an abstract superclass "Animal" as ComplexType in XML-Schema with "Cat" and "Dog" as subclasses. And we have a 开发者_运维问答class "Zoo". Is it possible to create a bidirectional association between Animal and Zoo via IDREF ? How? Can someone show me a short example for it?
Did you mean IDREF? An IDREF says nothing about what kind of element it is referring to, so putting IDs and IDREFs in Animal and Zoo solves your problem trivially. If you want a reference mechanism that points to specific element types, you need to use key and keyref.
精彩评论