Required tags not present when using Delphi XML Data Binding Wizard

urevksrhpf

New Member
I am using the XML Data Binding Wizard in Delphi XE2.The schema has required tags of this type:\[code\]<xs:complexType name="MyReportType"> <xs:all> <xs:element name="Header" type="HeaderType" /> <xs:element name="Values" type="ValuesType" /> <xs:element name="Events" type="EventsType" /> </xs:all></xs:complexType>\[/code\]The problem is that if I don't add any elements to e.g. the Values-group, there will be no \[code\]<Values>\[/code\]-tag, and the XML-file will fail validation against the XSD. This would probably not be a problem if the interface was providing a method for "adding" the Values-tag.Is there a standard way of handling this, or am I using the generated code incorrectly?(I know there are other similar issues, like the code generated by \[code\]<xs:sequence>\[/code\] not enforcing the correct order in the final XML-file, but at least for that one, there's a work-around by simply inserting the children in the right order. I still think it would be nice if Embarcadero would provide a complete interface, which takes more of these features into account.)
 
Back
Top