Validation of unknown subclass [modified]
-
Hi, I have a problem with validation a list of different subclasses. The are all derived from one base class(ElementBase). I want to make the schema future-proof by adding a placeholder. Here a short example
< xs:element name="Elements">
< xs:complextype>
< xs:choice minoccurs="0" maxoccurs="unbounded">
< xs:element name="BaseElement" type="ElementBase" />
< xs:element name="Sphere" type="ElementSphere" />
< xs:element name="Cone" type="ElementCone" />
< xs:element name="Cylinder" type="ElementCylinder" />
HERE I need a placeholder
< /xs:choice>
< /xs:complextype>
< /xs:element>My idea was to make another complex type with an any Parameter like followed.
< xs:complextype name="FurtherElements">
< xs:complexcontent>
< xs:extension base="ElementBase">
< xs:sequence>
< xs:any minoccurs="0" maxoccurs="unbounded" />
< /xs:sequence>
< /xs:extension>
< /xs:complexcontent>
< /xs:complextype>But how do I put this into the choise statement? I still don't know the name of the future elements (but xs:element needs one: < xs:element name="" type ="FurtherElements"/>). Is there any workaround to solve this problem? Thanks a lot
modified on Monday, June 9, 2008 4:53 AM