- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中org.fcrepo.utilities.xml.XercesXmlSerializers.writeXmlNoSpace()
方法的一些代码示例,展示了XercesXmlSerializers.writeXmlNoSpace()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XercesXmlSerializers.writeXmlNoSpace()
方法的具体详情如下:
包路径:org.fcrepo.utilities.xml.XercesXmlSerializers
类名称:XercesXmlSerializers
方法名:writeXmlNoSpace
[英]Serialize the dom Document with no preserved space between elements, but without indenting, line wrapping, omission of XML declaration, or omission of doctype
[中]序列化dom文档,元素之间不留空格,但不缩进、换行、省略XML声明或省略doctype
代码示例来源:origin: fcrepo3/fcrepo
public static InputStream fedoraXMLHashFormat(byte[] data) throws Exception {
ReadableCharArrayWriter writer = new ReadableCharArrayWriter();
Document doc =
XmlTransformUtility.parseNamespaceAware(new ByteArrayInputStream(data));
XercesXmlSerializers.writeXmlNoSpace(doc, "UTF-8", writer);
writer.close();
BufferedReader br =
new BufferedReader(writer.toReader());
String line = null;
ReadableByteArrayOutputStream outStream = new ReadableByteArrayOutputStream();
OutputStreamWriter sb = new OutputStreamWriter(outStream, "UTF-8");
while ((line = br.readLine()) != null) {
line = line.trim();
sb.write(line);
}
sb.close();
return outStream.toInputStream();
}
代码示例来源:origin: fcrepo3/fcrepo
public static byte[] fedoraXMLHashFormat(byte[] data) throws Exception {
ReadableCharArrayWriter writer = new ReadableCharArrayWriter();
DocumentBuilder builder = XmlTransformUtility.borrowDocumentBuilder();
try {
Document doc = builder.parse(new ByteArrayInputStream(data));
XercesXmlSerializers.writeXmlNoSpace(doc, "UTF-8", writer);
writer.close();
} finally {
XmlTransformUtility.returnDocumentBuilder(builder);
}
BufferedReader br =
new BufferedReader(writer.toReader());
String line = null;
ReadableByteArrayOutputStream outStream = new ReadableByteArrayOutputStream();
OutputStreamWriter sb = new OutputStreamWriter(outStream, "UTF-8");
while ((line = br.readLine()) != null) {
line = line.trim();
sb.write(line);
}
sb.close();
return outStream.toByteArray();
}
代码示例来源:origin: org.fcrepo/fcrepo-server
builder = XmlTransformUtility.borrowDocumentBuilder();
Document doc = builder.parse(new ByteArrayInputStream(xmlContent));
XercesXmlSerializers.writeXmlNoSpace(doc, m_encoding, out);
out.close();
} finally {
代码示例来源:origin: fcrepo3/fcrepo
builder = XmlTransformUtility.borrowDocumentBuilder();
Document doc = builder.parse(new ByteArrayInputStream(xmlContent));
XercesXmlSerializers.writeXmlNoSpace(doc, m_encoding, out);
out.close();
} finally {
代码示例来源:origin: fcrepo3/fcrepo
@SuppressWarnings("deprecation")
private void testWriteXmlNoSpace(Document doc) throws Exception {
StringWriter sout = new StringWriter();
SunXmlSerializers.writeXmlNoSpace(doc, "UTF-8", sout);
String proprietary = sout.toString();
sout = new StringWriter();
XercesXmlSerializers.writeXmlNoSpace(doc, "UTF-8", sout);
String standard = sout.toString();
if (!proprietary.equals(standard)) {
System.out.println("<<<<");
System.out.println(proprietary);
System.out.println(">>>>");
System.out.println(standard);
}
assertEquals(proprietary, standard);
}
本文整理了Java中org.fcrepo.utilities.xml.XercesXmlSerializers.writeXmlNoSpace()方法的一些代码示例,展示了XercesXmlSeria
我是一名优秀的程序员,十分优秀!