XML data source object has type HTMLUnknownElemnt in JavaScript, no recordset is defined

This question is about using the old data island with Microsoft Edge. To simplify my question, I found the following simple HTML example for binding XML data to a table from a Microsoft page with this link:

https://docs.microsoft.com/en-us/previous-versions/windows/desktop/ms762701(v=vs.85).

I also added the meta tag in the head section of the HTML for emulating the IE7. However, the data binding does not work and the table fields are not populated by the XML data. As far as I can understand, Microsoft expects the following xml binding code to work correctly.

When I use javascript to check the type of the xmlMeetings that is the ID for the XML data source (dso), the type is shown as Object HTMLUnknowElement. But I expected the object to be known and to have all the methods and properties. My intention is to eventually access the recordset but of course the recordset is undefined for the HTMLUnknowElement that is the dso or xmlMeetings.

According to the Microsoft, the IE=EmulateIE7 in the meta tag emulates Internet Explorer 7 when a doctype with right declaration is used. In the past I did not have a problem with binding the xml data to a table even though I did not pay attention to the correct declaration of the doctype.

Could anyone tell me:

1- why dso data binding to the table is not happening? If the data binding happens, then I expect to have also access to the recordset.

2- What is the correct declaration of the doctype for this HTML page?

Thank you for your help.

I saved the following code in testXML.html file and loaded the page with Microsoft edge browser. No data binding with the table happens.

<HTML><HEAD>
    <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />

    <script type=’text/javascript’>
	    alert(‘typeof()=’ + typeof(document.getElementById(‘xmlMeetings’))
    </script>
    </HEAD><TITLE></TITLE>
    <BODY>
    <XML ID="xmlMeetings">
    <?xml version="1.0" ?>
    <meetings>
    <meeting>
    <date>1/1/99</date>
    <time>9:00</time>
    <location>104</location>
    </meeting>
    <meeting>
    <date>2/1/99</date>
    <time>13:00</time>
    <location>34</location>
    </meeting>
    <meeting>
    <date>3/1/99</date>
    <time>14:30</time>
    <location>20</location>
    </meeting>
    </meetings>
    </XML>

    <table style='border:1px solid red' datasrc="#xmlMeetings">
    <tr>
    <td><div datafld="date"></div></td>
    <td><div datafld="time"></div></td>
    <td><div datafld="location"></div></td>
    </tr>
    </table>

    </BODY>
    </HTML>

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.