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
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.
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
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.
This style seems a bit messed up in FireFox.
Hi Mark,
Would be nice if the fix was compiled for Delphi6 as well. We D6 customers are not dead, you know…
Andrew
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
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).
that is a nice file.
Is there a way to invoke the xml databinding like a commnad line tool to automate de delphi interface creation?
Best regards
ilde
Sorry, no. The only interface is through the IDE wizard.
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
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
Is there any update to this wizard?
The link to code central is apparently dead …
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
"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.
Any chance of a DotNet version for Delphi 2005?
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.
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.
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
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.
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.
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.
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…
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".
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.
Sorry, I don’t have an update available for BCB 6.
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?
Yes. If the childnodes of the element are in a different namespace then you will need to specify the namespace as well.
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)
cdcdcdcdc
i need this file for metacafe vedio download
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
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
Thx for responding,
If you could, please see the document at:
http://develop.4lyfe.com:8080/SiskaWS/
AttendanceService?wsdl
Thank you in advance
Iwan
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
Excellent site, keep up the good work
Post a Comment