Re: XSD to Pascal Objects?

From: Jan Mitrovics (mitrovics_at_web.de)
Date: 04/20/04


Date: 20 Apr 2004 07:51:15 -0700

Adem wrote:

> > 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.

This is actually included in Delphi 7 Enterprise. Not sure if it is in
D6 already.

It is called the XML Data Binding Wizard (not to be mixed up with the
XML mapper which will map to a database).

You can find the Wizard under File->New->XML Data Binding.

It takes an XML or DTD or XSD file and creates a .pas file with an
object representation based on IXMLNode.

Really a very handy tool! I miss it in D8 (haven't really digged
through all the .Net classes though).

Jan



Relevant Pages

  • Re: TreeView with Recursive TreeNode....
    ... > XML would not be particularly helpful in this case. ... > As Mark says, a function to build up the tree nodes would still have to ... >> view of the data to recurse through then it would simplify the technique ...
    (microsoft.public.dotnet.framework.windowsforms)
  • Re: If I could.. another MFC / UNicode question
    ... the BOM mark, and so it can be harmful. ... XML) have other ways to indicate what the encoding is. ... Byte Order Mark FAQ: ... Murphy's law, also known as Sod's law, states that if ...
    (microsoft.public.vc.mfc)
  • Re: Best way to recursively populate a tree based on SQL Server 2000 b
    ... Thanks Pete - Data's changes quite a bit so I need to stay realively live... ... Mark ... > Reflective relationships can sometimes be a pain to deal with. ... > data is slow changing I would highly reccommend using xml. ...
    (microsoft.public.dotnet.faqs)
  • Re: Explorer crashing while navigating folders containing .xml fil
    ... Well Mark, you did it again!!! ... The icon for XML file association was broken, when I tried to change it, I ... Mark L. Ferguson MS-MVP ...
    (microsoft.public.windowsxp.help_and_support)
  • Re: Intellisense generation using C# and XSD
    ... fairly complex and I have an XSD file to validate it when the user ... to use it to add intellisense when users are typing in the xml. ... and use the schema to drive the user interface. ... you could then display the "input form" for that particular choice. ...
    (microsoft.public.dotnet.xml)