org.dom4j.Namespace.getParent()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(7.1k)|赞(0)|评价(0)|浏览(130)

本文整理了Java中org.dom4j.Namespace.getParent()方法的一些代码示例,展示了Namespace.getParent()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Namespace.getParent()方法的具体详情如下:
包路径:org.dom4j.Namespace
类名称:Namespace
方法名:getParent

Namespace.getParent介绍

暂无

代码示例

代码示例来源:origin: org.dom4j/dom4j

public String getUniquePath(Element context) {
  StringBuffer path = new StringBuffer(10);
  Element parent = getParent();
  if ((parent != null) && (parent != context)) {
    path.append(parent.getUniquePath(context));
    path.append('/');
  }
  path.append(getXPathNameStep());
  return path.toString();
}

代码示例来源:origin: org.dom4j/dom4j

public String getPath(Element context) {
  StringBuffer path = new StringBuffer(10);
  Element parent = getParent();
  if ((parent != null) && (parent != context)) {
    path.append(parent.getPath(context));
    path.append('/');
  }
  path.append(getXPathNameStep());
  return path.toString();
}

代码示例来源:origin: org.dom4j/org.motechproject.org.dom4j

public String getPath(Element context) {
  StringBuffer path = new StringBuffer(10);
  Element parent = getParent();
  if ((parent != null) && (parent != context)) {
    path.append(parent.getPath(context));
    path.append('/');
  }
  path.append(getXPathNameStep());
  return path.toString();
}

代码示例来源:origin: maven/dom4j

public String getPath(Element context) {
  StringBuffer path = new StringBuffer(10);
  Element parent = getParent();
  if ((parent != null) && (parent != context)) {
    path.append(parent.getPath(context));
    path.append('/');
  }
  path.append(getXPathNameStep());
  return path.toString();
}

代码示例来源:origin: apache/servicemix-bundles

public String getPath(Element context) {
  StringBuffer path = new StringBuffer(10);
  Element parent = getParent();
  if ((parent != null) && (parent != context)) {
    path.append(parent.getPath(context));
    path.append('/');
  }
  path.append(getXPathNameStep());
  return path.toString();
}

代码示例来源:origin: dom4j/dom4j

public String getPath(Element context) {
  StringBuffer path = new StringBuffer(10);
  Element parent = getParent();
  if ((parent != null) && (parent != context)) {
    path.append(parent.getPath(context));
    path.append('/');
  }
  path.append(getXPathNameStep());
  return path.toString();
}

代码示例来源:origin: dom4j/dom4j

public String getUniquePath(Element context) {
  StringBuffer path = new StringBuffer(10);
  Element parent = getParent();
  if ((parent != null) && (parent != context)) {
    path.append(parent.getUniquePath(context));
    path.append('/');
  }
  path.append(getXPathNameStep());
  return path.toString();
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.dom4j

public String getUniquePath(Element context) {
  StringBuffer path = new StringBuffer(10);
  Element parent = getParent();
  if ((parent != null) && (parent != context)) {
    path.append(parent.getUniquePath(context));
    path.append('/');
  }
  path.append(getXPathNameStep());
  return path.toString();
}

代码示例来源:origin: org.dom4j/com.springsource.org.dom4j

public String getUniquePath(Element context) {
  StringBuffer path = new StringBuffer(10);
  Element parent = getParent();
  if ((parent != null) && (parent != context)) {
    path.append(parent.getUniquePath(context));
    path.append('/');
  }
  path.append(getXPathNameStep());
  return path.toString();
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.dom4j

public String getPath(Element context) {
  StringBuffer path = new StringBuffer(10);
  Element parent = getParent();
  if ((parent != null) && (parent != context)) {
    path.append(parent.getPath(context));
    path.append('/');
  }
  path.append(getXPathNameStep());
  return path.toString();
}

代码示例来源:origin: org.jenkins-ci.dom4j/dom4j

public String getPath(Element context) {
  StringBuffer path = new StringBuffer(10);
  Element parent = getParent();
  if ((parent != null) && (parent != context)) {
    path.append(parent.getPath(context));
    path.append('/');
  }
  path.append(getXPathNameStep());
  return path.toString();
}

代码示例来源:origin: maven/dom4j

public String getUniquePath(Element context) {
  StringBuffer path = new StringBuffer(10);
  Element parent = getParent();
  if ((parent != null) && (parent != context)) {
    path.append(parent.getUniquePath(context));
    path.append('/');
  }
  path.append(getXPathNameStep());
  return path.toString();
}

代码示例来源:origin: com.alibaba.citrus.tool/antx-autoexpand

public String getUniquePath(Element context) {
  StringBuffer path = new StringBuffer(10);
  Element parent = getParent();
  if ((parent != null) && (parent != context)) {
    path.append(parent.getUniquePath(context));
    path.append('/');
  }
  path.append(getXPathNameStep());
  return path.toString();
}

代码示例来源:origin: org.jenkins-ci.dom4j/dom4j

public String getUniquePath(Element context) {
  StringBuffer path = new StringBuffer(10);
  Element parent = getParent();
  if ((parent != null) && (parent != context)) {
    path.append(parent.getUniquePath(context));
    path.append('/');
  }
  path.append(getXPathNameStep());
  return path.toString();
}

代码示例来源:origin: org.dom4j/org.motechproject.org.dom4j

public String getUniquePath(Element context) {
  StringBuffer path = new StringBuffer(10);
  Element parent = getParent();
  if ((parent != null) && (parent != context)) {
    path.append(parent.getUniquePath(context));
    path.append('/');
  }
  path.append(getXPathNameStep());
  return path.toString();
}

代码示例来源:origin: org.dom4j/com.springsource.org.dom4j

public String getPath(Element context) {
  StringBuffer path = new StringBuffer(10);
  Element parent = getParent();
  if ((parent != null) && (parent != context)) {
    path.append(parent.getPath(context));
    path.append('/');
  }
  path.append(getXPathNameStep());
  return path.toString();
}

代码示例来源:origin: com.alibaba.citrus.tool/antx-autoexpand

public String getPath(Element context) {
  StringBuffer path = new StringBuffer(10);
  Element parent = getParent();
  if ((parent != null) && (parent != context)) {
    path.append(parent.getPath(context));
    path.append('/');
  }
  path.append(getXPathNameStep());
  return path.toString();
}

代码示例来源:origin: apache/servicemix-bundles

public String getUniquePath(Element context) {
  StringBuffer path = new StringBuffer(10);
  Element parent = getParent();
  if ((parent != null) && (parent != context)) {
    path.append(parent.getUniquePath(context));
    path.append('/');
  }
  path.append(getXPathNameStep());
  return path.toString();
}

代码示例来源:origin: stackoverflow.com

public void visit(Document document) {
  ((DefaultElement) document.getRootElement())
      .setNamespace(Namespace.NO_NAMESPACE);
  document.getRootElement().additionalNamespaces().clear();
}

public void visit(Namespace namespace) {
  if (namespace.getParent() != null) {
    namespace.getParent().remove(namespace);
  }
}

public void visit(Attribute node) {
  if (node.toString().contains("xmlns")
      || node.toString().contains("xsi:")) {
    node.getParent().remove(node);
  }
}

public void visit(Element node) {
  if (node instanceof DefaultElement) {
    ((DefaultElement) node).setNamespace(Namespace.NO_NAMESPACE);
    node.additionalNamespaces().clear();
  }
}

代码示例来源:origin: dom4j/dom4j

protected void testXPath(String xpathText) {
  XPath xpath = DocumentHelper.createXPath(xpathText);
  List<Node> list = xpath.selectNodes(document);
  log("Searched path: " + xpathText + " found: " + list.size()
      + " result(s)");
 for (Node node : list) {
  log("Found Result: " + node);
  assertTrue("Results should be Namespace objects",
      node instanceof Namespace);
  Namespace namespace = (Namespace) node;
  log("Parent node: " + namespace.getParent());
  assertTrue("Results should support the parent relationship",
      namespace.supportsParent());
  assertTrue(
      "Results should contain reference to the parent element",
      namespace.getParent() != null);
  assertTrue("Results should contain reference to the document",
      namespace.getDocument() != null);
 }
}

相关文章