gpt4 book ai didi

org.codehaus.cargo.util.XmlUtils.selectElementsMatchingXPath()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-19 22:14:40 26 4
gpt4 key购买 nike

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

XmlUtils.selectElementsMatchingXPath介绍

[英]The following will search the given element for the specified XPath and return a list of nodes that match.
[中]下面将在给定元素中搜索指定的XPath,并返回匹配的节点列表。

代码示例

代码示例来源:origin: org.codehaus.cargo/cargo-core-container-weblogic

/**
 * this will select the node(s) that match the below deployment.
 * 
 * @param deployable what to search for
 * @param domain root element to search in
 * @return list of child elements that match the deployment
 */
protected List<Element> selectAppDeployments(Deployable deployable, Element domain)
{
  String xpath =
    "//weblogic:app-deployment[weblogic:name/text()='"
      + createIdForDeployable(deployable) + "']";
  Element toSearch = domain;
  return xmlTool.selectElementsMatchingXPath(xpath, toSearch);
}

代码示例来源:origin: codehaus-cargo/cargo

/**
 * this will select the node(s) that match the below deployment.
 * 
 * @param deployable what to search for
 * @param domain root element to search in
 * @return list of child elements that match the deployment
 */
protected List<Element> selectAppDeployments(Deployable deployable, Element domain)
{
  String xpath =
    "//weblogic:app-deployment[weblogic:name/text()='"
      + createIdForDeployable(deployable) + "']";
  Element toSearch = domain;
  return xmlTool.selectElementsMatchingXPath(xpath, toSearch);
}

代码示例来源:origin: org.codehaus.cargo/cargo-core-api-util

/**
 * The following will search the given element for the specified XPath and return any node that
 * matches.
 * 
 * @param xpath - selection criteria
 * @param toSearch - element to start the search at
 * @return a matching element
 */
public Element selectElementMatchingXPath(String xpath, Element toSearch)
{
  List<Element> results = selectElementsMatchingXPath(xpath, toSearch);
  if (results.isEmpty())
  {
    throw new ElementNotFoundException(xpath, toSearch);
  }
  Element match = results.get(0);
  return match;
}

代码示例来源:origin: codehaus-cargo/cargo

/**
 * The following will search the given element for the specified XPath and return any node that
 * matches.
 * 
 * @param xpath - selection criteria
 * @param toSearch - element to start the search at
 * @return a matching element
 */
public Element selectElementMatchingXPath(String xpath, Element toSearch)
{
  List<Element> results = selectElementsMatchingXPath(xpath, toSearch);
  if (results.isEmpty())
  {
    throw new ElementNotFoundException(xpath, toSearch);
  }
  Element match = results.get(0);
  return match;
}

代码示例来源:origin: org.codehaus.cargo/cargo-core-container-weblogic

xmlTool.selectElementsMatchingXPath("weblogic:app-deployment", domain);
for (Element appDeployment : appDeployments)

代码示例来源:origin: codehaus-cargo/cargo

xmlTool.selectElementsMatchingXPath("weblogic:app-deployment", domain);
for (Element appDeployment : appDeployments)

代码示例来源:origin: org.codehaus.cargo/cargo-core-container-weblogic

/**
 * {@inheritDoc} undeploys files by removing their configuration to the config.xml file of the
 * WebLogic server.
 */
@Override
public void undeploy(Deployable deployable)
{
  XmlUtils xmlUtil = new XmlUtils(getFileHandler());
  Document configXml =
    xmlUtil.loadXmlFromFile(getFileHandler().append(getDomainHome(), "config.xml"));
  List<Element> results = xmlUtil.selectElementsMatchingXPath("//Application[@Path='"
    + getFileHandler().getParent(getAbsolutePath(deployable)) + "']",
      configXml.getDocumentElement());
  for (Element element : results)
  {
    configXml.removeChild(element);
  }
  this.writeConfigXml(configXml);
}

代码示例来源:origin: codehaus-cargo/cargo

/**
 * {@inheritDoc} undeploys files by removing their configuration to the config.xml file of the
 * WebLogic server.
 */
@Override
public void undeploy(Deployable deployable)
{
  XmlUtils xmlUtil = new XmlUtils(getFileHandler());
  Document configXml =
    xmlUtil.loadXmlFromFile(getFileHandler().append(getDomainHome(), "config.xml"));
  List<Element> results = xmlUtil.selectElementsMatchingXPath("//Application[@Path='"
    + getFileHandler().getParent(getAbsolutePath(deployable)) + "']",
      configXml.getDocumentElement());
  for (Element element : results)
  {
    configXml.removeChild(element);
  }
  this.writeConfigXml(configXml);
}

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