spacer
Yehuda Shiran June 21, 2000
XML Namespaces
Tips: June 2000

Yehuda Shiran, Ph.D.
Doc JavaScript

Developer News
News Flash: Adobe Has iPhone Workaround
Adobe's Flash 10.1 Goes Mobile (Minus iPhone)
A Salute to Visionary CEOs

Internet Explorer's support for custom tags on an HTML page requires that a namespace be defined for the tag. Custom tags definition is based on XML syntax and the namespace is an XML namespace. Let's see an example for a custom tag:

<HTML XMLNLOR="#000066"><HTML XMLNS:DOCJS>
<HEAD>
<STYLE>
  @media all {
    DOCJS\:RIGHT {text-align:right; width:100}
  }
</STYLE>
</HEAD>
<BODY>
<DOCJS:RIGHT>
 Read Doc JavaScript's columns, tips, tools, and tutorials
</DOCJS:RIGHT>
</BODY>
</HTML>

As shown above, the namespace we use is DOCJS:

<HTML XMLNS:DOCJS>

XMLNS stands for XML NameSpace. We defined a custom tag called RIGHT. Every use of this tag should be prefixed by the appropriate XML namespace, to create the new tag DOCJS:RIGHT. If namespaces are not defined, the custom tag is treated as an unknown tag when the document is parsed. Although navigating to a page with an unknown tag does not result in an error, the new custom tag is not able to contain other tags, nor can behaviors be applied to it. It is also possible to define multiple namespaces on a single HTML tag:

<HTML XMLNS:DOCJS XMLNS:DOCJAVASCRIPT>


People who read this tip also read these tips:

Look for similar tips by subject:

internet.commediabistro.comJusttechjobs.comGraphics.com

Search:

WebMediaBrands Corporate Info

Legal Notices, Licensing, Reprints, Permissions, Privacy Policy.
Advertise | Newsletters | Shopping | E-mail Offers | Freelance Jobs

webref The latest from WebReference.com Browse >
Building a Banking Application Home Page with OOP · Mixing Scripting Languages · Review: phpFox, a Social Networking CMS with all the Bells and Whistles
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Enterprise 2.0: Social Networking in the Cloud · BroadSoft Marketplace Hastens Pace of Telephony Innovation · Review: HTC Hero for Sprint