[XML] Delphi 7 XML Data Binding is flawed?
Posted on 2003-11-19
Okay, I wonder if there are more problems with the XML Data Binding wizard than the ones I found. I found that:
1) Adding child nodes to a sequence node will not add them in the order that is required by the sequence.
2) Boolean values are written as 'True' or 'False' while XML is case-sensitive and expects them to be 'true' or 'false'.
3) DateTime fields are not written in the XML-specific format.
About that first issue... If I have this schema-declaration:
<xs:element name="Name" minOccurs="0" type="xs:string"/>
<xs:element name="Description" minOccurs="0" type="xs:string" minOccurs="0"/>
Now, in Delphi. If I create a node of type NamedItem and add a description before the name, the XML file will look like this:
However, the schema specified that they should be a sequence so I expected Delphi to put these nodes in the right order!
So far, the issues I've found are things I can accept for now. I realise these errors might require me to work around them if I want to output an xml file that validates according to my schema. But I wonder if there are even more problems with Delphi's implementation of XML.
My problem: I have an xml schema and I need to generate/read/write an xml file and make sure it is valid according to this schema. A simple solution is to modify the sourcecode that is generated by the XML data Binding wizard and I just have to make sure I insert elements in the right order. But I wonder if I can expect even more problems.
And no, I don't want or need any alternative XML components, no matter how good they are, how fast they are or how free they are.
Points will be divided if more than one person mentions possible problems that haven't been mentioned before.