Log On
Embarcadero Home
Watch, Follow, &
Connect with Us
Share This
QualityCentral
Communities
Articles
Blogs
Resources
Downloads
Help
QualityCentral
Delphi-BCB
Internet
XML
Data Binding
You are not logged in.
Help
Print
Public Report
Report From:
Delphi-BCB/Internet/XML/Data Binding
[ Add a report in this area ]
Report #:
8273
Status:
Open
Add basic support for enumerated types when binding to an XML Schema
Project:
Delphi
Build #:
8.1
Version:
7.0
Submitted By:
Joe McCurdy
Report Type:
New Feature Request
Date Reported:
5/26/2004 2:55:52 PM
Severity:
Commonly encountered problem
Last Updated:
3/20/2012 2:24:39 AM
Platform:
All platforms
Internal Tracking #:
209517
Resolution:
Deferred to Next Rel
(Resolution Comments)
Resolved in Build:
:
None
Duplicate of:
None
Voting and Rating
Overall Rating:
(1 Total Rating)
5.00 out of 5
Total Votes:
20
Description
Automate the generation of the code to support enumeration restrictions, as shown in example in "Steps" tab.
Steps to Reproduce:
unit MyXMLBinding;
interface
uses ..., TypInfo, ...;
type TMyEnumeratedType = (etNone, etOne, etTwo, etThree);
IXMLMyEnumNode = interface(IXMLNode)
['{guid}']
{ Property Accessors }
function Get_MyET: TMyEnumeratedType;
procedure Set_MyET(value: TMyEnumeratedType);
{ Methods & Properties }
property MyET: TMyEnumeratedType read Get_...
...
implementation
...
function Get_MyET: TMyEnumeratedType;
begin
if AttributeNodes['MyEnum'].Text <> '' then
Result := TMyEnumeratedType(GetEnumValue(TypeInfo(TMyEnumeratedType)AttributeNodes['MyEnum'].Text))
else
Result := etNone;
end;
procedure Set_MyET(value: TMyEnumeratedType);
begin
SetAttribute('MyEnum', GetEnumName(TypeInfo(TMyEnumeratedType), Ord(Value)));
end;
end.
Where the source XSD has a definition as follows:
<xs:complexType name="MyEnumNode">
<xs:attribute name="MyEnum">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="etNone" />
<xs:enumeration value="etOne" />
<xs:enumeration value="etTwo" />
<xs:enumeration value="etThree" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
Or, instead of creating a new enumerated type, the binding wizard could offer to make use of any existing enumeration, such as TFontStyles, etc., in the "DataType" combobox.
Workarounds
None
Attachment
None
Comments
None
View Your Reports
Search
Server Response from: ETNACODE01
Developer Tools
Blackfish SQL
C++Builder
Delphi
FireMonkey
Prism
InterBase
JBuilder
J Optimizer
HTML5 Builder
3rdRail & TurboRuby
Database Tools
Change Manager
DBArtisan
DB Optimizer
ER/Studio
Performance Center
Rapid SQL
Technical Articles
Tutorials
White Papers
Press Releases
Newsletters
Add Content (GetPublished)
Audio
Audio & Video
Video
Bugs & Suggestions (QualityCentral)
Discussion Forums
Examples (CodeCentral)
Tags
Technology Partners
Downloads
Free Trials
Registered User Downloads
Beta Programs
Add Content (GetPublished)
Articles
Blogs
Bugs & Suggestions (QualityCentral)
Discussion Forums
Examples (CodeCentral)
Member Services
About
Connect with Us