Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Get XML structure

Status
Not open for further replies.

Tilen

Programmer
Apr 2, 2005
75
SI
Hi

I'm new to XML.

I have a number of different XML files, no DTDs or any other files, just XMLs.

I need to parse them and before I do that, I need to have a complete view of structure of elemenst/objects and sub-elements/sub-objects...

So I need a list of all elements and their attributes and which subelements they have and their attributes and their subelements and so on.

The reason for this is, so I can prepare Delphi record types for each object, to be able to read XML into them and then process the data.

Anyone can point to a tool that can do this or any other way?

Thank you

Tilen
 
Most XML tools will do something like this. Stylus Studio and Altova XMLSpy are two such tools, available for free trial download from their publishers.

Tom Morrison
 
If the source file is yours and stored in your file system that you have read-write rights, then you can add a processing instruction to the xml source file under the prolog.
[tt] <?xml-stylesheet href="tree-view.xsl" type="text/xsl"?>[/tt]
and download the tree-view.xsl and tree-view.css (originally written by Mike J. Brown and Jeni Tennison) here.
This is an approach not tie to any ide. Everybody can write their own.
 
Hi

thanx for the suggestions, k5tm. I tried Stylus Studio and Altova XMLSpy but I couldn't get the tree to be displayed in a 'distinct and structural way'.

I started writing my own code for one of the XML parsers, and it seems quite easy to do this. Well, a couple of days will go by, but that's not too bad.

I'll have a look at your suggestion, tsuji.

Thank you

Tilen
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top