Declares a namespace for custom tags in an HTML document.
Syntax
HTML <HTML XMLNS:sNamespace ... > Script N/A
Possible Values
sNamespace String that specifies the namespace used as a prefix to custom tags, or the following value:
urn Uniform Resource Name (URN) that uniquely identifies the namespace. Expressions can be used in place of the preceding value(s), as of Microsoft® Internet Explorer 5. For more information, see Dynamic Properties.
Remarks
The syntax for XMLNS is based on the W3C XML Namespace Spec . Although the W3C draft allows you to declare namespaces on all tags, Internet Explorer supports namespace declaration only on the HTML tag.
You can declare multiple namespaces on the HTML tag, as the syntax below shows:
<HTML XMLNS:Prefix1 XMLNS:Prefix2="www.microsoft.com">
Example
This example shows how to declare a namespace when one of the default behaviors in Internet Explorer, clientCaps, is used as a custom tag in an HTML document. Note how you must add the declared namespace (in this case, MSIE) to the custom tag when it is defined.
This example also shows how the clientCaps behavior can be used to install the Internet Explorer Data Binding component, if the component does not already exist in the user's system.
Sample Code
<HTML XMLNS:MSIE> <HEAD> <STYLE> @media all { MSIE\:clientCaps {behavior:url(#default#clientcaps);} } </STYLE> <SCRIPT> function window.onload() { var bDataBindingAvailable = false; var sDataBindingVersion = ''; var sDataBindingID = "{333C7BC4-460F-11D0-BC04-0080C7055A83}"; bDataBindingAvailable = oClientCaps.isComponentInstalled(sDataBindingID,"clsid"); // if data binding is unavailable, install it if (!bDataBindingAvailable) { oClientCaps.addComponentRequest (sDataBindingID, "componentid"); bDataBindingAvailable = oClientCaps.doComponentRequest(); } : } </SCRIPT> </HEAD> <BODY BGCOLOR="#FFFFFF"> : <MSIE:CLIENTCAPS ID="oClientCaps" /> : </BODY>
Applies To
HTML
See Also