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

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

0 of 1 people (0%) answered Yes
Recently 0 of 1 people (0%) answered Yes

Entry

How do I use the method normalize?
How do I use the method normalize?

Apr 16th, 2005 00:15
Martin Honnen,


The method normalize takes no argument and returns the XMLList object it
is called on after joining adjacent text nodes and removing empty text
nodes.
Here is an example:
  var textList = <>0: Kibology for all.</>;
  for (var i = 1; i <= 3; i++) {
    textList[i] = i + ': Kibology for all.';
  }
  alert(textList.length()); // shows 4
  textList.normalize();
  alert(textList.length()); // shows 1