EN
Este conteúdo não está disponível em seu idioma, mas aqui está a versão em inglês.

xmlns attribute

Declares a namespace for custom tags in an HTML document.

Syntax

HTML
<element xmlns="" ... >
JavaScript

Property values

sNamespace

A string that specifies the namespace used as a prefix to custom tags, or specifies a URN that uniquely identifies the namespace.

Standards information

There are no standards that apply here.

Remarks

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


<html xmlns:Prefix1 xmlns:Prefix2="www.microsoft.com">

Examples

This example shows how to declare a namespace when one of the default behaviors in a Windows Store app using JavaScript, 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 a Windows Store app using JavaScript 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>
</head>
  <body style="background-color: #FFF">
     .
     .
     .
     <msie:clientcaps id="oClientCaps" />
     .
     .
     .
  </body>
  <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>
</html>

Requirements

Minimum supported client

Windows XP [desktop apps only]

Minimum supported server

Windows Server 2003 [desktop apps only]

See also

html

 

 

Mostrar:
© 2014 Microsoft