faqts : Computers : Programming : Languages : JavaScript : XML : E4X (ECMAScript for XML) : XML objects

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

2 of 3 people (67%) answered Yes
Recently 2 of 3 people (67%) answered Yes

Entry

How do I use the method setNamespace?
How do I use the method setNamespace?

Apr 12th, 2005 03:16
Martin Honnen,


The method setNamespace takes one argument, the new namespace, and
changes the namespace associated with the name of this XML object to the
new namespace.
Here is an example:
  var xhtml = <p xmlns="http://www.w3.org/1999/xhtml">Kibology for all.</p>;
  xhtml.setNamespace(new Namespace('http://www.w3.org/2002/06/xhtml2'));
  alert(xhtml.toXMLString());
  /* shows
   '<p xmlns="http://www.w3.org/2002/06/xhtml2">Kibology for all.</p>'
  */