gpt4 book ai didi

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

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

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

XmlUtils.saveXml介绍

[英]write the xml document to disk, rethrowing checked exceptions as runtime.
[中]将xml文档写入磁盘,并在运行时重新引用已检查的异常。

代码示例

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

/**
 * {@inheritDoc}
 */
@Override
public void writeFile()
{
  xmlUtil.saveXml(document, path);
}

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

/**
 * {@inheritDoc}
 */
@Override
public void writeFile()
{
  xmlUtil.saveXml(document, path);
}

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

/**
 * write the domain's config.xml to disk.
 * 
 * @param configXml document to write to disk
 */
public void writeConfigXml(Document configXml)
{
  String configFile = getConfigXmlPath();
  xmlTool.saveXml(configXml, configFile);
}

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

/**
 * write the domain's config.xml to disk.
 * 
 * @param configXml document to write to disk
 */
public void writeConfigXml(Document configXml)
{
  String configFile = getConfigXmlPath();
  xmlTool.saveXml(configXml, configFile);
}

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

/**
 * write the domain's config.xml to disk.
 * 
 * @param configXml document to write to disk
 */
public void writeConfigXml(Document configXml)
{
  String configFile = getConfigXmlPath();
  xmlTool.saveXml(configXml, configFile);
}

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

/**
 * write the domain's config.xml to disk.
 * 
 * @param configXml document to write to disk
 */
public void writeConfigXml(Document configXml)
{
  String configFile = getConfigXmlPath();
  xmlTool.saveXml(configXml, configFile);
}

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

domUtils.saveXml(doc, file);

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

domUtils.saveXml(doc, file);

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

/**
 * write the domain's config.xml to disk.
 * 
 * @param configXml document to write to disk
 */
public void writeConfigXml(Document configXml)
{
  XmlUtils xmlUtil = new XmlUtils(getFileHandler());
  xmlUtil.saveXml(configXml, getFileHandler().append(getDomainHome(), "config.xml"));
}

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

/**
 * write the domain's config.xml to disk.
 * 
 * @param configXml document to write to disk
 */
public void writeConfigXml(Document configXml)
{
  XmlUtils xmlUtil = new XmlUtils(getFileHandler());
  xmlUtil.saveXml(configXml, getFileHandler().append(getDomainHome(), "config.xml"));
}

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

/**
 * Test that the file system manager can insert an XML element deep in the XML tree into a file.
 * This also involves a lookup.
 * @throws Exception If anything goes wrong
 */
public void testManagerCanInsertAnElementIntoFileThreeLevelsDeep() throws Exception
{
  Document document = builder.newDocument();
  Element application = document.createElement("Application");
  document.appendChild(application);
  Element foo = document.createElement("foo");
  application.appendChild(foo);
  Element bar = document.createElement("bar");
  foo.appendChild(bar);
  util.saveXml(document, TEST_FILE);
  fileHandler.createFile(TEST_FILE);
  manager.setFile(TEST_FILE);
  manager.loadFile();
  manager.insertElementsUnderXPath("<subnode property='hello' />", "//Application/foo/bar");
  manager.writeFile();
  String xml = fileHandler.readTextFile(TEST_FILE, "UTF-8");
  XMLAssert.assertXpathEvaluatesTo("hello", "//Application/foo/bar/subnode/@property", xml);
}

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

/**
 * Test that the file system manager can insert an XML element with a namespace.
 * @throws Exception If anything goes wrong
 */
public void testManagerCanInsertAnElementIntoFileWithNamespace() throws Exception
{
  Document document = builder.newDocument();
  Element domain = document.createElement("domain");
  domain.setAttribute("xmlns", "http://www.bea.com/ns/weblogic/920/domain");
  domain.setAttribute("xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance");
  domain.setAttribute("xsi:schemaLocation", "http://www.bea.com/ns/weblogic/920/domain "
    + "http://www.bea.com/ns/weblogic/920/domain.xsd");
  document.appendChild(domain);
  util.saveXml(document, TEST_FILE);
  fileHandler.createFile(TEST_FILE);
  manager.setNamespaces(namespaces);
  manager.setFile(TEST_FILE);
  manager.loadFile();
  manager.insertElementsUnderXPath("<subnode property='hello' />", "//weblogic:domain");
  manager.writeFile();
  String xml = fileHandler.readTextFile(TEST_FILE, "UTF-8");
  XMLAssert.assertXpathEvaluatesTo("hello", "//weblogic:domain/weblogic:subnode/@property",
    xml);
}

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

/**
 * Test that the file system manager can insert an XML element into a file.
 * @throws Exception If anything goes wrong
 */
public void testManagerCanInsertAnElementIntoFile() throws Exception
{
  Document document = builder.newDocument();
  Element application = document.createElement("Application");
  document.appendChild(application);
  util.saveXml(document, TEST_FILE);
  fileHandler.createFile(TEST_FILE);
  manager.setFile(TEST_FILE);
  manager.loadFile();
  manager.insertElementsUnderXPath("<subnode property='hello' />", "//Application");
  manager.writeFile();
  String xml = fileHandler.readTextFile(TEST_FILE, "UTF-8");
  XMLAssert.assertXpathEvaluatesTo("hello", "//Application/subnode/@property", xml);
}

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

context.setAttribute("docBase", war.getFile());
configureExtraClasspath(war, context);
xmlUtil.saveXml(doc,
  getFileHandler().append(contextDir, war.getContext() + ".xml"));

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

context.setAttribute("docBase", war.getFile());
configureExtraClasspath(war, context);
xmlUtil.saveXml(doc,
  getFileHandler().append(contextDir, war.getContext() + ".xml"));

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