HtmlPage page = ...; // your page DomNode node = ...; // look for node where to insert your text DomNode textNode = new DomText(page, "test"); node.appendChild(textNode );
/** * {@inheritDoc} */ @Override public DomNode appendChild(final org.w3c.dom.Node node) { final DomNode domNode = (DomNode) node; if (append_) { return target_.appendChild(domNode); } target_.insertBefore(domNode); return domNode; }
/** * {@inheritDoc} */ @Override public DomNode appendChild(final org.w3c.dom.Node node) { final DomNode domNode = (DomNode) node; if (append_) { return target_.appendChild(domNode); } target_.insertBefore(domNode); return domNode; }
/** * {@inheritDoc} */ @Override public DomNode appendChild(final org.w3c.dom.Node node) { final DomNode domNode = (DomNode) node; if (append_) { return target_.appendChild(domNode); } target_.insertBefore(domNode); return domNode; }
/** * {@inheritDoc} */ @Override public DomNode appendChild(final org.w3c.dom.Node node) { final DomNode domNode = (DomNode) node; if (append_) { return target_.appendChild(domNode); } target_.insertBefore(domNode); return domNode; }
/** * {@inheritDoc} */ @Override public DomNode appendChild(final org.w3c.dom.Node node) { final DomNode domNode = (DomNode) node; if (append_) { return target_.appendChild(domNode); } target_.insertBefore(domNode); return domNode; }
/** {@inheritDoc} */ @Override public void comment(final char[] ch, final int start, final int length) { handleCharacters(); final String data = new String(ch, start, length); final DomComment comment = new DomComment(page_, data); currentNode_.appendChild(comment); }
/** {@inheritDoc} */ @Override public void comment(final char[] ch, final int start, final int length) { handleCharacters(); final String data = new String(ch, start, length); final DomComment comment = new DomComment(page_, data); currentNode_.appendChild(comment); }
/** * {@inheritDoc} */ @Override public void setTextContent(final String textContent) { removeAllChildren(); if (textContent != null && !textContent.isEmpty()) { appendChild(new DomText(getPage(), textContent)); } }
/** * {@inheritDoc} */ @Override public void setTextContent(final String textContent) { removeAllChildren(); if (textContent != null && !textContent.isEmpty()) { appendChild(new DomText(getPage(), textContent)); } }
private void transform(final Node source, final DomNode parent) { final Object result = transform(source); if (result instanceof org.w3c.dom.Node) { final SgmlPage parentPage = parent.getPage(); final NodeList children = ((org.w3c.dom.Node) result).getChildNodes(); for (int i = 0; i < children.getLength(); i++) { XmlUtil.appendChild(parentPage, parent, children.item(i), true); } } else { final DomText text = new DomText(parent.getPage(), (String) result); parent.appendChild(text); } }
/** * The worker for setInnerText. * @param value the new value for the contents of this node */ protected void setInnerTextImpl(final String value) { final DomNode domNode = getDomNodeOrDie(); domNode.removeAllChildren(); if (value != null && !value.isEmpty()) { domNode.appendChild(new DomText(domNode.getPage(), value)); } }
private void transform(final XMLDOMNode source, final DomNode parent) { final Object result = transform(source); if (result instanceof org.w3c.dom.Node) { final SgmlPage parentPage = parent.getPage(); final NodeList children = ((org.w3c.dom.Node) result).getChildNodes(); for (int i = 0; i < children.getLength(); i++) { XmlUtil.appendChild(parentPage, parent, children.item(i), false); } } else { final DomText text = new DomText(parent.getPage(), (String) result); parent.appendChild(text); } }
/** {@inheritDoc} */ public void comment(final char[] ch, final int start, final int length) { handleCharacters(); final String data = String.valueOf(ch, start, length); if (!data.startsWith("[CDATA") || !page_.getWebClient().getBrowserVersion().isIE()) { final DomComment comment = new DomComment(page_, data); currentNode_.appendChild(comment); } }
/** {@inheritDoc} */ public void comment(final char[] ch, final int start, final int length) { handleCharacters(); final String data = String.valueOf(ch, start, length); if (!data.startsWith("[CDATA") || !page_.getWebClient().getBrowserVersion().isIE()) { final DomComment comment = new DomComment(page_, data); currentNode_.appendChild(comment); } }
/** * {@inheritDoc} */ public void setTextContent(final String textContent) { removeAllChildren(); appendChild(new DomText(getPage(), textContent)); }
/** * {@inheritDoc} */ public void setTextContent(final String textContent) { removeAllChildren(); appendChild(new DomText(getPage(), textContent)); }
/** * {@inheritDoc} */ public void setTextContent(final String textContent) { removeAllChildren(); appendChild(new DomText(getPage(), textContent)); }
/** {@inheritDoc} */ public void comment(final char[] ch, final int start, final int length) { handleCharacters(); final String data = String.valueOf(ch, start, length); if (!data.startsWith("[CDATA") || !page_.getWebClient().getBrowserVersion().isIE()) { final DomComment comment = new DomComment(page_, data); currentNode_.appendChild(comment); } }
/** * The worker for setInnerText. * @param value the new value for the contents of this node */ protected void setInnerTextImpl(final String value) { final DomNode domNode = getDomNodeOrDie(); domNode.removeAllChildren(); if (value != null && !value.isEmpty()) { domNode.appendChild(new DomText(domNode.getPage(), value)); } }