XML Interviews Question page18,xml Interviews Guide,xml Interviews

This page discusses - XML Interviews Question page18,xml Interviews Guide,xml Interviews


 

Ads

Tutorials   
XML Interviews Question page8,xml Interviews Guide,xml Interviews XML Interviews Question page7,xml Interviews Guide,xml Interviews XML Interviews Question page6,xml Interviews Guide,xml Interviews XML Interviews Question page5,xml Interviews Guide,xml Interviews XML Interviews Question page1,xml Interviews Guide,xml Interviews XML Interviews Question page30,xml Interviews Guide,xml Interviews XML Interviews Question page29,xml Interviews Guide,xml Interviews XML Interviews Question page28,xml Interviews Guide,xml Interviews XML Interviews Question page27,xml Interviews Guide,xml Interviews XML Interviews Question page26,xml Interviews Guide,xml Interviews XML Interviews Question page25,xml Interviews Guide,xml Interviews XML Interviews Question page24,xml Interviews Guide,xml Interviews XML Interviews Question page23,xml Interviews Guide,xml Interviews XML Interviews Question page22,xml Interviews Guide,xml Interviews XML Interviews Question page21,xml Interviews Guide,xml Interviews XML Interviews Question page1,xml Interviews Guide,xml Interviews XML Interviews Question page18,xml Interviews Guide,xml Interviews XML Interviews Question page17,xml Interviews Guide,xml Interviews XML Interviews Question page16,xml Interviews Guide,xml Interviews XML Interviews Question page15,xml Interviews Guide,xml Interviews XML Interviews Question page14,xml Interviews Guide,xml Interviews XML Interviews Question page13,xml Interviews Guide,xml Interviews XML Interviews Question page11,xml Interviews Guide,xml Interviews XML Interviews Question page1,xml Interviews Guide,xml Interviews XML Interviews Question page21 XML Interviews Question page19 XML Interviews Question page12 XML Interviews Question page10 XML Interviews Question page9 XML Interviews Question page3 XML Interviews Question
Ads

XML Interviews Question page18

     

  1. How do I override a default XML namespace declaration?
    To override the current default XML namespace, you simply declare another XML namespace as the default. For example, in the following, the default XML namespace is the http://www.google.org/ namespace on the A and B elements and the http://www.bar.org/ namespace on the C and D elements. That is, the names A and B are in the http://www.google.org/ namespace and the names C and D are in the http://www.bar.org/ namespace.
    <A xmlns="http://www.google.org/">
    <B>
    <C xmlns="http://www.bar.org/">
    <D>abcd</D>
    </C>
    </B>
    </A>
    Using multiple default XML namespaces can lead to documents that are confusing to read and should be done carefully.
        
  2. How do I undeclare an XML namespace prefix?
    In version 1.0 of the XML namespaces recommendation, you cannot "undeclare" an XML namespace prefix. It remains in scope until the end of the element on which it was declared unless it is overridden. Furthermore, trying to undeclare a prefix by redeclaring it with an empty (zero-length) name (URI) results in a namespace error. 
    For example:
    <google:A xmlns:google="http://www.google.org/">
    <google:B>
    <google:C xmlns:google=""> <==== This is an error in v1.0, legal in v1.1.
    <google:D>abcd</google:D>
    </google:C>
    </google:B>
    </google:A>
    In version 1.1 of the XML namespaces recommendation [currently a candidate recommendation -- February, 2003], you can undeclare an XML namespace prefix by redeclaring it with an empty name. For example, in the above document, the XML namespace declaration xmlns:google="" is legal and removes the mapping from the google prefix to the http://www.google.org URI. Because of this, the use of the google prefix in the google:D element results in a namespace error.
       
  3. How do I undeclare the default XML namespace?
    To "undeclare" the default XML namespace, you declare a default XML namespace with an empty (zero-length) name (URI). Within the scope of this declaration, unprefixed element type names do not belong to any XML namespace. For example, in the following, the default XML namespace is the http://www.google.org/ for the A and B elements and there is no default XML namespace for the C and D elements. That is, the names A and B are in the http://www.google.org/ namespace and the names C and D are not in any XML namespace.
    <A xmlns="http://www.google.org/">
    <B>
    <C xmlns="">
    <D>abcd</D>
    </C>
    </B>
    </A>
       

Advertisements

Ads
Share on Google+Share on Google+

XML Interviews Question page18,xml Interviews Guide,xml Interviews

Posted on: April 18, 2011 If you enjoyed this post then why not add us on Google+? Add us to your Circles

Advertisements

 

Discuss: XML Interviews Question page18,xml Interviews Guide,xml Interviews  

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Comments:0

Ads

 

Ads