code:   public void testEntities() throws Exception
    {
      // use a binary file, so when it's loaded fail with XML eror:
      String file = getFile("mailing_lists.pdf").toURI().toASCIIString();
      String xml = 
        "<?xml version=\"1.0\"?>" +
        "<!DOCTYPE foo [" + 
        // check that external entities are not resolved!
        "<!ENTITY bar SYSTEM \""+file+"\">"+
        // but named entities should be
        "<!ENTITY wacky \"zzz\">"+
        "]>" +
        "<random>" +
        " &bar;" +
        " <document>" +
        "  <node name=\"id\" value=\"12345\"/>" +
        "  <node name=\"foo_s\" value=\"&wacky;\"/>" +
        " </document>" +
        "</random>";
      SolrQueryRequest req = req(CommonParams.TR, "xsl-update-handler-test.xsl");
      SolrQueryResponse rsp = new SolrQueryResponse();
      BufferingRequestProcessor p = new BufferingRequestProcessor(null);
      XMLLoader loader = new XMLLoader().init(null);
      loader.load(req, rsp, new ContentStreamBase.StringStream(xml), p);
  
      AddUpdateCommand add = p.addCommands.get(0);
      assertEquals("12345", add.solrDoc.getField("id").getFirstValue());
      assertEquals("zzz", add.solrDoc.getField("foo_s").getFirstValue());
      req.close();
    }  
  