<products> <product> <productid>101</productid> <desc>TV</desc> </product> <product> <productid>102</productid> <desc>LAPTOP</desc> </product> <product> <productid>103</productid> <desc>MOBILE</descc> </product> <productid>104</productid> <desc>WASHING MACHINE</descc> <productid>105</productid> <desc>OTHER GADGETS</descc> </product> </product> </products>
<html ><head> <title>Untitled Page</title> //using javascipt<script language ="javascript" > //using fuction to move to first recordfunction f1(){p.recordset.MoveFirst()}//using unction to move to next & also checks whether if it is lastfunction f2(){p.recordset.MoveNext()if(p.recordset.eof){p.recordset.MoveLast()alert ("LAST RECORD")}}</script></head><body>//creating xml tag to activate xmlparser<xml id="p" src="C:\Documents and Settings\house\Desktop\product.xml"> </xml> <form name="f1" >//designing user interface and binding with data of xmlproduct id:<input type="text" name="t1" datasrc="#p" datafld="productid" /><br />product description:<input type="text" name="t1" datasrc="#p" datafld="desc" /><br />//calling of functions(java)<input type ="button" name ="b1" value ="FIRST" onClick ="f1()" /><input type ="button" name ="b2" value ="NEXT" onclick ="f2()" /> </form></body></html>
<html> <body><xml id="p" src="C:\Documents and Settings\house\Desktop\product.xml"></xml><table datasrc="#p" align="center" border="4"><tr><td>prodid</td><td>desc</td></tr><tr><td><span datafld="productid"></td><td><span datafld="desc"></td></tr></table></body></html>