Java XML First Child Element VectoriseFirstChildrenNodes(Node node, Vector elements)

Here you can find the source of VectoriseFirstChildrenNodes(Node node, Vector elements)

Description

It creates a vector with contents all the first children of a node (without the node itself)

License

Open Source License

Declaration

public static void VectoriseFirstChildrenNodes(Node node,
        Vector elements) 

Method Source Code

//package com.java2s;
// under the terms of "Eclipse Public License v1.0"

import java.util.Vector;

import org.w3c.dom.Node;
import org.w3c.dom.NodeList;

public class Main {
    /**// ww w. jav a 2 s  . c  om
     * It creates a vector with contents all the first children of a node
     * (without the node itself)
     */
    public static void VectoriseFirstChildrenNodes(Node node,
            Vector elements) {
        NodeList list = node.getChildNodes();
        if (list.getLength() > 0)
            for (int i = 0; i < list.getLength(); i++)
                elements.add(list.item(i));
    }
}

Related

  1. getFirstTextChild(Node node)
  2. getFirstVisibleChildElement(Node parent)
  3. getValueOfFirstElementChild(final Element element, final String namespace, final String localname)
  4. insertBeforeFirstChild(Element object, Element attrId)
  5. readFirstChild(Node parentNode, String nodeName)
  6. xmlFirstChild(final Element parent, final String childName, final boolean isThrow)