Entry
How do I use the method setName?
How do I use the method setName?
Apr 12th, 2005 02:32
Martin Honnen,
The method setName takes one argument, the new name, and replaces the
name of this XML object with the name passed in.
The name argument can be a string or a QName object.
Here are some examples:
var god = <god>Kibo</god>;
god.setName(new QName('http://example.com/2005/04/deities', 'deity'));
alert(god.toXMLString());
/* shows
'<deity xmlns="http://example.com/2005/04/deities">Kibo</deity>'
*/