Re: XSD to Pascal Objects?
From: Adem (adembaba_at_excite.com)
Date: 04/19/04
- Next message: C Clemans: "ANN: Ledger Accounting for Interbase / Firebird"
- Previous message: JED: "Re: [ANN] AutomatedDocking Library 1.2 released"
- In reply to: Bryce K. Nielsen: "Re: XSD to Pascal Objects?"
- Next in thread: Bryce K. Nielsen: "Re: XSD to Pascal Objects?"
- Reply: Bryce K. Nielsen: "Re: XSD to Pascal Objects?"
- Reply: Jan Mitrovics: "Re: XSD to Pascal Objects?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 18 Apr 2004 16:20:25 -0700
Bryce K. Nielsen wrote:
> It sounds like what you're looking for is not XML to VCL, but Schema
> to Pascal Objects. Something that would do the following:
>
> - Take a sample XML document and generate a schema for it
> - Using said schema, generate the code for Object Pascal objects
>
> Granted, step one can be bypassed if you start with the Schema
> instead of an instance document.
>
> For example, you'd like to see this XML:
>
> <Orders>
> <Order>
> <OrderNum>1004</OrderNum>
> <CustomerName>Fred Hare</CustomerName>
> <!-- etc... -->
> </Order>
> </Orders>
>
> Generate this pascal code:
>
> TOrders = class(TObject)
> public
> Orders : TObjectList;
> end;
>
> TOrder = class(TObject)
> public
> OrderNum: Integer;
> CustomerName: string;
> //etc...
> end;
>
> Is this near to the mark?
Yes. More or less that is it.
> If so, haven't seen anything personal like this.
> Such a library would be quite tricky, though I suppose if
> done right could automate a bunch of read/write routines.
I would not expect it to be 100 % on the mark, but if it let me
help it along the way (for, say, data type, or the object type)
it should not be too tough.
There is similar stuff for C# and C++ (XMLSpy) but nothing for
Delphi; I wonder if it is for the lack of demand or oversight
of a market. Hint hint for 3rd party app makers :-)
> For memory objects from XML documents, most of us stick to DOM
> objects or ADO (as Xml) or even other "generic" in-memory tables
> like DevExpress's Mem component.
kbmMemTable etc. are useful but only if all the stuff you're dealing
with are in table form.
If it is a tree-like structure, in order to get to a branch you
are interested, you have to:
i) create as many tables as there are node types;
ii) set up fields etc for master-detail relationships;
ii) hope that you have some patience left to do filtering and
ranging and what not;
IMHO, this is too much chuff for what it attempts to solve, wouldn't
you agree.
Or, am I missing a whole lotta simpler way?
Cheers,
Adem
- Next message: C Clemans: "ANN: Ledger Accounting for Interbase / Firebird"
- Previous message: JED: "Re: [ANN] AutomatedDocking Library 1.2 released"
- In reply to: Bryce K. Nielsen: "Re: XSD to Pascal Objects?"
- Next in thread: Bryce K. Nielsen: "Re: XSD to Pascal Objects?"
- Reply: Bryce K. Nielsen: "Re: XSD to Pascal Objects?"
- Reply: Jan Mitrovics: "Re: XSD to Pascal Objects?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]