By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,700 Members | 1,434 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,700 IT Pros & Developers. It's quick & easy.

writing a xml-file with vb.net and opening it with javascript

P: n/a
hi to all,

I do have a really big problem. I am writing a xml-file
with the following vb.net.code
Dim xmlfile As String = "C:\Inetpub\wwwroot\Kostenrechnung\myXML.xml"
......
DS.WriteXml(xmlfile)
The I am trying to open the file with the following JavaScript-Code because
I would like to use the data with svg.
loadXML("C:\\Inetpub\\wwwroot\\Kostenrechnung\\myX ML.xml");

function loadXML(xmlFile)
{
xmlFile=""+xmlFile;
xmlPresented=false;
xmlDoc.async="false";
xmlDoc.onreadystatechange=verify;
xmlDoc.load(xmlFile);
xmlObj=xmlDoc.documentElement;
bAnzahl=xmlObj.childNodes.length; // Anzahl der Jahre / Balken
}

Unfortunally I am always getting the error-message: Error: access denied.

If I use the following code for opening the xml-file everything works fine

loadXML("myXML.xml");

Has anybody an idea what the prolbem is ?
I am thankful for any tip.

many thanks and greetings from bremen (germany)
Martin Beering
Jul 23 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
"Martin Beering" <mb@beering.com> wrote in message
news:cq*************@news.t-online.com...
hi to all,

I do have a really big problem. I am writing a xml-file
with the following vb.net.code
Dim xmlfile As String = "C:\Inetpub\wwwroot\Kostenrechnung\myXML.xml"
.....
DS.WriteXml(xmlfile)
The I am trying to open the file with the following JavaScript-Code because I would like to use the data with svg.
loadXML("C:\\Inetpub\\wwwroot\\Kostenrechnung\\myX ML.xml");

function loadXML(xmlFile)
{
xmlFile=""+xmlFile;
xmlPresented=false;
xmlDoc.async="false";
xmlDoc.onreadystatechange=verify;
xmlDoc.load(xmlFile);
xmlObj=xmlDoc.documentElement;
bAnzahl=xmlObj.childNodes.length; // Anzahl der Jahre / Balken
}

Unfortunally I am always getting the error-message: Error: access denied.

If I use the following code for opening the xml-file everything works fine
loadXML("myXML.xml");

Has anybody an idea what the prolbem is ?
I am thankful for any tip.


As a security measure, JavaScript does not let you access resources
from a different site than where your page originated.

function loadXML(xmlFile)

will load it from the "current directory relative to where the document
came from, and is considered the "same site".

"C:\\Inetpub\\wwwroot\\Kostenrechnung\\myXML.x ml" is considered to be
another
"site", and cross-domain access is forbidden in JS.

--
Dag.

Jul 23 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.