I have a problem using the XMLDOM throught data islands. On some machine it works fine but on other I get an error when trying to access a node using XMLDOM on data islands. Further more the datafld and datasrc HTML properties doesn't display the node value as expected.It seems that when I remove the XML document declaration on the computers where this code sample currently not working , this sample work much better and the node value is displayed on the HTML page.
Has shown in many sample over the web the xml document declaration should not been removed and should not disturb the xml parser.
Here is the code sample:
<HTML>
<HEAD>
<script language="javascript">
function window.onload
{
var msxml=new ActiveXObject("MSXML2.DOMDocument.3.0");
msxml.loadXML("<User><ID>ERV</ID></User>");
var xn=msxml.selectSingleNode("User/ID");
alert("msxml3 instance : "+xn.text);
try
{
var t=oper.XMLDocument.selectSingleNode("User/ID");
alert("DataIsland : "+(t==null)+" "+t.xml);//.text);
}
catch(e)
{
alert(e.description);
}
}
</script>
</HEAD>
<BODY>
<XML id="oper" async="true"><?xml version="1.0"
encoding="utf-8"?><User><ID>ERV</ID></User></XML>
<span datasrc="#oper" datafld="ID"></span>
</BODY>
</HTML>
did someone already encounter such a problem?
Is there something to do with missing components, or xml parser bad version?
I have searching for information for a few days now and I didn't find something relevant corresponding to my problem. If someone could help me to solve this problem It would be very kind.
Eric
Has shown in many sample over the web the xml document declaration should not been removed and should not disturb the xml parser.
Here is the code sample:
<HTML>
<HEAD>
<script language="javascript">
function window.onload
{
var msxml=new ActiveXObject("MSXML2.DOMDocument.3.0");
msxml.loadXML("<User><ID>ERV</ID></User>");
var xn=msxml.selectSingleNode("User/ID");
alert("msxml3 instance : "+xn.text);
try
{
var t=oper.XMLDocument.selectSingleNode("User/ID");
alert("DataIsland : "+(t==null)+" "+t.xml);//.text);
}
catch(e)
{
alert(e.description);
}
}
</script>
</HEAD>
<BODY>
<XML id="oper" async="true"><?xml version="1.0"
encoding="utf-8"?><User><ID>ERV</ID></User></XML>
<span datasrc="#oper" datafld="ID"></span>
</BODY>
</HTML>
did someone already encounter such a problem?
Is there something to do with missing components, or xml parser bad version?
I have searching for information for a few days now and I didn't find something relevant corresponding to my problem. If someone could help me to solve this problem It would be very kind.
Eric