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 toXMLString?
How do I use the method toXMLString?

Apr 17th, 2005 01:49
Martin Honnen,


The method toXMLString takes no argument and returns the concatenation
of toXMLString
(http://www.faqts.com/knowledge_base/view.phtml/aid/35506/fid/1784)
called on each XML object in the XMLList where the result for each XML
object is put on a separate line if XML.prettyPrinting is true.
Here are some examples:
  var twoElementList = <>
    <god>Kibo</god>
    <god>Xibo</god>
  </>;
  alert(twoElementList.toXMLString());
  /* shows
  '<god>Kibo</god>
   <god>Xibo</god>'
  */
  XML.prettyPrinting = false;
  alert(twoElementList.toXMLString());
  // now shows '<god>Kibo</god><god>Xibo</god>'