Java程序辅导

C C++ Java Python Processing编程在线培训 程序编写 软件开发 视频讲解

客服在线QQ:2653320439 微信:ittutor Email:itutor@qq.com
wx: cjtutor
QQ: 2653320439
Lab: Recursion on XMLTree Lab: Recursion on XMLTree Objective In this lab you will practice recursion on XMLTrees by implementing the tagCount and outputTextNodes static methods. Setup Follow these steps to set up a project for this lab. Create a new Eclipse project by copying ProjectTemplate. Name the new project XMLTreeRecursion. Open the src folder of this project and then open (default package). As a starting point you can use any of the Java files. Rename it XMLTreeRecursion and delete the other files from the project. Follow the link to XMLTreeRecursion.java, select all the code on that page and copy it to the clipboard; then open the XMLTreeRecursion.java file in Eclipse and paste the code to replace the file contents. Save the file. Method Complete the body of the tagCount static method specified as follows: Run the program and test your implementation of tagCount. For testing purposes you can use any XML URL or file. You may want to open it in the XMLTreeViewer application you used in an earlier lab to check the correctness of the output. (If you need some URL samples, click on the XML Input drop-down menu in the XMLTreeViewer application.) Complete the body of the outputTextNodes static method specified as follows: Run the program and test your implementation of outputTextNodes. Additional Activities Complete the body of the outputXML static method specified as follows: Basically this method is intended to produce the same output as the String returned by XMLTree's method toString, but of course, you should use recursion and cannot use toString. To complete this task you may want to implement a couple of "helper" methods, outputSpaces and outputAttributes, (themselves not involving recursion) specified in XMLTreeRecursion.java. Run the program and test your implementation of outputXML.