Access to a file is denied

G

Guest

Hi,
I am trying to create an html based on two main objevts: XslTransform and
XmdTextWrite via asp.net2003 application.
I keep getting a strange msg: "Access to the path... is denied".

Here is my method:
-----------------------
XmlDataDocument xmlDoc=

new XmlDataDocument();
xmlDoc.DataSet.ReadXml(Server.MapPath("test.xml"));

XslTransform tran=

new XslTransform();
tran.Load(Server.MapPath("test.xsl"));

XmlTextWriter w=new
XmlTextWriter(Server.MapPath("test.html"),System.Text.Encoding.UTF8);
tran.Transform(xmlDoc,

null,w);
w.Close();
 
M

Michael Nemtsev

Hello Nimrod,

exception on Server.MapPath("test.xml") or on ReadXml?
Seems that user has no rights to read file

---
WBR, Michael Nemtsev [.NET/C# MVP].
My blog: http://spaces.live.com/laflour
Team blog: http://devkids.blogspot.com/

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo

NN> Hi,
NN> I am trying to create an html based on two main objevts:
NN> XslTransform and
NN> XmdTextWrite via asp.net2003 application.
NN> I keep getting a strange msg: "Access to the path... is denied".
NN> Here is my method:
NN> -----------------------
NN> XmlDataDocument xmlDoc=
NN> new XmlDataDocument();
NN> xmlDoc.DataSet.ReadXml(Server.MapPath("test.xml"));
NN>
NN> XslTransform tran=
NN>
NN> new XslTransform(); tran.Load(Server.MapPath("test.xsl"));
NN>
NN> XmlTextWriter w=new
NN> XmlTextWriter(Server.MapPath("test.html"),System.Text.Encoding.UTF8)
NN> ; tran.Transform(xmlDoc,
NN>
NN> null,w); w.Close();
NN>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top