gpt4 book ai didi

org.xmlpull.v1.builder.XmlElement.lookupNamespaceByName()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-25 19:41:05 28 4
gpt4 key购买 nike

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

XmlElement.lookupNamespaceByName介绍

[英]Find namespace (will have non empty prefix) corresponding to namespace name checking first current elemen and if not found continue in parent (if element has parent). and so on.
[中]查找与名称空间名称对应的名称空间(将具有非空前缀),检查第一个当前元素,如果未找到,则继续在父元素中查找(如果元素具有父元素)。等等

代码示例

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

public XmlNamespace lookupNamespaceByName(String namespaceName) {
  XmlNamespace ns = target.lookupNamespaceByName(namespaceName);
  if(ns == null) { // needed as parent in target may not be set correctly ...
    XmlContainer p = getParent();
    if(p instanceof XmlElement) {
      XmlElement e = (XmlElement) p;
      return e.lookupNamespaceByName(namespaceName);
    }
  }
  return ns;
}

代码示例来源:origin: org.ogce/xpp3

public XmlNamespace lookupNamespaceByName(String namespaceName) {
  XmlNamespace ns = target.lookupNamespaceByName(namespaceName);
  if(ns == null) { // needed as parent in target may not be set correctly ...
    XmlContainer p = getParent();
    if(p instanceof XmlElement) {
      XmlElement e = (XmlElement) p;
      return e.lookupNamespaceByName(namespaceName);
    }
  }
  return ns;
}

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

public XmlNamespace lookupNamespaceByName(String namespaceName) {
  if(namespaceName == null) {
    throw new IllegalArgumentException("namespace name can not ber null");
  }
  if(hasNamespaceDeclarations()) {
    int length = nsList.size();
    for (int i = 0; i < length; i++)
    {
      XmlNamespace n = (XmlNamespace) nsList.get(i);
      if(namespaceName.equals(n.getNamespaceName()) ){
        return n;
      }
    }
  }
  if(parent != null && parent instanceof XmlElement) {
    return ((XmlElement)parent).lookupNamespaceByName(namespaceName);
  } else {
    return null;
  }
}

代码示例来源:origin: org.ogce/xpp3

public XmlNamespace lookupNamespaceByName(String namespaceName) {
  if(namespaceName == null) {
    throw new IllegalArgumentException("namespace name can not ber null");
  }
  if(hasNamespaceDeclarations()) {
    int length = nsList.size();
    for (int i = 0; i < length; i++)
    {
      XmlNamespace n = (XmlNamespace) nsList.get(i);
      if(namespaceName.equals(n.getNamespaceName()) ){
        return n;
      }
    }
  }
  if(parent != null && parent instanceof XmlElement) {
    return ((XmlElement)parent).lookupNamespaceByName(namespaceName);
  } else {
    return null;
  }
}

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com