This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
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

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Populating xml from file system" Watch "Populating xml from file system" New topic

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

Joined: Mar 22, 2005
Posts: 42965
How are you going about it? What issues are you facing? TellTheDetails
William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 13037
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.

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

Joined: Oct 14, 2005
Posts: 19973

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?
It is sorta covered in the JavaRanch Style Guide.
subject: Populating xml from file system
It's not a secret anymore!