gpt4 book ai didi

org.xhtmlrenderer.resource.XMLResource.load()方法的使用及代码示例

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

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

XMLResource.load介绍

暂无

代码示例

代码示例来源:origin: org.xhtmlrenderer/core-renderer

public void setDocumentFromString(String content) {
  InputSource is = new InputSource(new BufferedReader(new StringReader(content)));
  Document dom = XMLResource.load(is).getDocument();
  setDocument(dom, null);
}

代码示例来源:origin: com.google.code.maven-play-plugin.org.xhtmlrenderer/core-renderer

public void setDocumentFromString(String content, String url, NamespaceHandler nsh) {
  InputSource is = new InputSource(new BufferedReader(new StringReader(content)));
  Document dom = XMLResource.load(is).getDocument();
  setDocument(dom, url, nsh);
}

代码示例来源:origin: org.xhtmlrenderer/core-renderer

public void setDocumentFromString(String content, String url, NamespaceHandler nsh) {
  InputSource is = new InputSource(new BufferedReader(new StringReader(content)));
  Document dom = XMLResource.load(is).getDocument();
  setDocument(dom, url, nsh);
}

代码示例来源:origin: org.xhtmlrenderer/flying-saucer-pdf-itext5

public void setDocumentFromString(String content, String baseUrl) {
  InputSource is = new InputSource(new BufferedReader(new StringReader(content)));
  Document dom = XMLResource.load(is).getDocument();
  setDocument(dom, baseUrl);
}

代码示例来源:origin: org.xhtmlrenderer/flying-saucer-pdf

public void setDocumentFromString(String content, String baseUrl) {
  InputSource is = new InputSource(new BufferedReader(new StringReader(content)));
  Document dom = XMLResource.load(is).getDocument();
  setDocument(dom, baseUrl);
}

代码示例来源:origin: org.xhtmlrenderer/flying-saucer-pdf-openpdf

public void setDocumentFromString(String content, String baseUrl) {
  InputSource is = new InputSource(new BufferedReader(new StringReader(content)));
  Document dom = XMLResource.load(is).getDocument();
  setDocument(dom, baseUrl);
}

代码示例来源:origin: com.google.code.maven-play-plugin.org.xhtmlrenderer/core-renderer

public void setDocumentFromString(String content, String baseUrl) {
  InputSource is = new InputSource(new BufferedReader(new StringReader(content)));
  Document dom = XMLResource.load(is).getDocument();
  setDocument(dom, baseUrl);
}

代码示例来源:origin: com.google.code.maven-play-plugin.org.xhtmlrenderer/core-renderer

public void setDocumentFromString(String content, String url, NamespaceHandler nsh) {
  InputSource is = new InputSource(new BufferedReader(new StringReader(content)));
  Document dom = XMLResource.load(is).getDocument();
  setDocument(dom, url, nsh);
}

代码示例来源:origin: com.google.code.maven-play-plugin.org.xhtmlrenderer/core-renderer

/**
 * Retrieves the XML located at the given URI. It's assumed the URI does point to a XML--the URI will
 * be accessed (using java.io or java.net), opened, read and then passed into the XML parser (XMLReader)
 * configured for Flying Saucer. The result is packed up into an XMLResource for later consumption.
 *
 * @param uri Location of the XML source.
 * @return An XMLResource containing the image.
 */
public XMLResource getXMLResource(String uri) {
  InputStream inputStream = resolveAndOpenStream(uri);
  XMLResource xmlResource;
  try {
    xmlResource = XMLResource.load(inputStream);
  } finally {
    if ( inputStream != null ) try {
      inputStream.close();
    } catch (IOException e) {
      // swallow
    }
  }
  return xmlResource;
}

代码示例来源:origin: org.xhtmlrenderer/core-renderer

/**
 * Retrieves the XML located at the given URI. It's assumed the URI does point to a XML--the URI will
 * be accessed (using java.io or java.net), opened, read and then passed into the XML parser (XMLReader)
 * configured for Flying Saucer. The result is packed up into an XMLResource for later consumption.
 *
 * @param uri Location of the XML source.
 * @return An XMLResource containing the image.
 */
public XMLResource getXMLResource(String uri) {
  InputStream inputStream = resolveAndOpenStream(uri);
  XMLResource xmlResource;
  try {
    xmlResource = XMLResource.load(inputStream);
  } finally {
    if ( inputStream != null ) try {
      inputStream.close();
    } catch (IOException e) {
      // swallow
    }
  }
  return xmlResource;
}

代码示例来源:origin: org.xhtmlrenderer/flying-saucer-pdf-itext5

public void setDocument(byte[] bytes) throws IOException {
  ByteArrayInputStream inputStream = new ByteArrayInputStream(bytes);
  Document dom = XMLResource.load(inputStream).getDocument();
  setDocument(dom, "");
}

代码示例来源:origin: com.google.code.maven-play-plugin.org.xhtmlrenderer/core-renderer

public void setDocument(InputStream stream, String url, NamespaceHandler nsh) {
  Document dom = XMLResource.load(stream).getDocument();
  setDocument(dom, url, nsh);
}

代码示例来源:origin: com.google.code.maven-play-plugin.org.xhtmlrenderer/core-renderer

public void setDocument(InputStream stream, String url, NamespaceHandler nsh) {
  Document dom = XMLResource.load(stream).getDocument();
  setDocument(dom, url, nsh);
}

代码示例来源:origin: org.xhtmlrenderer/core-renderer

public void setDocument(InputStream stream, String url, NamespaceHandler nsh) {
  Document dom = XMLResource.load(stream).getDocument();
  setDocument(dom, url, nsh);
}

代码示例来源:origin: it.innove/play2-pdf

@Override
public XMLResource getXMLResource(String uri) {
  Option<InputStream> option = environment.asScala().resourceAsStream(uri);
  if (option.isDefined()) {
    return XMLResource.load(option.get());
  } else {
    return super.getXMLResource(uri);
  }
}

代码示例来源:origin: ggp-org/ggp-base

} catch (SAXException | IOException ex) {
  xhtml = "<html><head><title>Error</title></head><body><h1>Error parsing visualization</h1><pre id='pre'></pre></body></html>";
  dom = XMLResource.load(new StringReader(xhtml)).getDocument();
  dom.getElementById("pre").appendChild(dom.createTextNode(ex.toString()));
  ex.printStackTrace();

代码示例来源:origin: com.google.code.maven-play-plugin.org.xhtmlrenderer/core-renderer

public XMLResource getXMLResource(String uri) {
  if (uri == null) {
    XRLog.exception("null uri requested");
    return null;
  }
  InputStream inputStream = getInputStream(uri);
  if (inputStream == null) {
    XRLog.exception("couldn't get InputStream for " + uri);
    return null;
  }
  XMLResource xmlResource;
  try {
    xmlResource = XMLResource.load(inputStream);
  } catch (Exception e) {
    XRLog.exception("unable to load xml resource: " + uri, e);
    return null;
  } finally {
    if (inputStream != null) {
      try {
        inputStream.close();
      } catch (IOException e) {
        // swallow
      }
    }
  }
  return xmlResource;
}

代码示例来源:origin: com.google.code.maven-play-plugin.org.xhtmlrenderer/core-renderer

/**
 * Retrieves the XML located at the given URI. It's assumed the URI does point to a XML--the URI will
 * be accessed (using java.io or java.net), opened, read and then passed into the XML parser (XMLReader)
 * configured for Flying Saucer. The result is packed up into an XMLResource for later consumption.
 *
 * @param uri Location of the XML source.
 * @return An XMLResource containing the image.
 */
public XMLResource getXMLResource(String uri) {
  String ruri = _uriResolver.resolve(uri);
  StreamResource sr = new StreamResource(ruri);
  try {
    sr.connect();
    BufferedInputStream bis = sr.bufferedStream();
    return XMLResource.load(bis);
  } catch (IOException e) {
    return null;
  } finally {
    sr.close();
  }
}

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