com.sun.org.apache.xml.internal.serialize.OutputFormat.setPreserveSpace()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(3.8k)|赞(0)|评价(0)|浏览(138)

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

OutputFormat.setPreserveSpace介绍

[英]Sets space preserving as the default behavior. The default is space stripping and all elements that do not specify otherwise or use the default value will not preserve spaces.
[中]将保留空间设置为默认行为。默认设置为空间剥离,所有未另行指定或未使用默认值的图元都不会保留空间。

代码示例

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-tomcat5

format.setPreserveSpace (true);
StringWriter sw = new StringWriter();
org.w3c.dom.Element rootElement = doc.getDocumentElement();

代码示例来源:origin: fcrepo3/fcrepo

private static OutputFormat getXmlNoSpace(String encoding) {
  OutputFormat fmt = new OutputFormat("XML", encoding, false);
  // indent == 0 means add no indenting
  fmt.setIndent(0);
  // default line width is 72, but only applies when indenting
  fmt.setLineWidth(0);
  fmt.setPreserveSpace(false);
  return fmt;
}

代码示例来源:origin: org.fcrepo/fcrepo-common

private static OutputFormat getXmlNoSpace(String encoding) {
  OutputFormat fmt = new OutputFormat("XML", encoding, false);
  // indent == 0 means add no indenting
  fmt.setIndent(0);
  // default line width is 72, but only applies when indenting
  fmt.setLineWidth(0);
  fmt.setPreserveSpace(false);
  return fmt;
}

代码示例来源:origin: org.fcrepo/fcrepo-common

private static OutputFormat getConsoleWithDocType() {
  OutputFormat fmt = new OutputFormat("XML", "UTF-8", true);
  fmt.setIndent(2);
  fmt.setLineWidth(80);
  fmt.setPreserveSpace(false);
  // default is false
  fmt.setOmitXMLDeclaration(false);
  // default is false
  fmt.setOmitDocumentType(false);
  return fmt;
}

代码示例来源:origin: org.fcrepo/fcrepo-common

private static OutputFormat getMgmtWithDecl() {
  OutputFormat fmt = new OutputFormat("XML", "UTF-8", true);
  fmt.setIndent(2);
  fmt.setLineWidth(120);
  fmt.setPreserveSpace(false);
  fmt.setOmitXMLDeclaration(false);
  fmt.setOmitDocumentType(true);
  return fmt;
}

代码示例来源:origin: fcrepo3/fcrepo

private static OutputFormat getMgmtWithDecl() {
  OutputFormat fmt = new OutputFormat("XML", "UTF-8", true);
  fmt.setIndent(2);
  fmt.setLineWidth(120);
  fmt.setPreserveSpace(false);
  fmt.setOmitXMLDeclaration(false);
  fmt.setOmitDocumentType(true);
  return fmt;
}

代码示例来源:origin: fcrepo3/fcrepo

private static OutputFormat getConsoleWithDocType() {
  OutputFormat fmt = new OutputFormat("XML", "UTF-8", true);
  fmt.setIndent(2);
  fmt.setLineWidth(80);
  fmt.setPreserveSpace(false);
  // default is false
  fmt.setOmitXMLDeclaration(false);
  // default is false
  fmt.setOmitDocumentType(false);
  return fmt;
}

代码示例来源:origin: org.fcrepo/fcrepo-common

private static OutputFormat getConsoleNoDocType() {
  OutputFormat fmt = new OutputFormat("XML", "UTF-8", true);
  fmt.setIndent(2);
  fmt.setLineWidth(80);
  fmt.setPreserveSpace(false);
  // default is false
  fmt.setOmitXMLDeclaration(false);
  fmt.setOmitDocumentType(true);
  return fmt;
}

代码示例来源:origin: org.fcrepo/fcrepo-common

private static OutputFormat getMgmtNoDecl() {
  OutputFormat fmt = new OutputFormat("XML", "UTF-8", true);
  fmt.setIndent(2);
  fmt.setLineWidth(120);
  fmt.setPreserveSpace(false);
  fmt.setOmitXMLDeclaration(true);
  fmt.setOmitDocumentType(true);
  return fmt;
}

代码示例来源:origin: fcrepo3/fcrepo

private static OutputFormat getConsoleNoDocType() {
  OutputFormat fmt = new OutputFormat("XML", "UTF-8", true);
  fmt.setIndent(2);
  fmt.setLineWidth(80);
  fmt.setPreserveSpace(false);
  // default is false
  fmt.setOmitXMLDeclaration(false);
  fmt.setOmitDocumentType(true);
  return fmt;
}

代码示例来源:origin: fcrepo3/fcrepo

private static OutputFormat getMgmtNoDecl() {
  OutputFormat fmt = new OutputFormat("XML", "UTF-8", true);
  fmt.setIndent(2);
  fmt.setLineWidth(120);
  fmt.setPreserveSpace(false);
  fmt.setOmitXMLDeclaration(true);
  fmt.setOmitDocumentType(true);
  return fmt;
}

相关文章