473,382 Members | 1,407 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

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

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
1 1541
"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Irving Kimura | last post by:
At work I've been assigned the task of writing a brief (1-2 pages) report on the state-of-the-art of XML databases. The goal of this report is to inform a working group on possible choices for a...
0
by: Yasutaka Ito | last post by:
Hi folks! I have a DataSet, which I'm writing into XML using the DataSet.WriteXML() method. Now, I want to write the cell's data/text as CDATA, when it is written into an XML. For example, I...
3
by: Dan | last post by:
Is there a better way to include the XML declaration than the following? XmlDeclaration dec =m_XMLDocument.CreateXmlDeclaration("1.0",string.Empty, "yes");...
1
by: Damon Allison | last post by:
Hello, My program is being sent a large XML file, anywhere between 500k - 1MB. Of the entire file, I need to allow a user to view/edit approximately 5% of it. To make matters a bit more...
1
by: dpakpaul | last post by:
Hi, I have an XSD schema where I have attributes that are declared to contain non string values such as integers etc. Take for example, this declaration - <xs:attribute name="IsThisTrue"...
1
by: danpowley | last post by:
Hello I have a DataTable where one of the columns contains XML, when I add it to a DataSet and call WriteXML it automaticaly encodes the XML (e.g. < becomes &lt;) is there an easy way to prevent...
3
by: Abdessamad Belangour | last post by:
Hi all, I have developped an application that generate XML documents. At most time it works fine, but sometimes (when the size of data to export is big) i got the error message : << The...
3
by: R.A. | last post by:
Hi I have a web method that returns a string (which has an xml format). I get a dataset and I need to convert the table in the dataset to xml and then to send it as a string to the client. How...
12
by: jcrouse | last post by:
I am using the following code to write to an XML file myXmlTextWriter.Formatting = System.Xml.Formatting.Indente myXmlTextWriter.WriteStartElement("CPViewer"...
3
by: miller.paul.w | last post by:
I've searched the standard library docs, and, while there are a couple options for *reading* HTML from Python, I didn't notice any for *writing* it. Does anyone have any recommendations...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.