www.fgks.org   »   [go: up one dir, main page]

Click to Rate and Give Feedback
Properties
 XMLNS Attribute
XMLNS Attribute

Declares a namespace for custom tags in an HTML document.

Syntax

HTML <HTML XMLNS:sNamespace ... >
ScriptingN/A

Possible Values

sNamespaceA string that specifies the namespace used as a prefix to custom tags, or specifies a Uniform Resource Name (URN) that uniquely identifies the namespace.

Remarks

The syntax for XMLNS is based on the W3C XML Namespace Spec World Wide Web link. Although the World Wide Web Consortium (W3C) document allows you to declare namespaces on all tags, Microsoft Internet Explorer 5 supports namespace declaration only on the html tag.

You can declare multiple namespaces on the html tag, as shown in the following syntax.

<HTML XMLNS:Prefix1 XMLNS:Prefix2="www.microsoft.com">

Example

This example shows how to declare a namespace when one of the default behaviors in Windows Internet Explorer, clientCaps, is used as a custom tag in an HTML document. Note that the declared namespace (in this case, MSIE) is a prefix to the name of the default behavior in the custom tag. 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.

<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 Microsoft® Internet Explorer 5 or later. Click the following icon to install the latest version. Then reload this page to view the sample.

Standards Information

There is no public standard that applies to this attribute.

Applies To

HTML
Tags What's this?: Add a tag
Community Content
 
Add Community Content
© 2008 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker
DCSIMG