Beispiel #1
0
 private boolean isEqual(ProcessingInstruction e1, ProcessingInstruction e2) {
   String t1 = e1.getTarget();
   String t2 = e2.getTarget();
   if (!Util.isEqual(t1, t2)) return false;
   t1 = e1.getData();
   t2 = e2.getData();
   return Util.isEqual(t1, t2);
 }
Beispiel #2
0
  void serialize(OutputContext c) throws XProcException {

    boolean bRead = false;
    if (select == null || select.isEmpty()) {
      // If this input is the default input and its parent is the same, then dont add
      // an xread
      if (!step && !c.isDerivedInput(this)) {
        c.addPreamble("xread " + getPortVariable());
        bRead = true;
      }

    } else {
      c.addPreamble("xpath " + XProcUtil.quote(select.xpath) + " >{" + getPortVariable() + "}");
      bRead = true;
    }
    if (!Util.isEqual(port, "source")) c.addPreamble("<(" + port + ")");

    bindings.serialize(c);
    c.addPreambleLine("");

    // if(! bindings.hasInputs() )
    if (bRead) c.addBody(" <{" + getPortVariable() + "}");
  }
Beispiel #3
0
 private boolean isEqual(String s1, String s2) {
   // Compare strings considering null and "" equal
   return Util.isEqual(s1, s2);
 }
Beispiel #4
0
 private boolean isBlank(Characters e) {
   if (e.isIgnorableWhiteSpace()) return true;
   return Util.isBlank(e.getData());
 }