gpt4 book ai didi

org.fcrepo.utilities.xml.XercesXmlSerializers.writeMgmtNoDecl()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-27 04:25:05 29 4
gpt4 key购买 nike

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

XercesXmlSerializers.writeMgmtNoDecl介绍

暂无

代码示例

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

private void getXML(InputStream in, OutputStream outStream, boolean includeXMLDeclaration) throws GeneralException {
  // parse with xerces and re-serialize the fixed xml to a byte array
  try {
    BufferedWriter out = new BufferedWriter(
        new OutputStreamWriter(outStream, Charset.forName("UTF-8")));
    Document doc =
      XmlTransformUtility.parseNamespaceAware(in);
    if (includeXMLDeclaration) {
      XercesXmlSerializers.writeMgmtWithDecl(doc, out);
    } else {
      XercesXmlSerializers.writeMgmtNoDecl(doc, out);
    }
    out.flush();
  } catch (Exception e) {
    String message = e.getMessage();
    if (message == null) {
      message = "";
    }
    throw new GeneralException("XML was not well-formed. " + message, e);
  }
}
private void checkDatastreamID(String id) throws ValidationException {

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

private void getXML(InputStream in, OutputStream outStream, boolean includeXMLDeclaration) throws GeneralException {
  // parse with xerces and re-serialize the fixed xml to a byte array
  try {
    BufferedWriter out = new BufferedWriter(
        new OutputStreamWriter(outStream, Charset.forName("UTF-8")));
    Document doc =
      XmlTransformUtility.parseNamespaceAware(in);
    if (includeXMLDeclaration) {
      XercesXmlSerializers.writeMgmtWithDecl(doc, out);
    } else {
      XercesXmlSerializers.writeMgmtNoDecl(doc, out);
    }
    out.flush();
  } catch (Exception e) {
    String message = e.getMessage();
    if (message == null) {
      message = "";
    }
    throw new GeneralException("XML was not well-formed. " + message, e);
  }
}
private void checkDatastreamID(String id) throws ValidationException {

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

OutputStreamWriter writer =
      new OutputStreamWriter(outStream, Charset.forName("UTF-8"));
  XercesXmlSerializers.writeMgmtNoDecl(doc, writer);
  writer.close();
} catch (Exception e) {

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

Document doc = XmlTransformUtility.parseNamespaceAware(data);
XercesXmlSerializers.writeMgmtNoDecl(doc, buf);
buf.close();
content = buf.getString();

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

new OutputStreamWriter(outStream, Charset.forName("UTF-8"));
XercesXmlSerializers.writeMgmtNoDecl(doc, writer);
writer.close();

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

@SuppressWarnings("deprecation")
private void testWriteMgmtNoDecl(Document doc) throws Exception {
  StringWriter sout = new StringWriter();
  SunXmlSerializers.writeMgmtNoDecl(doc, sout);
  String proprietary = sout.toString();
  sout = new StringWriter();
  XercesXmlSerializers.writeMgmtNoDecl(doc, 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);
}

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