Steps to Reproduce Behavior
The following example binds a table to an XML data island and dynamically adds a new element named "bio" to the data island through script. However, when the data binding agent first invokes the DSO, no "bio" nodes exist in the tree. Thus, the DSO does not know about the "bio" element, and the table is not updated even after you rebind it to the DSO.
<HTML>
<HEAD>
<TITLE>Run-time binding with XML data island</TITLE>
<script>
function bind1()
{
tbl1.dataSrc = "";
doc = xml1.XMLDocument;
curNode = doc.selectSingleNode("/composers/composer1");
txtNode = doc.createTextNode("French composer of piano music");
elem = doc.createElement("bio");
elem.appendChild(txtNode);
curNode.appendChild(elem);
// This shows that the data island has been updated with the
// new data.
alert(xml1.xml);
// The following line reloads the data from the XML data island
// into the DSO. Uncomment this line for the code to work properly.
// xml1.loadXML(xml1.xml);
tbl1.dataSrc = "#xml1";
}
</script>
</HEAD>
<BODY>
<XML ID="xml1">
<composers>
<composer1>
<firstname>Claude</firstname>
<lastname>Debussy</lastname>
<origin>France</origin>
</composer1>
</composers>
</XML>
<p>
<div style="font:10 pt Verdana">
The XML data island that is the datsrc of this table does not
have an element named "bio". Clicking Update dynamically adds that
element to the data island and rebinds the table:
</div>
</p>
<p>
<table id=tbl1 datasrc="#xml1" border=1>
<tr width="100%" style="background-color:'#ffe4b5'; font:'12pt Arial'">
<td width="20%">FirstName</td>
<td width="20%">LastName</td>
<td width="20%">Origin</td>
<td width="20%">Bio</td>
</tr>
<tr>
<td><span datafld="firstname"></td>
<td><span datafld="lastname"></td>
<td><span datafld="origin"></td>
<td><span datafld="bio"></td>
</tr>
</table>
</p>
<button onClick="bind1();" id=button1 name=button1>Update</button>
</BODY>
</HTML>