@Override
    protected void map(Text key, Text value, Context context)
        throws IOException, InterruptedException {
      // TODO Auto-generated method stub

      
      try {

//        System.out.println(value.toString());

        document = saxReader.read(new StringReader(value.toString().trim()));
        document.normalize();
        Map<String, String> namespaceUris = new HashMap<String, String>();
        namespaceUris.put("mediawiki",
            "http://www.mediawiki.org/xml/export-0.3/");

        XPath xPath = DocumentHelper.createXPath("//mediawiki:page");
        xPath.setNamespaceURIs(namespaceUris);

        List list = xPath.selectNodes(document);
        Iterator iter = list.iterator();

        System.out.println(list.size());

        while (iter.hasNext()) {
          Element page = (Element) iter.next();
          Element textEle = page.element("revision").element("text");
          Element timeEle = page.element("revision").element("timestamp");
          for (String keyword : keywords) {
            if (StringUtils.containsIgnoreCase(textEle.getText(), keyword)) {
              System.out.println(count++);
//              System.out.println(textEle.getText());
//              System.out.println(page.asXML());
              context.write(new Text(timeEle.getText()),
                  new Text(page.asXML()));
              break;
            }
          }
        }

      } catch (DocumentException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
      }

    }