Quantcast

data island and empty tags

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

data island and empty tags

broman-2
Hi,
I have question about embedded XML data in HTML and difference between
results.
Test code:

<!doctype html>
<html>
<head>
<meta http-equiv="content-type" content="text/html;
charset=UTF-8">
<script>
function dataisland() {
    var xml = document.getElementById( "xml_site" );
    alert (xml.innerHTML);
}
</script>
</head>
<body onload="dataisland();">
<p>page for data island tests</p>
<xml id="xml_site">
<sites path="test" open="1"><site access="true" id="123" ></site></
sites></xml>
<div class="footer">fotter of this page</div>
</body>
</html>

From this code I get:
<sites path="test" open="1"><site access="true" id="123"></site></
sites>
<div class="footer">footer of this page</div>

And I think that this result is incorrect

Bu when I change empty XML tag to
<site access="true" id="123"></site>

I get something that I expect:
<sites path="test" open="1"><site access="true" id="123"></site></
sites>

Is it correct behavior of Firefox? I there any way to get "correct"
result without changing XML empty tags?
Thanks,
Bartek
_______________________________________________
dev-tech-xml mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xml
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: data island and empty tags

Boris Zbarsky
On 2/23/10 1:49 PM, broman wrote:
> Is it correct behavior of Firefox?

Yes.

> I there any way to get "correct" result without changing XML empty tags?

Serve your content up with an XML MIME type, so it will be parsed with
an XML parser.

-Boris
_______________________________________________
dev-tech-xml mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xml
Loading...