Articles → .NET → Bind XML and HTML

Bind XML and HTML

Software Requirement

Prerequisite knowledge

Creation of a new project

Picture showing an empty .net project

Click to Enlarge

Adding HTML and XML file in the project

Picture showing a HTML and xml file added in the project

Click to Enlarge

Adding code in XML file

<?xml version="1.0" encoding="utf-8" ?>

Adding code in HTML file

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">


	<xml id="Employees" src="Employees.xml" async="false" />
	<table datasrc="#Employees">
			<td> <strong>Name</strong>: </td>
				<div datafld="EmployeeName" /> </td>
			<td> <strong>Mail</strong>: </td>
				<div datafld="EmployeeAddress" /> </td>


Picture showing the mapping of XML and HTML elements

Click to Enlarge


Picture showing the output of binding XML with HTML

Click to Enlarge

Posted By  -  Karan Gupta
Posted On  -  Thursday, July 26, 2012


Your Email Id  
Query/FeedbackCharacters remaining 250