The localName , namespaceURI , and prefix Properties


The localName , namespaceURI , and prefix Properties

You use the localName , namespaceURI , and prefix properties mostly with XML documentsor XML embedded in HTML documentsthat uses namespaces. We won't have that much use for namespaces in this book, but, briefly , you can declare and use a namespace in XML like this:

 <doc xmlns:ns="http://www.ns.com">      <ns:myElement>Here is some data</ns:myElement>  </doc> 

Here, "ns" is the namespace's prefix, " http://www.ns.com " is the namespace's URI, and the local name of an tag such as <ns:myElement> is just the part without the namespace prefix, "myElement" . These items correspond to the localName , namespaceURI , and prefix properties, and you can find the support for these properties in Table 5.34.

Tip

For more on XML, see the W3C XML specification at www.w3.org/TR/REC-xml. See also the scopeName property in this chapter.


Table 5.34. The localName , namespaceURI , and prefix Properties

Property

NS2

NS3

NS4

NS6

IE3a

IE3b

IE4

IE5

IE5.5

IE6

localName

     

x

         

x

 

Read-only

 

Type: String

namespaceURI

     

x

         

x

 

Read-only

 

Type: String

prefix

     

x

         

x

 

Read-only

 

Type: String



Inside Javascript
Inside JavaScript
ISBN: 0735712859
EAN: 2147483647
Year: 2005
Pages: 492
Authors: Steve Holzner

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net