gpt4 book ai didi

org.ow2.util.xml.XMLUtils.getValueAsQName()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-18 22:24:40 28 4
gpt4 key购买 nike

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

XMLUtils.getValueAsQName介绍

[英]Extract a node's value as a QName.
[base element (declaring the prefix/namespace mapping)] #text-value: "prefix:local-part"
[中]将节点的值提取为QName。
[base element (declaring the prefix/namespace mapping)] #text-value: "prefix:local-part"

代码示例

代码示例来源:origin: org.ow2.util.xml/xml

/**
 * Extract a node's child value as a QName.<br/>
 * <code>
 *   [base element (declaring the prefix/namespace mapping)]
 *     #text-value: "prefix:local-part"
 * </code>
 * @param element the element from where to search.
 * @return The node's value as a QName.
 */
public static QName getChildValueAsQName(final Element base, final String name) {
  QName value = null;
  NodeList nodeList = base.getChildNodes();
  if (nodeList.getLength() > 0) {
    int length = nodeList.getLength();
    for (int i = 0; i < length; i++) {
      Node node = nodeList.item(i);
      // Get an element, create an instance of the element
      if (Node.ELEMENT_NODE == node.getNodeType()) {
        if (name.equals(node.getNodeName())) {
          // Get value of this child
          value = getValueAsQName((Element) node);
        }
      }
    }
  }
  return value;
}

代码示例来源:origin: org.ow2.util/util-xml

/**
 * Extract a node's child value as a QName.<br/>
 * <code>
 *   [base element (declaring the prefix/namespace mapping)]
 *     #text-value: "prefix:local-part"
 * </code>
 * @param element the element from where to search.
 * @return The node's value as a QName.
 */
public static QName getChildValueAsQName(final Element base, final String name) {
  QName value = null;
  NodeList nodeList = base.getChildNodes();
  if (nodeList.getLength() > 0) {
    int length = nodeList.getLength();
    for (int i = 0; i < length; i++) {
      Node node = nodeList.item(i);
      // Get an element, create an instance of the element
      if (Node.ELEMENT_NODE == node.getNodeType()) {
        if (name.equals(node.getNodeName())) {
          // Get value of this child
          value = getValueAsQName((Element) node);
        }
      }
    }
  }
  return value;
}

代码示例来源:origin: org.ow2.util/util-ee-metadata-common-impl

QName serviceQName = XMLUtils.getValueAsQName((Element) serviceQNameList.item(0));
serviceRef.setServiceQName(serviceQName);

代码示例来源:origin: org.ow2.util.metadata/metadata-common-impl

QName serviceQName = XMLUtils.getValueAsQName((Element) serviceQNameList.item(0));
serviceRef.setServiceQName(serviceQName);

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