Skip to content

XML Data Binding Wizard Fixes

I’ve just uploaded an update to Code Central which fixes a couple of problems you may run into if you are using moderately complex XML schema documents with the XML Data Binding Wizard.

Relative paths were not being handled correctly for “includes“ and there was also a problem with resolving types.

Thanks to Dave Brown and Gary Conley for bringing these issues to my attention on the borland.public.delphi.xml newsgroup.

Update: June 6th 2005 - Updated the link to the download on code central, please post a comment if you have any more problems with it.

{ 36 } Comments

  1. Sean Solberg | September 1, 2004 at 7:53 am | Permalink

    Nice to see an update but it doesn’t really fix many of the problems. There are so many other short comings with this wizard not producing correct code that I’ve had to write a program that will improve the produced pas files. Is there going to be a continued effort to fix this wizard or should I not wait for a fix and make the needed adjustments on my own.

    I submitted an issue on qualityCentral a long time ago but no one has commented on it from borland. I have a big list of bugs/suggestions but I don’t know who to submit them to?

    Please help with advise.

  2. Mark Edington | September 3, 2004 at 12:05 pm | Permalink

    Hi Sean thanks for the comment. If you have a list of bugs I would certainly like to see it. You can email me the list to me if you would like (medington at borland dot com).

    I will take a look on QC for your report.

    Mark

  3. Cool | September 5, 2004 at 5:48 pm | Permalink

    The one I see the most is the count property.

    If a node x has 4 sub nods x.count (should) =4. Sometimes it equals more. Not sure when it goes wrong but it means looping through them is a bad idea.

  4. brade | September 5, 2004 at 5:49 pm | Permalink

    This style seems a bit messed up in FireFox.

  5. Andrea Raimondi | October 31, 2004 at 3:00 pm | Permalink

    Hi Mark,

    Would be nice if the fix was compiled for Delphi6 as well. We D6 customers are not dead, you know… :-)

    Andrew

  6. Patrick Grogan | November 14, 2004 at 8:31 pm | Permalink

    I am using the french version of Delphi 7. I think I could use the XML Data Binding Wizard which is called in french "Expert Liaison de données XML".

    It simply does not exist in (what is probably called in english) the New tab of the File/New/Other menu item. I think the file containing that wisard is xmlrtl70.bpl. I have that file in C:\WINNT\system32\xmlrtl70.bpl and also this other file C:\WINNT\system32\xmlrtl70.FR. Both files are registered as shared DLL.

    Patrick

  7. Mark Edington | November 18, 2004 at 10:58 am | Permalink

    The file with the wizard is called dclnet70.bpl, make sure that is installed in your installed packages list. It’s only available in the Enterprise SKU though (not Pro).

  8. Raouf | January 5, 2005 at 2:24 am | Permalink

    that is a nice file.

  9. Ildefonso Martinez%20Marchena | March 1, 2005 at 12:56 am | Permalink

    Is there a way to invoke the xml databinding like a commnad line tool to automate de delphi interface creation?

    Best regards

    ilde

  10. Mark Edington | March 1, 2005 at 8:54 am | Permalink

    Sorry, no. The only interface is through the IDE wizard.

  11. Ildefonso Martinez Marchena | April 9, 2005 at 10:04 am | Permalink

    I am creating xsd schemas with recursive elements but the xml data binding can not convert these xsd files to delphi interfaces. I am in really troubles with it.

    Could you help me?

    Best regards

    ilde

  12. Ildefonso Martínez Marchena | April 9, 2005 at 10:40 am | Permalink

    Ok, finally i found a partial solution

    I can declare recursive elements declaring all them at the same xsd schema file.

    If you use several xsd files including making includes recursivily with the <xs:include schemaLocation="file1.xsd"/> xml data binding and delphi IDE will crash.

    This way I think i cant separate elements declarations in several xsd files :-( but dont crashes.

    Best regards

    ilde

  13. Pedro | June 7, 2005 at 2:21 am | Permalink

    Is there any update to this wizard?

    The link to code central is apparently dead …

  14. Mark Edington | June 7, 2005 at 2:50 pm | Permalink

    I updated the link in the post to point to a working code central url. Here it is as well: http://cc.borland.com/Item.aspx?id=21989

  15. Brad In The USA | June 8, 2005 at 8:14 am | Permalink

    "If a node x has 4 sub nods x.count (should) =4. Sometimes it equals more. Not sure when it goes wrong but it means looping through them is a bad idea."

    This bug happenned to me. It is fixed by only use the interface. I had a TXMLDocument I used to save/load the XML file. Doing so screws up the count.

  16. Brad In The USA | June 8, 2005 at 8:14 am | Permalink

    Any chance of a DotNet version for Delphi 2005?

  17. Mark Edington | June 8, 2005 at 8:37 am | Permalink

    The count of child nodes will include any whitespace text nodes that may be used for formatting the document. If you insert new elements and have the autoindent option turned on then you will see this. The count property on the binding interfaces (derived from IXMLNodeCollection) should always return an accurate value. You cannot rely on the ChildNodes.Count property to represent the number of sub-elements a given node contains.

  18. Mark Edington | June 8, 2005 at 8:39 am | Permalink

    The framework includes a tool called xsd.exe which generates classes that are substantially similar to the ones used by the XML data binding wizard so that is the recomended solution for .net. If you are porting native code that uses VCL XML Data Bindings those should port fairly easy to managed code.

  19. Hubai Zoltan | June 27, 2005 at 5:06 am | Permalink

    Will be there any updates in the future for the data binding wizard?

    I still have some problems with it. It dosn’t import the decimal type (decimal types are handled with the default type ‘widestring’ by me).

    If i change the interface declaration the object declaration is unchanged.

    For example i was trying to import a bit complicated xsd that had many duplicate names and for my suprise i got many errors.

    After that in the data binding wizard I changed the duplicate names and for interface part that worked, but all the object definitons where created with the old names.

    Like:

    IXMLHeader -> IXMLSadHeader

    IXMLHeader -> IXMLSadTransitHeader

    but unfortunatly i got 2 TXMLHeader

    At the end I was forced to manually change all the code (unfortunatly i have no influence on the xsd definition). The problem is that i need to do this evry time when I get a new xsd version. Any workarounds for this?

    Best regards

    Zoltan

  20. Mark Edington | June 27, 2005 at 2:25 pm | Permalink

    Can you please log this issue in Quality Central along with a schema attachment that demonstrates the problem. If you email me or comment back here with the QC# I will take a look and see if there is any workaround.

  21. Jason | July 4, 2005 at 6:28 am | Permalink

    Is there a D6 fix for the XML Data Binding Wizard?

    Or is the download available from

    http://cc.borland.com/Item.aspx?id=21989 backwards compatible with earlier version of Delphi (ie D6)?

    I am getting an ‘Undeclared Identifier’ compile time exception. It is happening on the following line

    FDependant := CreateCollection(TXMLC0002TypeList, Dependant, ‘C0002′) as DependantList;

    It complains about the "FDependant". I’ve looked in the code produced by the Binding Wizard, but there is no reference to "FDependant" anywhere??

    Please help!

    Thanks,

    Jason.

  22. Mark Edington | July 5, 2005 at 5:38 pm | Permalink

    Sorry there is no D6 version of the informal patch I put on Code Central. There were a number of bug fixes made between Delphi 6 and 7 which require too many dependencies to post on CC. The problem you are running into was fixed in D7.

  23. Edwin | July 15, 2005 at 4:46 am | Permalink

    I export a ClientDataSet with CDS.SAveToFile… in one computer it exports with ‘.’ as decimal separator, and in anothe with ‘,’ as decimal point… how can i fix that??? cos when reading the XML file between those computers, the decimal places come wrong…

  24. Angelo Colucci | September 28, 2005 at 3:15 am | Permalink

    I tried the updated wizard and there’s still a problem when importing a schema where an element has a maxOccurs attribute of more than one digit beginning with a 1, such as maxOccurs="15". The wizard reads it as maxOccurs="1" instead and won’t treat the element as a collection. A workaround is to change all maxOccurs="1nn" to maxOccurs="2".

  25. Laszlo Csaba | October 10, 2005 at 12:47 pm | Permalink

    Is there any XML Data Binding Wizard upgrade for C++Builder users? I seem to have a serious namespace problem. Maybe it was fixed in the past. I’d like to use the latest one.

  26. Mark Edington | October 10, 2005 at 7:56 pm | Permalink

    Sorry, I don’t have an update available for BCB 6.

  27. Laszlo Csaba | October 11, 2005 at 4:04 am | Permalink

    Well, that’s kind of sad. That product costs a fortune too! Anyway, my problem is that the XML file I have to process uses namespaces heavily. The wizard does not seem to be aware of namespaces. I had to add in the generated code the URI usage to the RegisterChildNode() call in the AfterConstruction() function and replace ChildNodes->Nodes[WideString("ANode")] with

    ChildNodes->FindNode(WideString("ANode"),WideString("AURI"))

    in the Get_ANode() method in order to get it work. Did I find the correct solution?

  28. Mark Edington | October 11, 2005 at 7:40 am | Permalink

    Yes. If the childnodes of the element are in a different namespace then you will need to specify the namespace as well.

  29. Jerry Keyes | November 8, 2005 at 1:27 pm | Permalink

    Does the XML Data Binding Wizard only come in Enterprise versions of Delphi? I own Delphi 2005 Pro and I don’t see the icon under the "New" tab. (fingers crossed)

  30. artur | August 2, 2006 at 5:48 am | Permalink

    cdcdcdcdc

  31. shahkhan | September 23, 2006 at 1:19 pm | Permalink

    i need this file for metacafe vedio download

  32. Iwan | December 7, 2006 at 3:47 am | Permalink

    Hi, i’ve just download your wizard fixed

    But, i still have the problem.

    My Problem is, i wish to consume a web service that made by VB.NET and use Type that refer to another location. The wizard still failed to import the type on other location. How to implement your fixed to my delphi? I’ve used D7 Update 1, Thx.

    Iwan

  33. Mark Edington | December 7, 2006 at 9:48 am | Permalink

    Iwan,

    This is probably a different issue than the ones addressed in the update. I would need to see the actual documents to tell you for sure.

    Mark

  34. Iwan Cahyadi Sugeng | December 7, 2006 at 7:27 pm | Permalink

    Thx for responding,

    If you could, please see the document at:

    http://develop.4lyfe.com:8080/SiskaWS/

    AttendanceService?wsdl

    Thank you in advance

    Iwan

  35. Hubai Zoltan | December 8, 2006 at 4:26 am | Permalink

    Hi

    Any chance that this will be maybe fixed in upcoming delphi version?

    http://qc.borland.com/wc/qcmain.aspx?d=14024

    I just tryed to import the .xsd in Delphi 2006 and still the same issues with duplicate names as it was with Delphi 7.

    Best regards

    Zoltan Hubai

  36. Bill Bartmann | September 1, 2009 at 12:50 pm | Permalink

    Excellent site, keep up the good work

Post a Comment

Your email is never published nor shared. Required fields are marked *

Bad Behavior has blocked 87 access attempts in the last 7 days.

Close