gpt4 book ai didi

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

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

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

XmlUtils.setNamespaces介绍

暂无

代码示例

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

/**
 * {@inheritDoc}
 */
@Override
public void setNamespaces(Map<String, String> namespaces)
{
  xmlUtil.setNamespaces(namespaces);
}

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

/**
 * {@inheritDoc}
 */
@Override
public void setNamespaces(Map<String, String> namespaces)
{
  xmlUtil.setNamespaces(namespaces);
}

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

/**
 * {@inheritDoc}
 * @see org.codehaus.cargo.container.spi.configuration.AbstractStandaloneLocalConfiguration#AbstractStandaloneLocalConfiguration(String)
 */
public WebLogic9xStandaloneLocalConfiguration(String dir)
{
  super(dir);
  setProperty(WebLogicPropertySet.ADMIN_USER, "weblogic");
  setProperty(WebLogicPropertySet.ADMIN_PWD, "weblogic");
  setProperty(WebLogicPropertySet.SERVER, "server");
  setProperty(WebLogicPropertySet.CONFIGURATION_VERSION, "9.2.3.0");
  setProperty(WebLogicPropertySet.DOMAIN_VERSION, "9.2.3.0");
  setProperty(ServletPropertySet.PORT, "7001");
  setProperty(GeneralPropertySet.HOSTNAME, "localhost");
  namespaces = new HashMap<String, String>();
  namespaces.put("weblogic", "http://www.bea.com/ns/weblogic/920/domain");
  namespaces.put("jdbc", "http://www.bea.com/ns/weblogic/90");
  xmlTool = new XmlUtils();
  xmlTool.setNamespaces(namespaces);
  xmlTool.setFileHandler(getFileHandler());
}

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

/**
 * {@inheritDoc}
 * @see org.codehaus.cargo.container.spi.configuration.AbstractStandaloneLocalConfiguration#AbstractStandaloneLocalConfiguration(String)
 */
public WebLogic9xStandaloneLocalConfiguration(String dir)
{
  super(dir);
  setProperty(WebLogicPropertySet.ADMIN_USER, "weblogic");
  setProperty(WebLogicPropertySet.ADMIN_PWD, "weblogic");
  setProperty(WebLogicPropertySet.SERVER, "server");
  setProperty(WebLogicPropertySet.CONFIGURATION_VERSION, "9.2.3.0");
  setProperty(WebLogicPropertySet.DOMAIN_VERSION, "9.2.3.0");
  setProperty(ServletPropertySet.PORT, "7001");
  setProperty(GeneralPropertySet.HOSTNAME, "localhost");
  namespaces = new HashMap<String, String>();
  namespaces.put("weblogic", "http://www.bea.com/ns/weblogic/920/domain");
  namespaces.put("jdbc", "http://www.bea.com/ns/weblogic/90");
  xmlTool = new XmlUtils();
  xmlTool.setNamespaces(namespaces);
  xmlTool.setFileHandler(getFileHandler());
}

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

/**
   * Test simple element parse.
   * @throws Exception If anything does wrong.
   */
  public void testSelectElementMatchingXPath() throws Exception
  {
    Map<String, String> namespace = new HashMap<String, String>();
    namespace.put("animal", "urn:animal");
    util.setNamespaces(namespace);

    String string = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>"
        + "<base-element>"
        + "<element>dog</element>"
        + "<element xmlns=\"urn:animal\">cat</element>"
        + "</base-element>";
    Element element = util.parseIntoElement(string);
    Element animalElement = util.selectElementMatchingXPath("//base-element/animal:element",
        element);

    assertEquals("element", animalElement.getNodeName());
    assertEquals("cat", animalElement.getTextContent());
  }
}

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