A recent bug was reported via email about xsd:choice nodes. Currently, we haven't implemented xsd:choice yet. And if you have it in your schema, it's reported and an invalid child of the node it's under (such as complexType). It is not an invalid child, that's just how xmlArchitect processes the schema. When it comes across a node that we haven't implemented yet, it reports it as an invalid child.
The main problem with xsd:choice is how do you represent that inside of the XMLTree? We are striving our best to make that tree show *exactly* what the XML document should look like, so we can't introduce a 'choice' node in the tree with children of the choice below it, because that node would never appear in the instance document. We're toying with the idea of having the parent node of the Choice element repeat itself and the children would be different, displaying the different choice children, such as:
As of this time, that's how we're thinking about implementing xsd:choice nodes. Would this be a viable solution? How else would you do it? Remember, we're trying our best to keep the XML tree exactly that, a representation of the XML, not of the XSD...
-BKN
The main problem with xsd:choice is how do you represent that inside of the XMLTree? We are striving our best to make that tree show *exactly* what the XML document should look like, so we can't introduce a 'choice' node in the tree with children of the choice below it, because that node would never appear in the instance document. We're toying with the idea of having the parent node of the Choice element repeat itself and the children would be different, displaying the different choice children, such as:
XMLSchema===========<xsd:element name="Orders"> <xsd:complexType> <xsd:sequence> <xsd:element name="Order"> <xsd:complexType> <xsd:choice> <xsd:element name="OrderType" type="xsd:string"/> <xsd:element name="PONum" type="xsd:string"/> <xsd:element name="Customer" type="xsd:string"/> <!-- etc.. ---- </xsd:choice> <xsd:choice> <xsd:element name="OrderType" type="xsd:string"/> <xsd:element name="OrderNum" type="xsd:string"/> <xsd:element name="Client" type="xsd:string"/> <!-- etc.. ---- </xsd:choice> </xsd:complexType> </xsd:element> </xsd:sequence> </xsd:complexType></xsd:element>XMLTree========== Orders |- Order (choice1) |- OrderType |- PONum |- Customer |- Order (choice2) |- OrderType |- OrderNum |- Client
As of this time, that's how we're thinking about implementing xsd:choice nodes. Would this be a viable solution? How else would you do it? Remember, we're trying our best to keep the XML tree exactly that, a representation of the XML, not of the XSD...
-BKN
