0

I have 2 files in my D:\HTML folder. Those are data.xml and home.html. I found data Biding is not working it only displays the "Name" in the web browser.

I was expecting "Name" should be displayed and all the 3 user ids below it. D

<? xml version="1.0" encoding="utf-8" ?>
<Mails>
    <Mail>
        <UserID>a@gmail.com</UserID>
        <UserName>User 1</UserName>
    </Mail>
    <Mail>
        <UserID>b@gmail.com</UserID>
        <UserName>User 2</UserName>
    </Mail>
    <Mail>
        <UserID>c@gmail.com</UserID>
        <UserName>User 3</UserName>
    </Mail>
</Mails>



<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <title>User Names and Ids</title>
 </head>

 <body>
    <xml id="Mails" src="data.xml" />
  <table datasrc="#Mails">
    <tr>
        <td><strong>Name</strong>:</td>
        <td><div datafld="UserID" /></td>
    </tr>

  </table>
 </body>
</html>
Dominik
  • 6,078
  • 8
  • 37
  • 61
NNikN
  • 3,720
  • 6
  • 44
  • 86
  • 1
    This is Internet Explorer specific and is an outdated technique. Try using JS to parse the xml instead: http://stackoverflow.com/a/8412989/2287470 – Joe Jul 30 '13 at 16:44
  • Okie, I will use jsp, but can you please tell me if i have made a mistake in my current code. – NNikN Jul 30 '13 at 17:02
  • Your current code looks ok, it's just a lack of browser support that prevents it from working. – Joe Jul 30 '13 at 17:03
  • What @Joe said. Also, you can't use element minimization in HTML. – Mr Lister Jul 31 '13 at 07:33
  • By the way, I'm not sure how it's supposed to work in IE. Are you sure it should output all three fields from the xml? I expected to see only one, but it displays nothing on my computer, only the "Name:". – Mr Lister Jul 31 '13 at 07:36
  • @MrLister it should display "Name" and all the 3 user ids below it. – NNikN Jul 31 '13 at 11:21

0 Answers0