Click to return to the DHTML, HTML     
XMLDocument Property     y Property     DHTML Properties    
Web Workshop  |  DHTML, HTML & CSS

XMLNS Attribute


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 Non-MS link. 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>
This feature requires Internet Explorer 5 or later. Click the icon below to install the latest version. Then reload this page to view the sample.
Microsoft Internet Explorer

Applies To

[ Object Name ]
PlatformVersion
Win16:
Win32:
Mac:
Unix:
WinCE:
HTML

See Also

XML Namespaces Spec Non-MS link



Back to topBack to top

Did you find this topic useful? Suggestions for other topics? Write us!

© 1999 Microsoft Corporation. All rights reserved. Terms of use.