[Get Answer ]-Xml Extract From Site

Question Description

For this assignment you will model and process an XML document   ttp:// containing a set of teaching and learning resources produced by the Department of Education (

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.

HTML tutorial

Leave a Reply

Your email address will not be published.