471,348 Members | 1,293 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,348 software developers and data experts.

XML building basing on Directory list

Hi
I would like to ask a question. I have a method that adds nodes basing on
ArrayList ( contains path to file ) as follows.
DIR1
subDIR1
subDIR2
..
..
FILE

I'am building the nodes in the following way.
foreach (object var in mList)

{

w.WriteStartElement(var.ToString());

}

for (int i = 0; i < mList.Count; i++)

{

w.WriteEndElement();

}

But when i enter method again ( it's called for every file ) i have another
ArrayList similar to previous but with the different file ( in the same
directory )

And the question is:
How to add the node ( the file in the same directory and subdirectories )?

When i do this using presented method i got duplicated nods with the outer
directories:
for example.

<DIR1>
<file>
</DIR1>

<DIR1>
<file2>
</DIR1>

Thanks
PK



--

Pozdrawiam
Piotr Kolodziej
http://piotrkolodziej.waikru.info
Feb 11 '06 #1
0 883

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Kylotan | last post: by
reply views Thread by Rob Dijkshoorn | last post: by
1 post views Thread by Player | last post: by
1 post views Thread by Ronak mishra | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.