Beispiel #1
0
 /// <summary>
 /// XML.prototype.appendChild ( child )
 /// 
 /// The appendChild method appends the given child to the end of
 /// this XML objects properties and returns this XML object.
 /// 
 /// See ECMA 13.4.4.3
 /// </summary>
 internal XML AppendChild(object child)
 {
     if (underlyingNode is XmlDocument) {
         // For now a single document with just a <?pi?> cannot exist, so
         // at least one root element must be given. But appending to root
         // will raise an error so we'll "guess" that the user meant to append
         // the documentElement instead of the document.
         // HACK
         XML xml = new XML (lib, ((XmlDocument)underlyingNode).DocumentElement);
         xml.AppendChild (child);
         return this;
     }
     return InsertChildBefore (child, null);
 }