From: SourceForge.net <no...@so...> - 2010-08-17 02:36:31
|
Bugs item #3041886, was opened at 2010-08-09 20:10 Message generated for change (Comment added) made by aditsu You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=113153&aid=3041886&group_id=13153 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: DOM Support Group: None >Status: Closed >Resolution: Fixed Priority: 5 Private: No Submitted By: Vladislav Isenbaev (udh-winger) >Assigned to: Adrian Sandor (aditsu) Summary: replaceChild shows strange behavior Initial Comment: replaceChild of JTidy DOM behaves strangely. It is not equivalent to : insertBefore(newChild,oldChild); return removeChild(oldChild); ------------------- Tidy tidy = new Tidy(); tidy.setXmlOut(true); Document doc = Tidy.createEmptyDocument(); Element html = doc.getDocumentElement(); Element a = doc.createElement("a"); Element b = doc.createElement("b"); a.appendChild(b); html.appendChild(a); tidy.pprint(doc, System.out); System.out.println("---------"); Element c = doc.createElement("c"); Element d = doc.createElement("d"); c.appendChild(d); html.replaceChild(c, a); tidy.pprint(doc, System.out); This code produces this output: <html> <a><b /> </a> </html> --------- <html> <c><b /> </c> </html> However, it should be: <html> <a><b /> </a> </html> --------- <html> <c><d /> </c> </html> ---------------------------------------------------------------------- >Comment By: Adrian Sandor (aditsu) Date: 2010-08-17 10:36 Message: Fixed in SVN, good catch! ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=113153&aid=3041886&group_id=13153 |