/** * {@inheritDoc} */ @Override public HtmlElement getDocumentElement() { return (HtmlElement) super.getDocumentElement(); }
/** * {@inheritDoc} */ @Override public HtmlElement getDocumentElement() { return (HtmlElement) super.getDocumentElement(); }
/** * {@inheritDoc} */ @Override public HtmlElement getDocumentElement() { return (HtmlElement) super.getDocumentElement(); }
/** * {@inheritDoc} */ @Override public HtmlElement getDocumentElement() { return (HtmlElement) super.getDocumentElement(); }
/** * {@inheritDoc} */ @Override public HtmlElement getDocumentElement() { return (HtmlElement) super.getDocumentElement(); }
public void save(final SgmlPage page, final File file) throws IOException { String fileName = file.getName(); if (!fileName.endsWith(".htm") && !fileName.endsWith(".html")) { fileName += ".html"; } final File outputFile = new File(file.getParentFile(), fileName); if (outputFile.exists()) { throw new IOException("File already exists: " + outputFile); } fileName = fileName.substring(0, fileName.lastIndexOf('.')); outputDir_ = new File(file.getParentFile(), fileName); FileUtils.writeStringToFile(outputFile, asXml(page.getDocumentElement()), ISO_8859_1); }
/** * {@inheritDoc} * The current implementation just {@link DomNode#normalize()}s the document element. */ public void normalizeDocument() { getDocumentElement().normalize(); }
/** * {@inheritDoc} * The current implementation just {@link DomNode#normalize()}s the document element. */ public void normalizeDocument() { getDocumentElement().normalize(); }
/** * {@inheritDoc} * The current implementation just {@link DomNode#normalize()}s the document element. */ public void normalizeDocument() { getDocumentElement().normalize(); }
/** * {@inheritDoc} */ @Override public String asXml() { final DomElement documentElement = getDocumentElement(); if (documentElement == null) { return ""; } return documentElement.asXml(); }
/** * {@inheritDoc} * The current implementation just {@link DomNode#normalize()}s the document element. */ @Override public void normalizeDocument() { getDocumentElement().normalize(); }
/** * {@inheritDoc} */ @Override public String asXml() { return getDocumentElement().asXml(); }
/** * {@inheritDoc} */ @Override public String asXml() { return getDocumentElement().asXml(); }
/** * {@inheritDoc} */ @Override @JsxGetter({CHROME, FF}) public int getChildElementCount() { int counter = 0; if (getPage().getDocumentElement() != null) { counter++; } return counter; }
/** * Indicates if the node can be inserted. * @param childObject the node * @return {@code false} if it is not allowed here */ private static boolean isNodeInsertable(final Node childObject) { if (childObject instanceof HTMLHtmlElement) { final DomNode domNode = childObject.getDomNodeOrDie(); return domNode.getPage().getDocumentElement() != domNode; } return true; }
/** * Gets the JavaScript property "documentElement" for the document. * @return the root node for the document */ public Element jsxGet_documentElement() { final Object documentElement = getPage().getDocumentElement(); if (documentElement == null) { // for instance with an XML document with parsing error return null; } return (Element) getScriptableFor(documentElement); }
/** * Gets the JavaScript property "documentElement" for the document. * @return the root node for the document */ public Element jsxGet_documentElement() { final Object documentElement = getPage().getDocumentElement(); if (documentElement == null) { // for instance with an XML document with parsing error return null; } return (Element) getScriptableFor(documentElement); }
/** * Gets the JavaScript property "documentElement" for the document. * @return the root node for the document */ public Element jsxGet_documentElement() { final Object documentElement = getPage().getDocumentElement(); if (documentElement == null) { // for instance with an XML document with parsing error return null; } return (Element) getScriptableFor(documentElement); }
/** * Indicates if the node can be inserted. * @param childObject the node * @return {@code false} if it is not allowed here */ private static boolean isNodeInsertable(final Node childObject) { if (childObject instanceof HTMLHtmlElement) { final DomNode domNode = childObject.getDomNodeOrDie(); return domNode.getPage().getDocumentElement() != domNode; } return true; }
/** * Gets the JavaScript property {@code documentElement} for the document. * @return the root node for the document */ @JsxGetter public Element getDocumentElement() { final Object documentElement = getPage().getDocumentElement(); if (documentElement == null) { // for instance with an XML document with parsing error return null; } return (Element) getScriptableFor(documentElement); }