Xml table

Hi,

I've got a XML table. It has the structure I want for my project, but I can't see it. I want to view the fields, size, type, indexes,... Is it possible in Delphi? If I put this table in Delphi, it knows the fields names. If it finds it's names then they're identified. How?
Is there any way to convert it to Paradox?
Thanks,
Luis
lfgmartinsAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Wim ten BrinkSelf-employed developerCommented:
Let me guess. You've used the XML Data Binding wizard to generate some Delphi source to access your XML data? Okay, first a warning then. The XML Data Binding wizard has a few flaws. It doesn't handle datetime types correctly (dates or times are okay), it writes booleans in the wrong way (xml is case-sensitive so true and True are not the same) and Delphi doesn't write sequences in the correct order. So I'm not too happy about this wizard...

A better option is the XML Mapping Tool. You open the XML file using this tool, select the field that you need as a record-structure, then generate a data package. This will create a transformation file that you can use to transform the XML data to an XML datapacket. This Datapacket can then be used with the ClientDataset to be used as a dataset in your application.
Unfortunately Delphi isn't perfect here either. The transformation file that Delphi generates generates &lt; and &gt; tags in the transformation output instead of < and > when you use the transformation outside Delphi. Quite annoying...

However, the TXMLDocument is reasonable reliable. and if you know about Delphi's weaknesses with XML you can easily get around them.
-------------------------------------------------------------------
Now, about viewing the XML data... Unfortunately Delphi doesn't have any XML-related visual components. You either have to write your own code to display the data (virtual listviews and treeviews are very usable) or find some 3rd-party components. With Octane (D8) then it will be easier since then you'll be using .NET to work with xml, which is a bit more reliable.
-------------------------------------------------------------------
Converting an xml table to Paradox is possible but it depends a bit on the structure of your xml file. A simple structured XML file can easily be converted by walking through it and inserting records as you go. If the xml structure has multiple layers then you have to generate master-detail relations to generate multiple tables. I have been using xml files that would convert to a dozen or so different paradox tables if I would ever convert them, so I prefer to keep them as xml.
-------------------------------------------------------------------
if you have a table that is converted to xml then you can open it with the TClientDataset or the TADODataset. It depends on which tool generated the XML table. Be aware that an XML doesn't contain information about it's own structure but could contain a link to an xml schema. This schema describes all elements and attributes and all rules that apply to it.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Languages and Standards

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.