Skip to content Skip to sidebar Skip to footer

Do Browsers Support An Html Document With Markup That Uses Namespaces (see Code)?

It seems like it's possible to use namespaces in an HTML document. Although, I've never seen it done. If I used namespaces in my document would browsers render it correctly? Here

Solution 1:

Using XML mechanisms (like XML namespaces and prefixes and assuming that clients correctly process markup according to the XML processing model) is not a robust way to publish HTML. When publishing HTML, make sure you're doing it with what XML would call the "default namespace". You might get lucky that some browsers implement namespaces, or simply ignore prefixes, but I would recommend to not count on that. That's all different when you're just working in your own XML-based environment, where the two XML you're showing indeed are pretty much equivalent. But even then you should make sure that whatever leaves that environment matches the outside world's assumptions, such as HTML not using namespace prefixes at all.


Post a Comment for "Do Browsers Support An Html Document With Markup That Uses Namespaces (see Code)?"