Altova Authentic 2024 Browser Edition


Home Prev Top Next

See also


Declaration: EraseCurrentChild



EraseCurrentChild deletes the current XMLData child object. Before you call EraseCurrentChild you must initialize an internal iterator with XMLData.GetFirstChild.




This JavaScript example deletes all elements with the name "EraseMe". The code shows you, that it is possible to call EraseCurrentChild and GetNextChild inside the same loop to continue stepping through the child elements.


 function DeleteXMLElements(objXMLData)


         if(objXMLData == null)



         if(objXMLData.HasChildren)        {        

                 var objChild;

                 objChild = objXMLData.GetFirstChild(-1);


                 while(objChild)        {



                         try        {

                                 if(objChild.Name == "EraseMe")



                                 objChild = objXMLData.GetNextChild();


                         catch(Err)        {

                                 objChild = null;






© 2018-2024 Altova GmbH