gpt4 book ai didi

com.opensymphony.util.XMLUtils.parse()方法的使用及代码示例

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

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

XMLUtils.parse介绍

[英]Parse a File of XML into Document.
[中]将XML文件解析为文档。

代码示例

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

/**
 * Parse an InputStream of XML into Document.
 */
public final static Document parse(InputStream in) throws ParserConfigurationException, IOException, SAXException {
  return parse(new InputSource(in));
}

代码示例来源:origin: com.opensymphony.oscore/com.springsource.com.opensymphony.util

/**
 * Parse an InputStream of XML into Document.
 */
public final static Document parse(InputStream in) throws ParserConfigurationException, IOException, SAXException {
  return parse(new InputSource(in));
}

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

/**
 * Parse a Reader of XML into Document.
 */
public final static Document parse(Reader in) throws ParserConfigurationException, IOException, SAXException {
  return parse(new InputSource(in));
}

代码示例来源:origin: com.opensymphony.oscore/com.springsource.com.opensymphony.util

/**
 * Parse a Reader of XML into Document.
 */
public final static Document parse(Reader in) throws ParserConfigurationException, IOException, SAXException {
  return parse(new InputSource(in));
}

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

/**
 * Parse the contents of a URL's XML into Document.
 */
public final static Document parse(URL url) throws ParserConfigurationException, IOException, SAXException {
  return parse(new InputSource(url.toString()));
}

代码示例来源:origin: com.opensymphony.oscore/com.springsource.com.opensymphony.util

/**
 * Parse the contents of a URL's XML into Document.
 */
public final static Document parse(URL url) throws ParserConfigurationException, IOException, SAXException {
  return parse(new InputSource(url.toString()));
}

代码示例来源:origin: com.opensymphony.oscore/com.springsource.com.opensymphony.util

/**
 * Parse a String containing XML data into a Document.
 * Note that String contains XML itself and is not URI.
 */
public final static Document parse(String xml) throws ParserConfigurationException, IOException, SAXException {
  return parse(new InputSource(new StringReader(xml)));
}

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

/**
 * Parse a String containing XML data into a Document.
 * Note that String contains XML itself and is not URI.
 */
public final static Document parse(String xml) throws ParserConfigurationException, IOException, SAXException {
  return parse(new InputSource(new StringReader(xml)));
}

代码示例来源:origin: com.opensymphony.oscore/com.springsource.com.opensymphony.util

/**
 * Parse a File of XML into Document.
 */
public final static Document parse(File file) throws ParserConfigurationException, IOException, SAXException {
  return parse(new InputSource(new FileInputStream(file)));
}

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

/**
 * Parse a File of XML into Document.
 */
public final static Document parse(File file) throws ParserConfigurationException, IOException, SAXException {
  return parse(new InputSource(new FileInputStream(file)));
}

代码示例来源:origin: com.opensymphony.propertyset/core

/**
* Load properties from XML input.
*/
public void load(InputStream in) throws ParserConfigurationException, IOException, SAXException {
  loadFromDocument(XMLUtils.parse(in));
}

代码示例来源:origin: com.opensymphony.propertyset/core

/**
* Load properties from XML input.
*/
public void load(Reader in) throws ParserConfigurationException, IOException, SAXException {
  loadFromDocument(XMLUtils.parse(in));
}

代码示例来源:origin: com.opensymphony.propertyset.providers/ejb3

/**
 * Parse XML document from String in byte array.
 */
private Document readXML(String data)
{
 try
 {
  return XMLUtils.parse(data);
 }
 catch(Exception e)
 {
  throw new PropertyImplementationException("Cannot parse XML data", e);
 }
}

代码示例来源:origin: com.opensymphony.propertyset/core

value = XMLUtils.parse(data);

代码示例来源:origin: com.opensymphony.propertyset/core

return XMLUtils.parse(text);
} catch (Exception ex) {
  return null; // if XML cannot be parsed, ignore it.

代码示例来源:origin: com.opensymphony/webwork

protected List buildChildAdapters() {
  Node node;
  if (getParseStringAsXML()) {
    log.debug("parsing string as xml: " + getStringValue());
    // Parse the String to a DOM, then proxy that as our child
    try {
      node = XMLUtils.parse(getStringValue());
    } catch (ParserConfigurationException e) {
      throw new WebWorkException(e);
    } catch (IOException e) {
      throw new WebWorkException(e);
    } catch (SAXException e) {
      throw new WebWorkException(e);
    }
    node = getAdapterFactory().proxyNode(this, node);
  } else {
    log.debug("using string as is: " + getStringValue());
    // Create a Text node as our child
    node = new SimpleTextNode(getAdapterFactory(), this, "text", getStringValue());
  }
  List children = new ArrayList();
  children.add(node);
  return children;
}

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