I am using XML Data Binding to generate the Delphi XML class from XSD
file. I found the Attribute's default value isn't implemented in the
wizard or is there any other alternative way to make it work?
For example, if I have the following attribute:
<xs:complexType name="Control">
<xs:attribute name="Caption" type="xs:string"/>
<xs:attribute name="Visible" type="xs:boolean" default="True"/>
</xs:compleType>
If my XML content is as follow:
<Control Caption="Test"/>
Later if I use the XML class:
Control.Caption will return "Test" but Control.Visible will always
return "Could not convert variant of type (Null) into type (boolean)"
error. If the insert the Visible attribute into XML:
<Control Caption="Test" Visible="True" />
then it works fine.
Please advice. Thank you.
--
Best regards,
Chau Chee Yang
E Stream Software Sdn Bhd
URL: www.sql.com.my
SQL Financial Accounting
khariV
--- posted by geoForum on http://delphi.newswhat.com