本文整理了Java中org.sakaiproject.util.Xml.writeDocumentToString()
方法的一些代码示例,展示了Xml.writeDocumentToString()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Xml.writeDocumentToString()
方法的具体详情如下:
包路径:org.sakaiproject.util.Xml
类名称: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);
内容来源于网络,如有侵权,请联系作者删除!