Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XML
|
XML General XML discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XML section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 2nd, 2007, 01:23 AM
Registered User
 
Join Date: Jan 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default how to send xml file from server to client

On click of a button my page(Firstpage.aspx) calls the server side C# code and the Dataset writes the data from Database to a xml file

ds.WriteXml(Server.MapPath("dsXML.xml"));

I want to pass this dsXML.xml file to my Client system so that I can manipulate the data at my Client Side Javascript code.
 
Old January 27th, 2007, 09:22 AM
Authorized User
 
Join Date: Dec 2006
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,
You need not do it at all. You can read your XML in javascrip by simple.
                   var xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
                   loadXML('XMLFiles/dsXML.xml');
                   function loadXML(xmlFile)
            {
            xmlDoc.async="false";
            xmlDoc.onreadystatechange=verify;
            xmlDoc.load(xmlFile);
            xmlObj=xmlDoc.documentElement;
            }
Now your XML file is in xmlObj. You can work with it.

Dharmendra







Similar Threads
Thread Thread Starter Forum Replies Last Post
Send file from Servlet to Client End (Swing) nigam.anand Servlets 0 April 22nd, 2006 02:22 AM
xml file in client memory Sakubar Sathik XML 0 April 6th, 2006 04:04 AM
how to send an XML document to a server? limrick XML 0 April 29th, 2005 06:39 AM
writing to an xml file on the client side Toran XML 2 April 2nd, 2005 03:51 PM
how to send image from client to server alyeng2000 Classic ASP Basics 4 October 27th, 2003 08:10 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.