org.dom4j.Attribute.getNamespace()方法的使用及代码示例

x33g5p2x  于2022-01-15 转载在 其他  
字(2.5k)|赞(0)|评价(0)|浏览(90)

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

Attribute.getNamespace介绍

[英]Returns the Namespace of this element if one exists otherwise null is returned returned.
[中]如果存在此元素,则返回该元素的Namespace,否则返回null。

代码示例

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

declaredNS.add(attr.getNamespace());

代码示例来源:origin: igniterealtime/Openfire

Namespace ns = attribute.getNamespace();
if (ns != null && ns != Namespace.NO_NAMESPACE && ns != Namespace.XML_NAMESPACE) {
  String prefix = ns.getPrefix();

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

Namespace ns = attribute.getNamespace();

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

Namespace ns = attribute.getNamespace();

代码示例来源:origin: org.igniterealtime.openfire/xmppserver

Namespace ns = attribute.getNamespace();
if (ns != null && ns != Namespace.NO_NAMESPACE && ns != Namespace.XML_NAMESPACE) {
  String prefix = ns.getPrefix();

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

Namespace ns = attribute.getNamespace();

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

Namespace ns = attribute.getNamespace();

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

Namespace ns = attribute.getNamespace();

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

Namespace ns = attribute.getNamespace();

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

Namespace ns = attribute.getNamespace();

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

Namespace ns = attribute.getNamespace();

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

Namespace ns = attribute.getNamespace();

代码示例来源:origin: org.jibx/jibx-extras

for (int i = 0; i < element.attributeCount(); i++) {
  Attribute attr = element.attribute(i);
  int index = findNamespaceIndex(attr.getNamespace());
  m_xmlWriter.addAttribute(index, attr.getName(),
     attr.getValue());

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

protected void testAttributeDefaultPrefix(Document document) throws Exception {
  List<Node> list = document.selectNodes("//@*[local-name()='actor']");
  assertTrue("Matched at least one 'actor' attribute", list.size() > 0);
  for (Node node : list) {
    Attribute attribute = (Attribute) node;
    log("found: " + attribute.asXML());
    Element element = attribute.getParent();
    assertTrue("Attribute has a parent", element != null);
    Namespace ns = element.getNamespaceForPrefix("");
    String uri = "http://schemas.xmlsoap.org/soap/envelope/";
    assertNamespace(ns, "", uri);
    Namespace ns2 = attribute.getNamespace();
    // Note that namespaces do not inherit the default namespace!
    assertNamespace(ns2, "", "");
  }
}

相关文章