Package groovy.xml

Examples of groovy.xml.DOMBuilder


        try {
            super.populateNamespace(namespace, exchange, message);

            // lets output a builder
            DocumentBuilder documentBuilder = getDocumentBuilder();
            namespace.put("builder", new DOMBuilder(documentBuilder));
        }
        catch (ParserConfigurationException e) {
            throw new MessagingException("Failed to create DOM DocumentBuilder: " + e, e);
        }
    }
View Full Code Here


        try {
            super.populateNamespace(namespace, exchange, in, out);

            // lets output a builder
            DocumentBuilder documentBuilder = getDocumentBuilder();
            namespace.put("builder", new DOMBuilder(documentBuilder));
        }
        catch (ParserConfigurationException e) {
            throw new MessagingException("Failed to create DOM DocumentBuilder: " + e, e);
        }
    }
View Full Code Here

        return replaceNode((Element) self.item(0), c);
    }

    public static Element replaceNode(Element self, Closure c) {
        // Use DOMBuilder to generate the replacement node.
        DOMBuilder b = new DOMBuilder(self.getOwnerDocument());
        Element newNode = (Element) b.invokeMethod("rootNode", c);

        // The replacement node is the first child element of 'rootNode'.
        Node n = newNode.getFirstChild();
        while (n != null && n.getNodeType() != Node.ELEMENT_NODE) {
            n = n.getNextSibling();
View Full Code Here

    public static void plus(Element self, Closure c) {
        Node parent = self.getParentNode();
        Node beforeNode = self.getNextSibling();

        DOMBuilder b = new DOMBuilder(self.getOwnerDocument());
        Element newNodes = (Element) b.invokeMethod("rootNode", c);

        Iterator<Node> iter = XmlGroovyMethods.iterator(children(newNodes));
        while (iter.hasNext()) {
            parent.insertBefore(iter.next(), beforeNode);
        }
View Full Code Here

        try {
            super.populateBindings(bindings, exchange, in, out);

            // lets output a builder
            DocumentBuilder documentBuilder = getDocumentBuilder();
            bindings.put("builder", new DOMBuilder(documentBuilder));
        }
        catch (ParserConfigurationException e) {
            throw new MessagingException("Failed to create DOM DocumentBuilder: " + e, e);
        }
    }
View Full Code Here

        try {
            super.populateBindings(bindings, exchange, in, out);

            // lets output a builder
            DocumentBuilder documentBuilder = getDocumentBuilder();
            bindings.put("builder", new DOMBuilder(documentBuilder));
        }
        catch (ParserConfigurationException e) {
            throw new MessagingException("Failed to create DOM DocumentBuilder: " + e, e);
        }
    }
View Full Code Here

    }

    private static void appendNodes(Node self, Closure c) {
        Node parent = self.getParentNode();
        Node beforeNode = self.getNextSibling();
        DOMBuilder b = new DOMBuilder(self.getOwnerDocument());
        Element newNodes = (Element) b.invokeMethod("rootNode", c);
        Iterator<Node> iter = XmlGroovyMethods.iterator(children(newNodes));
        while (iter.hasNext()) {
            parent.insertBefore(iter.next(), beforeNode);
        }
    }
View Full Code Here

    public static void plus(Element self, Closure c) {
        Node parent = self.getParentNode();
        Node beforeNode = self.getNextSibling();

        DOMBuilder b = new DOMBuilder(self.getOwnerDocument());
        Element newNodes = (Element) b.invokeMethod("rootNode", c);

        Iterator<Node> iter = DefaultGroovyMethods.iterator(children(newNodes));
        while (iter.hasNext()) {
            parent.insertBefore(iter.next(), beforeNode);
        }
View Full Code Here

    public static void plus(NodeList self, Closure c) {
        Node lastNode = self.item(self.getLength() - 1);
        Node parent = lastNode.getParentNode();
        Node beforeNode = lastNode.getNextSibling();

        DOMBuilder b = new DOMBuilder(lastNode.getOwnerDocument());
        Element newNodes = (Element) b.invokeMethod("rootNode", c);

        Iterator<Node> iter = DefaultGroovyMethods.iterator(children(newNodes));
        while (iter.hasNext()) {
            parent.insertBefore(iter.next(), beforeNode);
        }
View Full Code Here

TOP

Related Classes of groovy.xml.DOMBuilder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.