aspose file tools*
The moose likes XML and Related Technologies and the fly likes Populating xml from file system Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Populating xml from file system" Watch "Populating xml from file system" New topic
Author

Populating xml from file system

Raj Kumar Bindal
Ranch Hand

Joined: Apr 15, 2006
Posts: 418
I am trying to construct an xml with file system.That is i have c:/temp and temp contains directories,subdirectories and files. I am trying to construct xml representing this file system using DocumentBuilderFactory, but facing some issues in this. Can anyone tell me, how can i do that.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42608
    
  65
How are you going about it? What issues are you facing? TellTheDetails


Ping & DNS - my free Android networking tools app
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12823
    
    5
I would start by creating one or more example XML documents with a text editor so you can work out all the element names and hierarchical organization.

Once you have the hierarchy worked out, the major logic flow of the program should become apparent.

Bill
Raj Kumar Bindal
Ranch Hand

Joined: Apr 15, 2006
Posts: 418
I am able to read a directory recursively but not able to construct xml corresponding to that.
code to recursively traverse a directory :


Please help to construct xml of same structure as a directory. >
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18902
    
    8

You don't have any code at all which is producing XML there. So it's pretty hard to fix what you have so far. And we don't want to do your work for you.

Why not start by explaining which methods you want to use to produce XML. Do you want to produce a DOM? Do you want to produce a string containing XML? Or what?
 
Don't get me started about those stupid light bulbs.
 
subject: Populating xml from file system