简体   繁体   中英

XML data source object (dso) has type HTMLUnknownElement and data binding does not happen and recordset is undefined

​My question is about using the old data island with Microsoft Edge. In 2019 I could use the data island feature on the edge browser. I was interrupted with that work until June 2022 when I turned on my laptop again and I updated the windows 10. Now the data island does not work on the edge or the ie browsers. So I imagine there had to be a significant update to the windows 10 itself when my code dos not work even with internet explorer and the meta tag on my page toemulateIE7.

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 including the recordset. 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 in Microsoft edge browser 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 and with ie11. 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>

content="IE=EmulateIE7" only works with IE browser. It doesn't work in Edge. You can check this doc :

This functionality will not be implemented in any version of Microsoft Edge.

I think you have two choice if you want to use Edge:

  1. Use some replacement solutions of data island. You can refer to this thread to see if the solutions fit you.
  2. You can load the site in Edge IE mode so that it can use content="IE=EmulateIE7" (IE mode needs to be configured in client side). You can refer to this doc for more information about Edge IE mode.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM