cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "kal inuganti" <>
Subject off topic... removeChild() method...
Date Fri, 30 Mar 2001 18:51:22 GMT
<html><DIV>Dear List Members, </DIV>
<DIV>This question is about a method in DOM API. Please ignore this question if you
are looking for something exclusively about cocoon.</DIV>
<DIV></DIV>I have a question that I need to be helped with: 
<DIV></DIV>I am trying to delete a node and all its children from a dom tree.
This is the code that I used and it does not work. Please suggest! 
<DIV></DIV>I used the ibm parser and sectionname is a string 
<DIV></DIV>InputStream is = new FileInputStream(filelocation); 
<DIV></DIV>Parser ps = new Parser(filelocation); 
<DIV></DIV>Document doc = ps.readStream(is); 
<DIV></DIV>NodeList sections = doc.getElementsByTagName("SECTION"); 
<DIV></DIV>for(i=0;i<SECTIONS.GETLENGTH();I++){ DIV <> if(sections.item(i).getAttributes().getNamedItem("name").getNodeValue().equals(sectionname))

<DIV></DIV>Node parent = sections.item(i).getParentNode(); 
<DIV></DIV>Should I write back to the file or something after I do this operation?
or should this automatically delete the section and save the changes to the file? 
<DIV></DIV>Please Help! 
<DIV></DIV>Kalyan<br clear=all><hr>Get your FREE download of MSN Explorer
at <a href=""></a><br></p></html>

Please check that your question has not already been answered in the
FAQ before posting. <>

To unsubscribe, e-mail: <>
For additional commands, e-mail: <>

View raw message