xmlns
HTML attributeThe xmlns
attribute sets the default namespace
URI
for the current element and any of its descendants.
<special xmlns="http://ExampleOnly.com/namespace/">
<p xmlns="http://www.w3.org/1999/xhtml">This paragraph is truly HTML, but its parent is "special".
</p>
</special>
Although it may be coded at any level, it typically appears only on the top-level
html
element. The value of the xmlns
attribute for HTML tags is http://www.w3.org/1999/xhtml
the same as for the 2000 W3C standard HTML.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
...
</html>
Using xmlns
as a prefix associates a namespace URI with the user-specified namespace prefix following the xmlns:
part of the attribute name.
<special xmlns="http://ExampleOnly.com/namespace/" xmlns:html="http://www.w3.org/1999/xhtml">
<html:p>This paragraph is truly HTML, but its parent is "special".
</html:p>
</special>
You typically would only see something like this when HTML is aggregated with non-HTML content with element names from a different namespace.
Home > XML Attributes > xmlns
Viewing mobile website page. Switch to WML or Full HTML