SemmleCode XML Tutorial

Article Index
SemmleCode XML Tutorial
Loading Code
Writing .QL Queries
Framework-specific .QL Classes

Duration: 15 minutes approx.

This tutorial will demonstrate how to:

It is expected that you are already familiar with querying Java compilation units, as explained here. In this tutorial we illustrate how to combine querying different progam artefacts, such as Java and XML files. Throughout the tutorial, we'll be querying a sample open-source Spring-based application called JPetStore. To follow along, please download a ready-made Eclipse project of JPetStore. Once downloaded it can be imported into Eclipse:

  1. Unzip the downloaded file. It will unpack to a new folder called JPetStore.
  2. Start Eclipse.
  3. Select File->New->Project.
  4. Select Java Project and click Next.
  5. Give the project a name, select Create project from existing source, click the Browse button, browse to where you unpacked the zip file, select the JPetStore directory and click OK.
  6. Click Finish.

You can also run through this tutorial using one of your own java projects that use XML files of any kind. Some of the later queries may require tweaking so that they are applicable to your project.