Example #1
0
 public Document processRecord(Document record, int position) throws Exception {
   for (HashMap<String, String> map : check_fields) {
     String fieldXpath = map.get("Field Name");
     String regexp = map.get("Field Value");
     Filter.apply(record, new OpDelete(), fieldXpath, new TextMatches(regexp));
   }
   return record;
 }
Example #2
0
  public String getNamespaceNodeText(
      Document document, String namespaceKey, String namespaceValue, String xPath) {

    HashMap<String, String> xmlMap = new HashMap<String, String>();
    // xmlMap.put("tns","http://www.99bill.com/schema/fo/settlement");
    xmlMap.put(namespaceKey, namespaceValue);

    // XPath xpath=document.createXPath("//tns:status"); //要获取哪个节点,改这里就可以了
    XPath xpath = document.createXPath(xPath); // 要获取哪个节点,改这里就可以了
    xpath.setNamespaceURIs(xmlMap);
    Element element = (Element) xpath.selectSingleNode(document);

    return element.getText();
  }
Example #3
0
 @SuppressWarnings("unchecked")
 public void Initialise(
     HashMap<String, Object> props, StepLogger logger, ServletContext servletContext)
     throws Exception {
   super.Initialise(props, logger, servletContext);
   check_fields = (LinkedList<HashMap<String, String>>) props.get("Fields");
 }