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

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Martin Beering

    #1

    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\www root\Kostenrech nung\myXML.xml"
    ......
    DS.WriteXml(xml file)


    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:\\In etpub\\wwwroot\ \Kostenrechnung \\myXML.xml");

    function loadXML(xmlFile )
    {
    xmlFile=""+xmlF ile;
    xmlPresented=fa lse;
    xmlDoc.async="f alse";
    xmlDoc.onreadys tatechange=veri fy;
    xmlDoc.load(xml File);
    xmlObj=xmlDoc.d ocumentElement;
    bAnzahl=xmlObj. childNodes.leng th; // 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


  • Dag Sunde

    #2
    Re: writing a xml-file with vb.net and opening it with javascript

    "Martin Beering" <mb@beering.com > wrote in message
    news:cq3msk$qor $04$1@news.t-online.com...[color=blue]
    > 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\www root\Kostenrech nung\myXML.xml"
    > .....
    > DS.WriteXml(xml file)
    >
    >
    > The I am trying to open the file with the following JavaScript-Code[/color]
    because[color=blue]
    > I would like to use the data with svg.
    >
    >
    > loadXML("C:\\In etpub\\wwwroot\ \Kostenrechnung \\myXML.xml");
    >
    > function loadXML(xmlFile )
    > {
    > xmlFile=""+xmlF ile;
    > xmlPresented=fa lse;
    > xmlDoc.async="f alse";
    > xmlDoc.onreadys tatechange=veri fy;
    > xmlDoc.load(xml File);
    > xmlObj=xmlDoc.d ocumentElement;
    > bAnzahl=xmlObj. childNodes.leng th; // 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[/color]
    fine[color=blue]
    >
    > loadXML("myXML. xml");
    >
    > Has anybody an idea what the prolbem is ?
    > I am thankful for any tip.
    >[/color]

    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\\w wwroot\\Kostenr echnung\\myXML. xml" is considered to be
    another
    "site", and cross-domain access is forbidden in JS.

    --
    Dag.



    Comment

    Working...