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?

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

Entry

How do I use the method text?
How do I use the method text?

Apr 16th, 2005 03:12
Martin Honnen,


The method text takes no argument and returns an XMLList containing all
the text child nodes of all the XML objects contained in this XMLList
the method is called on. This is done by calling the method text
(http://www.faqts.com/knowledge_base/view.phtml/aid/35501/fid/1784) on
each XML element object contained in the list and concatenating the results.
Here is an example:
  var godList = <>
    <god>Kibo</god>
    <god>Xibo</god>
  </>;
  alert(godList.text().length()); // shows 2
  alert(godList.text().toXMLString());
  /* shows
  'Kibo
   Xibo'
  */