Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Register Tags Active Topics RSS Search Mark Forums Read

Sponsored Links



Reading XML file with ASP

Software Development


Reply
 
Thread Tools Search this Thread
  #1  
Old 10-03-2010
Member
 
Join Date: Jan 2009
Posts: 57
Reading XML file with ASP
  

Hello, I am working on the Asp.net. And now I want to know the details from which I will able to get to know program for Reading XML file with ASP. If you are having any kind of information from which I can able to get the solution then please provide that to me. I will be thankful to you.

Reply With Quote
  #2  
Old 10-03-2010
Member
 
Join Date: Apr 2008
Posts: 1,948
Re: Reading XML file with ASP

Hello, I have the code below which will be helpful to you for getting the details about the reading xml file with asp:
Code:
<%
Option Explicit
Response.Buffer = True
Dim xml
	Set xml = Server.CreateObject("Microsoft.XMLDOM")
	xml.async = False
	xml.load (Server.MapPath("page.xml"))

Dim name, subname, data, check
	name = xml.documentElement.childNodes(0).text
	subname = xml.documentElement.childNodes(1).text
	data = xml.documentElement.childNodes(2).text
	check = xml.documentElement.childNodes(3).text

	Set xml = Nothing
%>
<html>
<head>
	<name><%= name %></name>
</head>
<body>
<h3 align="center"><%= subname %></h3>
<p align="center"><% = data %></p>
<div align="center"><%= check %></div>
</body>
</html>
Reply With Quote
  #3  
Old 10-03-2010
Member
 
Join Date: Apr 2008
Posts: 2,000
Re: Reading XML file with ASP

Hello, you want solution for the reading xml file with the help of the asp then it is quiet simple thing. You just need to make use of the Reading an XML file in ASP is very simple if you are using the xmldom object. For that you just need to create an xmldom object and that object need to be load the xml file that you want to read. And if you wan to load the xml file then it is necessary to to make use of the Load method which is present into the xmldoc object.
Reply With Quote
  #4  
Old 10-03-2010
Member
 
Join Date: May 2008
Posts: 2,007
Re: Reading XML file with ASP

Reading the Contents of XML File using XmlDocument class from the code below:

Code:
XmlDocument xmldoc = new XmlDocument();
xmldoc.Load(Server.MapPath("test.xml"));
System.Xml namespace is having the class which is having name as XmlDocument. You can simply use this class for getting the read functionality for the xml files content. So, just make use of the code below and get your problem solved.
Reply With Quote
  #5  
Old 10-03-2010
Member
 
Join Date: Oct 2005
Posts: 2,389
Re: Reading XML file with ASP

For reading the xml file from the asp you must need to use the following steps:
  • First of all you need to create a class of the XMLDOM object with the help of ASP file to load the XML data. For that you can simply make use of the code below:
    Code:
    XMLDom obj;
  • Now you need to load that xml file into the DOM object with the help of the readXML method. For that you just need to use the code below:
    Code:
    obj.readXML("xmltest.xml");
  • Now you need to use the documentElement.childNodes(n) for getting the value of the xml file elements.
  • Display or manipulate the XML data for that by using the file from the class parameter in the asp page. In this the xml file value can be directly assigned to the field value of the same type.
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Reading XML file with ASP"
Thread Thread Starter Forum Replies Last Post
Reading some file using C language Vaikuntam Software Development 9 01-09-2012 03:13 PM
Pdf file reading in Micromax Q7 rashed823 Portable Devices 4 07-03-2011 12:33 AM
Need some help reading part of a log file... agangsto Operating Systems 2 09-07-2010 01:44 PM
Reading a file in loop Xmen Software Development 5 09-01-2010 02:23 PM
Reading file bit by bit John Wilson Software Development 4 14-12-2009 01:49 PM


All times are GMT +5.5. The time now is 03:22 PM.