[xsd-users] handling polymorphism

Christian Sell christian at gsvitec.com
Fri Oct 10 04:07:34 EDT 2014


Hello,

I am sure this is a standard issue, and the solution is probably described
somewhere in the docs. Nonetheless I am trying the shortcut through the mailing
list, maybe someone can provide a pointer to the relevant chapters:

Our schema contains a type hierarchy, which is also represented as a
substitution group. At the root of the hierarchy (and the sgroup) lies
"abstractitem". abstractitem is also referenced elswhere as contents of an
unbounded sequence.

Now, when processing the sequence, we need to apply specific algorithms to
individual types. Ideally, we would like to have a true "object-oriented"
solution, like:


//declared in abstractitem:

virtual void process(Processor proc) = 0;



//implemented in subtypes:

void process(Processor proc) {

   proc.processSpecificType(this);

}



can this be achieved with XSD(/e)? Or is there another solution? Please answer
with special focus on XSD/e, as we will have to migrate there

thanks,
Christian Sell


More information about the xsd-users mailing list