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

Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript 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: 41574
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

Joined: Mar 22, 2000
Posts: 12769
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: 18541

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