/** * Renders an XML Document instance. Make sure that no relative resources * are needed * * @param doc The document to render. */ public void setDocument(Document doc) { setDocument(doc, ""); }
/** * Loads and renders a Document given a uri. The uri is resolved by the * UserAgentCallback * * @param uri */ public void setDocument(String uri) { setDocument(loadDocument(uri), uri); }
/** * Renders a Document read from an InputStream using a URL as a base URL for * relative paths. * * @param file The file to read the Document from. Relative paths will be * resolved based on the file's parent directory. * @throws MalformedURLException */ public void setDocument(File file) throws MalformedURLException { File parent = file.getParentFile(); String parentURL = (parent == null ? "" : parent.toURI().toURL() .toExternalForm()); setDocument(loadDocument(file.toURI().toURL().toExternalForm()), parentURL); }