Michael Hill
Usenet Archive
- Joined
- Mar 4, 2003
- Messages
- 141
- Reaction score
- 0
I was wondering if it is possible to include a xml structure in your html document.
For example given the below snippet the function "dothis" will return 0 and "dothat" will return 1.
If I can use xml in html I should be returning 1 for both functions.
Thanks,
Mike
<script>
function dothis
{
var xxx = document.getElementById('xmlid');
alert(xxx.childNodes.length);
}
function dothat
{
var xxx = document.getElementById('tblid');
alert(xxx.childNodes.length);
}
</script>
<xml id="xmlid">
<data>
<first>abc</first>
</data>
</xml>
<table id="tblid">
<tr>
<td>abc</td>
</tr>
</table>
For example given the below snippet the function "dothis" will return 0 and "dothat" will return 1.
If I can use xml in html I should be returning 1 for both functions.
Thanks,
Mike
<script>
function dothis
{
var xxx = document.getElementById('xmlid');
alert(xxx.childNodes.length);
}
function dothat
{
var xxx = document.getElementById('tblid');
alert(xxx.childNodes.length);
}
</script>
<xml id="xmlid">
<data>
<first>abc</first>
</data>
</xml>
<table id="tblid">
<tr>
<td>abc</td>
</tr>
</table>