when playing with my project i need to debug it, and i like the system of jsFiddle, so i’m developing on it directly
Problem is I have XML with Element named link which is completely different from HTML’s link
When I try to parse it via javascript, it tells me that link doesn’t have any childnodes because of HTML DTD used (no matter which i select)
I tried adding
<?xml version="1.0"?> <!DOCTYPE rootElement [ .. dtd declarations.. ]>
to top of code, but this won’t help
Is it possible to use jsFiddle with own DTD or not? if it is, how can i achieve this?
Thanks
code sample
<wrap>
<link attribute=value>
<child_node></child_node>
</link>
</wrap>
when I use
var wrap = document.getElementsByTagName("wrap");
wrap = wrap[0];
var lnk = wrap.getElementsByTagName("link");
lnk = lnk[0];
document.write(lnk.getElementsByTagName("child_node"));
where wrap and link are objects of HTMLElement
it will show empty array
but those childs are accessible through childNodes property
You would have to check if dtd accepts secondary declarations, in my opinion it would parse the page the way you put it, to show the exact results.