org.jdom2.Attribute.getNamespacePrefix()方法的使用及代码示例

x33g5p2x  于11个月前 转载在 其他  
字(2.3k)|赞(0)|评价(0)|浏览(37)

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

Attribute.getNamespacePrefix介绍

[英]This will retrieve the namespace prefix of the Attribute. For any XML attribute which appears as [namespacePrefix]:[attributeName], the namespace prefix of the attribute would be [namespacePrefix]. When the attribute has no namespace, an empty String is returned.
[中]这将检索Attribute的命名空间前缀。对于任何显示为[namespacePrefix]:[attributeName]的XML属性,该属性的命名空间前缀将为[namespacePrefix]。当属性没有名称空间时,将返回一个空String

代码示例

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

@Override
public final String getAttributeQName(Object att) {
  Attribute attribute = (Attribute)att;
  if (attribute.getNamespacePrefix().length() == 0) {
    return attribute.getName();
  }
  return attribute.getNamespacePrefix() + ":" + attribute.getName();
}

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

if (prefix.equals(a.getNamespacePrefix())) {
  return a.getNamespace();

代码示例来源:origin: org.opencadc/cadc-test-uws

protected void validateErrorDetail(WebConversation conversation, WebResponse response, List list)
  throws Exception
{
  // Check for the error detail url.
  boolean found = false;
  for (Iterator it = list.iterator(); it.hasNext(); )
  {
    Element element = (Element) it.next();
    List attributes = element.getAttributes();
    for (Iterator itt = attributes.iterator(); itt.hasNext(); )
    {
      Attribute attribute = (Attribute) itt.next();
      if (attribute.getNamespacePrefix().equals("xlink") &&
        attribute.getName().equals("href"))
      {
        head(conversation, attribute.getValue());
        found = true;
      }
    }
  }
  assertTrue("Missing attribute xlink:href", found);
}

代码示例来源:origin: org.opencadc/cadc-util

w.print(QUOTE);
w.print("@");
if (StringUtil.hasText(a.getNamespacePrefix()))
  w.print(a.getNamespacePrefix());
  w.print(":");

代码示例来源:origin: org.opencadc/cadc-test-uws

if (attribute.getNamespacePrefix().equals("xlink")
  && attribute.getName().equals("href"))

代码示例来源:origin: org.opencadc/cadc-test-uws

if (attribute.getNamespacePrefix().equals("xlink")
    && attribute.getName().equals("href"))

代码示例来源:origin: io.wcm.tooling.commons/io.wcm.tooling.commons.crx-packmgr-helper

collectNamespacePrefix(namespacePrefixesActuallyUsed, attribute.getNamespacePrefix());

相关文章