Android XML Element Child Create processAny(Element element, List any)

Here you can find the source of processAny(Element element, List any)

Description

Processes any element and add them into the element.

License

LGPL

Parameter

Parameter Description
element the element where to add the elements.
any the any elements to process.

Exception

Parameter Description
Exception if there is some error during processing.

Declaration

public static void processAny(Element element, List<Element> any)
        throws Exception 

Method Source Code

//package com.java2s;
/*//  w w w. j  a  v a2  s  . c o  m
 * Jitsi, the OpenSource Java VoIP and Instant Messaging client.
 *
 * Distributable under LGPL license.
 * See terms of license at gnu.org.
 */

import java.util.*;

import org.w3c.dom.*;

public class Main {
    /**
     * Processes any element and add them into the element.
     *
     * @param element the element where to add the elements.
     * @param any     the any elements to process.
     * @throws Exception if there is some error during processing.
     */
    public static void processAny(Element element, List<Element> any)
            throws Exception {
        for (Element anyElement : any) {
            Node importedElement = element.getOwnerDocument().importNode(
                    anyElement, true);
            element.appendChild(importedElement);
        }
    }
}

Related

  1. createChildElement(Element parent, String tagName, Document doc)