Search in sources :

Example 6 with Node

use of com.gargoylesoftware.htmlunit.javascript.host.dom.Node in project htmlunit by HtmlUnit.

the class XSLTProcessor method transform.

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++) {
            XmlUtils.appendChild(parentPage, parent, children.item(i), true);
        }
    } else {
        final DomText text = new DomText(parent.getPage(), (String) result);
        parent.appendChild(text);
    }
}
Also used : DomText(com.gargoylesoftware.htmlunit.html.DomText) Node(com.gargoylesoftware.htmlunit.javascript.host.dom.Node) DomNode(com.gargoylesoftware.htmlunit.html.DomNode) NodeList(org.w3c.dom.NodeList) SgmlPage(com.gargoylesoftware.htmlunit.SgmlPage)

Aggregations

Node (com.gargoylesoftware.htmlunit.javascript.host.dom.Node)6 DomNode (com.gargoylesoftware.htmlunit.html.DomNode)5 JsxFunction (com.gargoylesoftware.htmlunit.javascript.configuration.JsxFunction)4 SgmlPage (com.gargoylesoftware.htmlunit.SgmlPage)2 BaseFrameElement (com.gargoylesoftware.htmlunit.html.BaseFrameElement)1 DomText (com.gargoylesoftware.htmlunit.html.DomText)1 FrameWindow (com.gargoylesoftware.htmlunit.html.FrameWindow)1 PageDenied (com.gargoylesoftware.htmlunit.html.FrameWindow.PageDenied)1 HtmlPage (com.gargoylesoftware.htmlunit.html.HtmlPage)1 XHtmlPage (com.gargoylesoftware.htmlunit.html.XHtmlPage)1 Element (com.gargoylesoftware.htmlunit.javascript.host.Element)1 CDATASection (com.gargoylesoftware.htmlunit.javascript.host.dom.CDATASection)1 Document (com.gargoylesoftware.htmlunit.javascript.host.dom.Document)1 DocumentFragment (com.gargoylesoftware.htmlunit.javascript.host.dom.DocumentFragment)1 NodeList (com.gargoylesoftware.htmlunit.javascript.host.dom.NodeList)1 Event (com.gargoylesoftware.htmlunit.javascript.host.event.Event)1 HTMLDocument (com.gargoylesoftware.htmlunit.javascript.host.html.HTMLDocument)1 ProxyDomNode (com.gargoylesoftware.htmlunit.javascript.host.html.HTMLElement.ProxyDomNode)1 XmlPage (com.gargoylesoftware.htmlunit.xml.XmlPage)1 Policy (com.shapesecurity.salvation2.Policy)1