XML extract from site.

Sep 7th, 2013
Price: $50 USD

Question description

For this assignment you will model and process an XML document   ttp://free1.ed.gov/xml/gemexport.xml) containing a set of teaching and learning resources produced by the Department of Education (http://www.ed.gov/)

You will need to extract the following data from each of <resource> elements in the document:

  • title

  • description

  • url

  • the list of subjects, both
         the categories and subcategories.

You will need to define an appropriate set of classes that model
the structure of the XML document using the approach described in the content.
You only need to model the subset of information that needs to be collected. It
will require more than one class, however.

Further, you must create a class, ResourceImporter, which has exactly
two operations:

public class ResourceImporter {

  private static
Document loadXMLDocument(String documentLocation) { ... }

  public static
Resources importResourcesFromXML(String documentLocation) { ... }


where Resources is the class that represents the element <root> in the resource
document. Technically, if you apply the method for mapping an XML structure to a
set of classes, the name of the class should be Root but Resources is more meaningful. The class should load and parse the resources XML document, similar to how TopTracksImporter worked in the
LastFM example.

You must also have a class T_Resources which contains the  main(). It must be the only file that contains a main(). It will use ResourceImporter to load the document and then use the returned Resources object to produce formatted output. Given a structure that looks like the following (note that
the irrelevant parts of the structure have been stripped)


Guide to the U.S. Government for Kids</title>

<description>Help's K-12 students learn...</description>





















The output should look like


Ben's Guide to the U.S. Government for Kids'




  Government ::


  Government :: Other


  Government :: Congress


A blank line should appear between the outputs of the different

Submission Requirements

Your submission for this assignment will consist of a single zip
file that contains the Java source code files (no .class files!). The files
should not be nested in another folder. The Java classes cannot depend on
anything more than each other and the standard Java libraries.

Each class you define should be contained in its own .java file. Each file requires a header at the top of the file of the form

To do this, we will use the
Document Object Model (DOM). The DOM is an API maintained by the World Wide Web
Consortium (W3C). An API just tells what's available and how things work. There
needs to be an implementation of the API and, conveniently, Java provides one.

Tutor Answer

(Top Tutor) Daniel C.
School: University of Virginia

Studypool has helped 1,244,100 students

Review from our student for this Answer

Sep 13th, 2013
"This tutor is great!"
Ask your homework questions. Receive quality answers!

Type your question here (or upload an image)

1831 tutors are online

Brown University

1271 Tutors

California Institute of Technology

2131 Tutors

Carnegie Mellon University

982 Tutors

Columbia University

1256 Tutors

Dartmouth University

2113 Tutors

Emory University

2279 Tutors

Harvard University

599 Tutors

Massachusetts Institute of Technology

2319 Tutors

New York University

1645 Tutors

Notre Dam University

1911 Tutors

Oklahoma University

2122 Tutors

Pennsylvania State University

932 Tutors

Princeton University

1211 Tutors

Stanford University

983 Tutors

University of California

1282 Tutors

Oxford University

123 Tutors

Yale University

2325 Tutors