コード例 #1
0
ファイル: Input.java プロジェクト: ableasdale/xmlsh
  void parse(XdmNode node) {
    port = XProcUtil.getAttrString(node, "port");
    sequence = XProcUtil.getAttrBool(node, "sequence", false);
    primary = XProcUtil.getAttrBoolean(node, "primary");
    kind = XProcUtil.getAttrString(node, "kind");
    select = new XPathExpression(XProcUtil.getAttrString(node, "select"), false);

    // parse children
    parseChildren(node);
  }
コード例 #2
0
ファイル: Document.java プロジェクト: ableasdale/xmlsh
 @Override
 void parse(XdmNode node) {
   String hr = XProcUtil.getAttrString(node, "href");
   URI base = node.getBaseURI();
   if (base != null) href = base.resolve(hr).toString();
   else href = hr;
 }
コード例 #3
0
ファイル: Input.java プロジェクト: ableasdale/xmlsh
  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() + "}");
  }