CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2011
    Posts
    0

    As a Database using XML

    You can use XML as a database. Its take less server load and use to easy.

    The HTML DOM
    <html>
    <body>
    <h1>W3Schools Internal Note</h1>
    <div>
    <b>To:</b> <span id="to"></span><br />
    <b>From:</b> <span id="from"></span><br />
    <b>Message:</b> <span id="message"></span>
    </div>

    <script type="text/javascript">
    if (window.XMLHttpRequest)
    {// code for IE7+, Firefox, Chrome, Opera, Safari
    xmlhttp=new XMLHttpRequest();
    }
    else
    {// code for IE6, IE5
    xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
    xmlhttp.open("GET","note.xml",false);
    xmlhttp.send();
    xmlDoc=xmlhttp.responseXML;

    document.getElementById("to").innerHTML=
    xmlDoc.getElementsByTagName("to")[0].childNodes[0].nodeValue;
    document.getElementById("from").innerHTML=
    xmlDoc.getElementsByTagName("from")[0].childNodes[0].nodeValue;
    document.getElementById("message").innerHTML=
    xmlDoc.getElementsByTagName("body")[0].childNodes[0].nodeValue;
    </script>

    </body>
    </html>


    sure shot share tips || stock tips free trial

  2. #2
    Join Date
    Aug 2008
    Posts
    902

    Re: As a Database using XML

    Thanks for the tip?

    But no, seriously, what is the point of this post?

    Its take less server load
    You have some empirical data to prove this?

    Your code example is AJAX, and I'd like to point out that JSON is a vastly superior format to XML for this sort of work.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured