APISonar


fitnesse.http.Response.Format.XML

> fitnesse > http > Response > Format > XML
fitnesse APIs http APIs Response APIs Format APIs XML APIs

Example 1
private Response generateXMLResponse(File file) throws UnsupportedEncodingException {
    try {
      response.setContent(FileUtil.getFileContent(file));
    } catch (IOException e) {
      response.setContent("Error: Unable to read file '" + file.getName() + "'\n");
    }
    response.setContentType(Format.XML);
    return response;
  }
Example 2
private Response makeTestHistoryXmlResponse(TestHistory history) throws UnsupportedEncodingException {
    SimpleResponse response = new SimpleResponse();
    VelocityContext velocityContext = new VelocityContext();
    velocityContext.put("testHistory", history);
    response.setContentType(Format.XML);
    response.setContent(context.pageFactory.render(velocityContext, "testHistoryXML.vm"));
    return response;
  }