<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="/styles/XMLStylesDoc_xhtml10_en.xsl"?><!DOCTYPE document SYSTEM "/schemas/XMLStyles10.dtd">
<document xmlns="http://XMLStyles.com/namespaces/styles" xmlns:xst="http://XMLStyles.com/namespaces/styles" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:date="http://exslt.org/dates-and-times">
   <noxml>
      <p xmlns="http://www.w3.org/1999/xhtml"/>
      <!-- You are viewing the source.  The following message should be ignored if you did "View Source" in your browser. -->
      <p xmlns="http://www.w3.org/1999/xhtml">
ATTENTION: XML WEB PAGES NOT SUPPORTED
   If you see this message, your current browser does not support the
   1999 XSLT 1.0 (or later) standard for XML web pages such as this one.
   Please upgrade your browser to a newer version
   that supports 1999 or later standards such as:
      Mozilla Firefox version 1.0.2 or later (GetFirefox -&gt; http://www.GetFirefox.com/)
      Netscape version 8 or later
      Safari version 1.3 or later
      Opera version 9 or later
      Microsoft Internet Explorer (MSIE) version 5 or later
   For further assistance, contact the software vendor for your browser.
   To go to the X<!-- extended HTML -->HTML version of this page click the following link:
<a href="index.html">index.html</a>
      </p>
      <p xmlns="http://www.w3.org/1999/xhtml">&#160;</p>
   </noxml>
   <path>/attributes/</path>
   <site>HTML 5 Reference</site>
   <logo xlink:type="simple" xlink:href="/images/html-5.jpg" media="screen" width="156" height="27">HTML 5 Reference</logo>
   <logo xlink:type="simple" xlink:href="/images/html-5.jpg" media="print" width="156" height="27">HTML 5 Reference</logo>
   <logo xlink:type="simple" xlink:href="/images/html-5.jpg" media="handheld" width="150" height="17">HTML 5 Reference</logo>
   <navigation where="sections">
      <label>HTML 5 Reference</label>
      <link xlink:type="simple" xlink:href="/index.xml">Home</link>
      <link xlink:type="simple" xlink:href="/tutorial/index.xml">Tutorial</link>
      <link xlink:type="simple" xlink:href="/tags/index.xml">HTML5 Tags</link>
      <link xlink:type="simple" xlink:href="/attributes/index.xml">Attributes</link>
      <link xlink:type="simple" xlink:href="/css-styles/index.xml">CSS Styles</link>
      <link xlink:type="simple" xlink:href="/metatags/index.xml">Metatags</link>
      <link xlink:type="simple" xlink:href="/cheat-sheet/index.xml">Cheat Sheet</link>
      <link xlink:type="simple" xlink:href="/examples/index.xml">Examples</link>
      <link xlink:type="simple" xlink:href="/definitions/index.xml">Definitions</link>
      <link xlink:type="simple" xlink:href="/diffs/index.xml">Differences</link>
      <link xlink:type="simple" xlink:href="/avoid/index.xml">Avoid</link>
      <link xlink:type="simple" xlink:href="/faqs/index.xml">HTML5 FAQs</link>
      <link xlink:type="simple" xlink:href="/prod/rssfeeds.cgi">RSS Feeds</link>
      <link xlink:type="simple" xlink:href="/prod/help/index.cgi">Help</link>
   </navigation>
   <navigation where="left">
      <label>HTML 5 Reference</label>
      <link xlink:type="simple" xlink:href="/tutorial/index.xml">HTML Tutorial</link>
      <link xlink:type="simple" xlink:href="/tags/index.xml">HTML 5 Tags</link>
      <link xlink:type="simple" xlink:href="/attributes/index.xml">HTML Attributes</link>
      <link xlink:type="simple" xlink:href="/css-styles/index.xml">CSS Styles</link>
      <link xlink:type="simple" xlink:href="/metatags/index.xml">HTML Metatags</link>
      <link xlink:type="simple" xlink:href="/cheat-sheet/index.xml">Cheat Sheet</link>
      <link xlink:type="simple" xlink:href="/examples/index.xml">HTML Examples</link>
      <link xlink:type="simple" xlink:href="/definitions/index.xml">Definitions</link>
      <link xlink:type="simple" xlink:href="/diffs/index.xml">HTML 5 Changes</link>
      <link xlink:type="simple" xlink:href="/avoid/index.xml">Things to Avoid</link>
      <link xlink:type="simple" xlink:href="/faqs/index.xml">HTML 5 FAQs</link>
      <link xlink:type="simple" xlink:href="/prod/help/index.cgi">Help</link>
      <link xlink:type="simple" xlink:href="/prod/help/index.cgi?p=about">About</link>
   </navigation>
   <section id="body" type="body">
      <pages name="index">
         <navigation where="pages">
            <label>index</label>
            <link xlink:type="simple" xlink:href="index.xml">HTML5 Attributes</link>
            <link xlink:type="simple" xlink:href="xml-attributes.xml">XML Attributes</link>
         </navigation>
         <page id="N104C7" name="xml-attributes">
            <label>XML Attributes</label>
            <title>XML Atttributes in HTML</title>
            <h2>XML Attributes in HTML</h2>
            <p>In general, namespaces are useful for aggregating together content
               from different sources.  The namespace that qualifies the element names
               avoids conflicts among the element names from different sources.
               The global attributes in the XML namespace may be useful when including content
               from other XML sources or when parsing HTML documents as general-purpose XML.
               The <code>xmlns</code> attribute is useful for creating other types of objects
               which can be handled by custom-designed code, using JavaScript for example.
            </p>
            <subpage id="xmlbase" name="xml-base-attribute">
               <label>xml:base</label>
               <title>The xml:base Attribute</title>
               <h3>The <code>xml:base</code> HTML attribute</h3>
               <p>The <code>xml:base</code> attribute
               </p>
               <h4>Examples</h4>
               <blockcode>
                  <l>&lt;span =""&gt;...&lt;/span&gt;</l>
               </blockcode>
            </subpage>
            <subpage id="xmlid" name="xml-id-attribute">
               <label>xml:id</label>
               <title>The xml:id Attribute</title>
               <h3>The <code>xml:id</code> HTML attribute</h3>
               <p>The HTML <code>id</code> attribute serves the same purpose as
                  the <code>xml:id</code> attribute and should be used instead.
               </p>
               <h4>Examples</h4>
               <blockcode>
                  <l>&lt;span id="elementId-1"&gt;...&lt;/span&gt;</l>
               </blockcode>
            </subpage>
            <subpage id="xmllang" name="xml-lang-attribute">
               <label>xml:lang</label>
               <title>The xml:lang Attribute</title>
               <h3>The <code>xml:lang</code> HTML attribute</h3>
               <p>The HTML <code>lang</code> attribute serves the same purpose as
                  the <code>xml:lang</code> attribute and should be used instead.
                  However, the prefixed <code>xml:lang</code> attribute is sometimes used on the
                  <link xlink:type="simple" xlink:href="../tags/html-tag/">
                     <code>html</code> element</link>.
               </p>
               <h4>Examples</h4>
               <blockcode>
                  <l>&lt;dt lang="fr-CA"&gt;de rigeur&lt;/dt&gt;</l>
                  <l>&lt;html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"&gt;</l>
               </blockcode>
            </subpage>
            <subpage id="xmlspace" name="xml-space-attribute">
               <label>xml:space</label>
               <title>The xml:space Attribute</title>
               <h3>The <code>xml:space</code> HTML attribute</h3>
               <p>The <code>xml:space</code> attribute determines whether any white space
                  in the content of the element or its descendants is to be preserved.
               </p>
               <h4>Examples</h4>
               <blockcode>
                  <l>&lt;span =""&gt;...&lt;/span&gt;</l>
               </blockcode>
            </subpage>
            <subpage id="xmlns" name="xmlns-attributes">
               <label>xmlns</label>
               <title>xmlns Attribute and Prefix</title>
               <h3>The <code>xmlns</code> HTML attribute</h3>
               <p>The <code>xmlns</code> attribute sets the default namespace
                  <acronym term="Universal Resource Identifier">URI</acronym>
                  for the current element and any of its descendants.
               </p>
               <blockcode>
                  <l>&lt;special xmlns="http://ExampleOnly.com/namespace/"&gt;</l>
                  <l>   &lt;p xmlns="http://www.w3.org/1999/xhtml"&gt;This paragraph is truly HTML, but its parent is "special".</l>
                  <l>   &lt;/p&gt;</l>
                  <l>&lt;/special&gt;</l>
               </blockcode>
               <p>Although it may be coded at any level, it typically appears only on the
                  top-level <link xlink:type="simple" xlink:href="../tags/html-tag/">
                     <code>html</code> element</link>.
                  The value of the <code>xmlns</code> attribute for HTML tags is
                  <code>http://www.w3.org/1999/xhtml</code> the same as for the 2000 W3C standard HTML.
               </p>
               <blockcode>
                  <l class="output">&lt;?xml version="1.0" encoding="UTF-8"?&gt;</l>
                  <l class="output">&lt;!DOCTYPE html&gt;</l>
                  <l>&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;</l>
                  <l class="output">   ...</l>
                  <l class="output">&lt;/html&gt;</l>
               </blockcode>
               <p>Using <code>xmlns</code> as a prefix associates a namespace URI with the user-specified
                  namespace prefix following the <code>xmlns:</code> part of the attribute name.
               </p>
               <blockcode>
                  <l>&lt;special xmlns="http://ExampleOnly.com/namespace/" xmlns:html="http://www.w3.org/1999/xhtml"&gt;</l>
                  <l>   &lt;html:p&gt;This paragraph is truly HTML, but its parent is "special".</l>
                  <l>   &lt;/html:p&gt;</l>
                  <l>&lt;/special&gt;</l>
               </blockcode>
               <p>You typically would only see something like this when HTML is aggregated
                  with non-HTML content with element names from a different namespace.
               </p>
            </subpage>
            <updated local="2010-09-19">Sunday September 19, 2010</updated>
         </page>
      </pages>
   </section>
   <copyright>Copyright © 2010 Accilent<span class="sup">®</span> Corp. Alteration of content, including addition of any function such as hypertext links or pop-up advertising, or interference with the hypertext links or other functions of this site is expressly prohibited.</copyright>
   <disclaimer>All information, links, forms, applications and other items on this site or obtained from it are provided <b>AS IS</b>, WITHOUT WARRANTY OF ANY KIND EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.</disclaimer>
</document>

