Java XML First Child Element GetFirstElementChild(Element tag)

Here you can find the source of GetFirstElementChild(Element tag)

Description

Get First Element Child

License

LGPL

Declaration

public static Element GetFirstElementChild(Element tag) 

Method Source Code

//package com.java2s;
/*//from  w w  w .j  ava2 s  .  c  om
 * JLib - Publicitas Java library v1.2.0.
 *
 * Copyright (c) 2005, 2006, 2007, 2008, 2009 Publicitas SA.
 * Licensed under LGPL (LGPL-LICENSE.txt) license.
 */

import org.w3c.dom.Element;
import org.w3c.dom.Node;

public class Main {
    public static Element GetFirstElementChild(Element tag) {
        Node n = tag.getFirstChild();
        while (n.getNodeType() != Node.ELEMENT_NODE) {
            n = n.getNextSibling();
        }
        Element e = (Element) n;
        return e;
    }
}

Related

  1. getFirstElementChild(Element aElement)
  2. getFirstElementChild(Element element)
  3. getFirstElementChild(Element elemNode)
  4. getFirstElementChild(Element elemNode)
  5. getFirstElementChild(Element parent)
  6. getFirstElementChild(final Element element, final String namespace, final String localname)
  7. getFirstElementChild(final Node node)
  8. getFirstElementChild(final Node node)
  9. getFirstElementChild(Node root)