I'm creating a recursive function that goes into a database and pulls
everything out as an XML file. I then want to save thisXML file on the
server.

I have this:

xmldoc.Save(Server.MapPath("siteMenu.xml"))

My SUB seems to execute fine. No errors. But I don't end up with a file,
either. How do I go about debugging this?

Re: How to debug a file not being written? (XML) by Richard

Richard
Sat Oct 16 14:12:22 CDT 2004

Maybe the file is being written somewhere other than where you think it is. Break the line into two statements:

string s = Server.MapPath("siteMenu.xml")
xmlDoc.Save(s)

Now you can check where s refers to

Regards

Richard Blewett - DevelopMentor
http://staff.develop.com/richardb/weblog

I'm creating a recursive function that goes into a database and pulls
everything out as an XML file. I then want to save thisXML file on the
server.

I have this:

xmldoc.Save(Server.MapPath("siteMenu.xml"))

My SUB seems to execute fine. No errors. But I don't end up with a file,
either. How do I go about debugging this?


Re: How to debug a file not being written? (XML) by Darrel

Darrel
Sat Oct 16 15:15:26 CDT 2004

> Maybe the file is being written somewhere other than where you think it
> is. Break the line into two statements:

Ugh. My fault. It was throwing an error, I just wasn't catching it properly.

So, and this may be a dumb question, how do I get a more detailed error from
my catch statement?

Here's the line that is throwing the error:

eleMenuItems = xmldoc.CreateElement("menuItems")
xmldoc.DocumentElement.PrependChild(eleMenuItems)

It's the second line that is causing the problem.

-Darrel