gpt4 book ai didi

org.fcrepo.utilities.XmlTransformUtility.parseNamespaceAware()方法的使用及代码示例

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

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

XmlTransformUtility.parseNamespaceAware介绍

暂无

代码示例

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

public static Document getDocumentFromBytes(byte[] data) throws Exception {
  Document doc =
    XmlTransformUtility.parseNamespaceAware(new ByteArrayInputStream(data));
  return doc;
}

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

public static Document parseNamespaceAware(File src)
    throws Exception {
  return parseNamespaceAware(new FileInputStream(src));
}

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

public static Document parseNamespaceAware(File src)
    throws Exception {
  return parseNamespaceAware(new FileInputStream(src));
}

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

public static String format(byte[] data) throws Exception {
  Document doc =
    XmlTransformUtility.parseNamespaceAware(new ByteArrayInputStream(data));
  return format(doc);
}

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

public static void saveDocument(String filename, byte[] data)
    throws Exception {
  Document doc = null;
  try {
    doc =
      XmlTransformUtility.parseNamespaceAware(new ByteArrayInputStream(data));
  } catch (Exception e) {
    String message = "Unable to save file: " + filename;
    logger.error(message);
    e.printStackTrace();
    throw new Exception(message, e);
  }
  saveDocument(filename, doc);
}

代码示例来源: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

@Before
public void parseDocs() throws Exception {
  InputStream docSrc;
  docSrc = getClass().getResourceAsStream(DC_SRC_PATH);
  dcDoc = XmlTransformUtility.parseNamespaceAware(docSrc);
  docSrc = getClass().getResourceAsStream(DEEP_SRC_PATH);
  deepDoc = XmlTransformUtility.parseNamespaceAware(docSrc);
  docSrc = getClass().getResourceAsStream(WSDL_SRC_PATH);
  wsdlDoc = XmlTransformUtility.parseNamespaceAware(docSrc);
  docSrc = getClass().getResourceAsStream(METS_SRC_PATH);
  metsDoc = XmlTransformUtility.parseNamespaceAware(docSrc);
}

代码示例来源: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

XmlTransformUtility.parseNamespaceAware(new FileInputStream(schemaFile));
_wsdlDoc =
  XmlTransformUtility.parseNamespaceAware(new FileInputStream(sourceWSDL));

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

XmlTransformUtility.parseNamespaceAware(new FileInputStream(schemaFile));
_wsdlDoc =
  XmlTransformUtility.parseNamespaceAware(new FileInputStream(sourceWSDL));

代码示例来源: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: org.fcrepo/fcrepo-server

XmlTransformUtility.parseNamespaceAware(configFile).getDocumentElement();

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

XmlTransformUtility.parseNamespaceAware(configFile).getDocumentElement();

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

try {
  ReadableCharArrayWriter buf = new ReadableCharArrayWriter();
  Document doc = XmlTransformUtility.parseNamespaceAware(data);

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