org.sakaiproject.util.Xml.writeDocumentToString()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(1.7k)|赞(0)|评价(0)|浏览(121)

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

Xml.writeDocumentToString介绍

[英]Write a DOM Document to an output stream.
[中]将DOM文档写入输出流。

代码示例

代码示例来源:origin: sakaiproject/sakai

public static Document callTurnitinReturnDocument(String apiURL, Map<String,Object> parameters, 
    String secretKey, int timeout, Proxy proxy, boolean isMultipart) throws TransientSubmissionException, SubmissionException {
  InputStream inputStream = callTurnitinReturnInputStream(apiURL, parameters, secretKey, timeout, proxy, isMultipart);
  BufferedReader in;
  in = new BufferedReader(new InputStreamReader(inputStream));
  Document document = null;
  try {   
    DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
    DocumentBuilder  parser = documentBuilderFactory.newDocumentBuilder();
    document = parser.parse(new org.xml.sax.InputSource(in));
  }
  catch (ParserConfigurationException pce){
    log.error("parser configuration error: " + pce.getMessage());
    throw new TransientSubmissionException ("Parser configuration error", pce);
  } catch (Exception t) {
    throw new TransientSubmissionException ("Cannot parse Turnitin response. Assuming call was unsuccessful", t);
  }
  
  if (log.isDebugEnabled()) {
    log.debug(" Result from call: " + Xml.writeDocumentToString(document));
  }
  return document;
}

代码示例来源:origin: org.sakaiproject.kernel/sakai-kernel-impl

return Xml.writeDocumentToString(doc);

代码示例来源:origin: org.sakaiproject.assignment/sakai-assignment-impl

return Xml.writeDocumentToString(doc);

代码示例来源:origin: org.sakaiproject.announcement/sakai-announcement-impl

xml = Xml.writeDocumentToString(doc);

相关文章