本文整理了Java中org.dom4j.Attribute.getNamespace()
方法的一些代码示例,展示了Attribute.getNamespace()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Attribute.getNamespace()
方法的具体详情如下:
包路径:org.dom4j.Attribute
类名称: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, "", "");
}
}
内容来源于网络,如有侵权,请联系作者删除!